# Makefile				Jaguar WalZ	v1.0
#====================================================================

#====================================================================
#				Paths
#====================================================================

BINDIR 		= /jaguar/bin/
INC			= /jaguar/include

#====================================================================
#				Macro &	Assembler flags
#====================================================================

STADDR = 802000
MACFLAGS = -fb -g -rl -i$(MACPATH)
#MACFLAGS =	-fb	-g
ALNFLAGS = -v -rd -e -a	4000 $(STADDR) 19000
#ALNFLAGS =	-v -rd -e -a $(STADDR) x 4000
PARSERFLAGS	= -q
GCCFLAGS = -B$(BINDIR) -O2 -Wall -fomit-frame-pointer	-b m68k	-V2.6 
#GCCFLAGS =	-M -b m68k -V2.6
#====================================================================
#				Default	Rules
#====================================================================
.SUFFIXES:				.o .c

.c.o:
		gcc	$(GCCFLAGS)	-c $< -o $*.o


#====================================================================
.SUFFIXES:				.o .s

.s.o:
		mac	$(MACFLAGS)	$*


#====================================================================
#.SUFFIXES:				 .bin .gas
#
#.gas.o:
#		gasm -o	-CGPU -I$(INC) -R1 $*
#		ltxconv	-l $*
#
#====================================================================
.SUFFIXES:								.oj	.das

.das.oj:
		mac	$(MACFLAGS)	-o$*.oj	$*.das


#====================================================================
.SUFFIXES:								.cry .tga

.tga.cry:
		tga__cry -q	-b $*.tga

#====================================================================
.SUFFIXES:								.lzj .tga

.tga.lzj:
		tga__cry -q	-b $*.tga
		lzjag -q -c	$*.cry
		rm $*.cry

#====================================================================
.SUFFIXES:								.o .out

.out.o:
		mac	$(MACFLAGS)	-o $*.o	$*.out


#====================================================================

#FULSYN	= fulsyn.oj

OBJS =	startup.o b2k_strt.o main.o	obj_list.o gpucode.o eeprom.o \
		gameinit.o b2k_game.o ball.o paddle.o brick.o goody.o \
		displays.o player.o	star.o support.o screens.o images.o	\
		im_glass.o sprite1.o sprite2.o num_tab.o jagobj.o hiscore.o	\
		bomb.o option.o	ripple.o droid.o synthlib.o	

b2k.abs: $(OBJS) 
		aln	$(ALNFLAGS)	-o b2k.abs -c b2k.lnk

# Dependencies
startup.o:		startup.s images/mp_games.rgb

gpucode.o:		gpucode.s

b2k_strt.o:		b2k_strt.s b2k.tx

eeprom.o:		eeprom.s

images.o:		images.s images/brick_0.lzj	images/brick_1.lzj images/brick_2.lzj \
				images/brick_3.lzj images/brick_4.lzj images/brk_drop.lzj \
				images/digits.lzj images/message.cry images/hs_alpha.cry \
				images/panel.lzj images/nebula.lzj images/title.lzj	\
				images/transit.lzj images/b2k_bkg0.lzj	images/b2k_bkg1.lzj	\
				images/b2k_bkg2.lzj	images/b2k_bkg3.lzj	images/b2k_bkg4.lzj	\
				images/b2k_bkg5.lzj	images/b2k_bkg6.lzj	images/b2k_bkg7.lzj	\
				images/b2k_bkg8.lzj	images/b2k_bkg9.lzj	images/icons.cry \
				images/hs_title.cry images/hs_congr.cry	images/hs_playr.cry	\
				images/hs_use.cry images/pu_music.cry images/pu_fx.cry \
				images/brk_clas.lzj images/dig_clas.lzj \
				images/optstart.cry images/opt_strt.cry images/opt_game.cry \
				images/opt_text.cry	images/opt_butn.cry images/opt_vol2.cry \
				images/opt_use.cry images/opt_plyr.cry images/opt_snds.cry \
				images/level.lzj

sprite1.o:		sprite1.s images/ball_1.lzj	images/ball_2.lzj \
				images/ball_3.lzj images/ball_4.lzj	images\pad_face.cry \
				images/paddles.cry images/bomb.lzj images/bombexpl.lzj \
				images/ripple.lzj images/shatter.cry images/ball_5.lzj

sprite2.o:		sprite2.s images/PwrUp00.lzj images/PwrUp01.lzj images/PwrUp02.lzj \
				images/PwrUp03.lzj images/PwrUp04.lzj images/PwrUp05.lzj \
				images/PwrUp06.lzj images/PwrUp07.lzj images/PwrUp08.lzj \
				images/PwrUp09.lzj images/PwrUp10.lzj images/PwrUp11.lzj \
				images/PwrUp12.lzj images/PwrUp13.lzj images/PwrUp14.lzj \
				images/PwrUp15.lzj \
				images/gd_lnch.lzj images/gd_drop.lzj images/stinger.lzj \
				images/droid1_0.cry	images/droid1_1.cry	images/droid1_2.cry	\
				images/droid2_0.cry	images/droid2_1.cry	images/droid2_2.cry	\
				images/droid3_0.cry	images/droid3_1.cry	images/droid3_2.cry

