# makefile
#
# This is part of the flight simulator 'fly8'.
# Author: Eyal Lebedinsky (eyal@ise.canberra.edu.au).
#

#
# machine specific makefile for msdos, Borland c4
#

CDIR=	..\..
HH=	$(CDIR)\h
RSP=	$(TMP)\libfly8.rsp

CFLAGS=	-I$(HH) -I.. $(XFLAGS) 

#	Non portable programs
#
COBJS=	mouse.obj stick.obj dosstick.obj console.obj timer.obj pcserial.obj \
	packet.obj slip.obj pcdos.obj drivers.obj misc.obj \
	grfast.obj s3.obj grbgi.obj grstat.obj plspeak.obj plsound.obj \
	grvesa.obj vesa.obj vgr.obj pcudp.obj

AOBJS=	msubs.obj

OBJS=	$(COBJS) $(AOBJS)

HFILES=	..\fly.h config.h

.PRECIOUS: msubs.obj


all:	fly8sys.lib exe

exe:	gettimer.exe settimer.exe joytest.exe

fly8sys.lib:	$(OBJS)
	if exist fly8sys.lib del fly8sys.lib
	echo fly8sys &>$(RSP)
	echo +mouse +stick +console +timer +pcserial +packet & >>$(RSP)
	echo +msubs +dosstick +grstat & >>$(RSP)
	echo +slip +pcdos +drivers +grfast +s3 +grbgi +misc & >>$(RSP)
	echo +plspeak +plsound +grvesa +vesa +vgr +pcudp >>$(RSP)
	tlib @$(RSP)
	del $(RSP)

$(COBJS):	$(HFILES)

plsound.obj:	$(HFILES) ..\notes.h

plspeak.obj:	$(HFILES) ..\notes.h pc8254.h

grfast.obj:	$(HFILES) ..\colors.h $(HH)\gr.h

grvesa.obj:	$(HFILES) ..\colors.h vgr.h vesa.h

vesa.obj:	$(HFILES) vgr.h vesa.h

vgr.obj:	$(HFILES) vgr.h

grbgi.obj:	$(HFILES) ..\colors.h

pcserial.obj:	$(HH)\com.h

timer.obj:	pc8254.h

stick.obj:	stick.h

dosstick.obj:	stick.h

packet.obj:	$(HH)\pktdrvr.h

slip.obj:	$(HH)\pktdrvr.h

pcudp.obj:	$(HH)\pktdrvr.h

msubs.obj:	msubs.b3
	copy msubs.b3 msubs.obj

#
# Utility programs
#

gettimer.exe:	gettimer.c
	$(CC) -ml -G gettimer.c
	lzexe gettimer.exe
	del gettimer.old

settimer.exe:	settimer.c
	$(CC) -ml -G settimer.c
	lzexe settimer.exe
	del settimer.old

joytest.exe:	joytest.c
	$(CC) -ml -G joytest.c
	lzexe joytest.exe
	del joytest.old

clean:
	-del *.exe
	-del *.obj
	-del *.lib
	-del *.rsp
