# use 'vmake' (not 'make'!) to run this script!

# set this to where Cybiko SDK actually resides
#CYBIKO_SDK = C:\Program Files\Cybiko Inc\Cybiko SDK

NAME = Highway_Hitman
OBJ = src/Bullet.o src/Explosion.o src/Main.o \
      src/Screen.o src/Utils.o src/Vehicles.o
RES = res/0.help res/big_explosion.pic res/drive.mus \
      res/explosion.mus res/explosion.pic res/filer.list \
      res/highway_hitman.pic res/high_score.pic res/intro.pic \
      res/knock.mus res/level.mus res/lose.mus res/menu.pic \
      res/root.ico res/root.inf res/root.spl res/score.inf \
      res/shoot.mus res/slow_down.mus res/speed_up.mus \
      res/title.mus res/win.mus

PP = vcpp	
CC = vcc1
AS = vas
LN = vlink
LD = filer
RM = vrm

.SUFFIXES : .c

all : $(NAME).app

# You must add to archive "$(CYBIKO_SDK)"/lib/main.e ,
# your bytecode and application resources
# (*.pic better place first).
# *.spl - splash screen.
# *.help - help file.
# root.inf - information for programm manager.
# score.inf - best scores.
# For more details see filer.exe manual.
Highway_Hitman.app : tmp/bytecode.bin $(RES)
	@echo building app archive...
	@$(LD) a $@ @res/filer.list tmp/bytecode.bin "$(CYBIKO_SDK)"/lib/main.e

tmp/bytecode.bin : $(OBJ) 
	@echo linking ...
	@$(LN) -o $@ src/*.o

.c.o : 
	@echo compiling $<...
	@$(PP) -I"$(CYBIKO_SDK)"/inc $< | $(CC) | $(AS) -O -o $@

src/Bullet.o : src/Bullet.h src/Main.h src/Utils.h \
               src/Screen.h src/Vehicles.h

src/Explosion.o : src/Explosion.h src/Utils.h src/Screen.h \
                  src/Vehicles.h src/Main.h

src/Main.o : src/Main.h src/Utils.h src/Vehicles.h src/Screen.h  

src/Screen.o : src/Screen.h src/Vehicles.h src/Utils.h src/Main.h

src/Utils.o : src/Screen.h src/Utils.h src/Main.h

src/Vehicles.o : src/Vehicles.h src/Bullet.h src/Screen.h \
                 src/Explosion.h src/Utils.h src/Main.h

clean :
	@echo cleaning...
	@$(RM) -f tmp/*.* src/*.o $(NAME).app

new : clean all