im_glass.o:		im_glass.s images/sideglas.lzj \
				images/backglas.cry	images/score.lzj images/barrier1.lzj

main.o:			main.c jagobj.h	support.h star.h \
				displays.h star.h player.h ball.h goody.h paddle.h \
				brick.h	bomb.h b2k_game.h option.h

gameinit.o:		\jaguar\include\jaguar.h gameinit.c	gameinit.h jagobj.h	\
				brick.h	support.h ball.h paddle.h displays.h star.h	\
				player.h goody.h bomb.h	option.h

ball.o:			\jaguar\include\jaguar.h ball.c	ball.h support.h brick.h \
				paddle.h jagobj.h b2k_game.h displays.h	player.h goody.h \
				bomb.h option.h	ripple.h droid.h

brick.o:		\jaguar\include\jaguar.h brick.c brick.h support.h jagobj.h \
				b2k_game.h player.h ball.h goody.h paddle.h bomb.h option.h \
				displays.h

b2k_game.o:		\jaguar\include\jaguar.h b2k_game.c	player.h support.h ball.h \
				goody.h	paddle.h brick.h bomb.h	b2k_game.h displays.h jagobj.h \
				star.h option.h	droid.h	ripple.h hiscore.h

player.o: 		\jaguar\include\jaguar.h player.c support.h	player.h ball.h	\
				goody.h	paddle.h brick.h bomb.h	option.h displays.h hiscore.h

displays.o:		\jaguar\include\jaguar.h displays.c	displays.h support.h \
				jagobj.h player.h ball.h goody.h paddle.h brick.h bomb.h \
				option.h b2k_game.h	

goody.o: 		\jaguar\include\jaguar.h goody.c goody.h support.h \
				brick.h	paddle.h ball.h	displays.h player.h	bomb.h b2k_game.h \
				option.h ripple.h droid.h

droid.o: 		\jaguar\include\jaguar.h droid.c droid.h goody.h support.h \
				paddle.h player.h ripple.h ball.h brick.h bomb.h b2k_game.h \
				option.h

star.o:			\jaguar\include\jaguar.h star.c	support.h star.h player.h \
				ball.h goody.h paddle.h	brick.h	bomb.h option.h

support.o: 		\jaguar\include\jaguar.h support.c support.h player.h \
				ball.h goody.h paddle.h	brick.h	bomb.h option.h b2k_game.h

paddle.o:		\jaguar\include\jaguar.h paddle.c paddle.h support.h \
				jagobj.h ball.h brick.h player.h goody.h bomb.h option.h \
				b2k_game.h displays.h

bomb.o:			\jaguar\include\jaguar.h bomb.c	bomb.h support.h brick.h \
				paddle.h player.h ball.h goody.h option.h ripple.h b2k_game.h \
				displays.h

num_tab.o:		num_tab.s

jagobj.o: 		jagobj.c jagobj.h support.h	player.h ball.h	goody.h	paddle.h \
				brick.h	bomb.h displays.h option.h b2k_game.h

ripple.o:		ripple.c \jaguar\include\jaguar.h ripple.h support.h player.h \
				ball.h goody.h paddle.h	brick.h	bomb.h option.h

hiscore.o:		\jaguar\include\jaguar.h hiscore.c hiscore.h support.h \
				option.h player.h ball.h goody.h paddle.h brick.h bomb.h \
				displays.h

option.o: 		\jaguar\include\jaguar.h option.c support.h	option.h player.h \
				ball.h goody.h paddle.h	brick.h	bomb.h b2k_game.h hiscore.h	\
				displays.h 


#==============================================================================
# Image	file dependancies
#==============================================================================
#images.s
#
images/pad_face.cry:	images/pad_face.tga
	tga__cry -q	-g -b $*.tga

images/backglas.cry:		images/backglas.tga
	tga__cry -q	-g -b $*.tga

images/sideglas.lzj:		images/sideglas.tga
	tga__cry -q	-g -b $*.tga
	lzjag -q -c	$*.cry
	rm $*.cry

images/barrier1.lzj:  	images/barrier1.tga
	tga__cry -q	-g -b $*.tga
	lzjag -q -c	$*.cry
	rm $*.cry

images/mp_games.rgb:	images/mp_games.tga
	tga__cry -q	-b -r $*.tga

#============================================================================
# Sound	and	MIDI dependencies
#============================================================================
#syncore.oj:		syncore.das
synthlib.o:		synthlib.s	synthlib.inc syncore.das
