# --------------------------------- makefile -------------------------------

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

#
# machine specific makefile for msdos, c7.00
#

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

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

#	Non portable programs
#
COBJS=	mouse.obj stick.obj console.obj timer.obj pcserial.obj packet.obj \
	slip.obj speaker.obj pcdos.obj drivers.obj grqc.obj grt4k.obj misc.obj

AOBJS=	msubs.obj

OBJS=	$(COBJS) $(AOBJS)

HFILES=	../fly.h config.h

.PRECIOUS: msubs.obj


all:	fly8sys.lib gettimer.exe settimer.exe joytest.exe joytime.exe

fly8sys.lib:	$(OBJS)
	if exist fly8sys.lib del fly8sys.lib
	echo fly8sys >$(RSP)
	echo y >>$(RSP)
	echo +mouse +stick +console +timer +pcserial +packet & >>$(RSP)
	echo +msubs & >>$(RSP)
	echo +slip +speaker +pcdos +drivers +grqc +grt4k +misc; >>$(RSP)
	lib @$(RSP)
	del $(RSP)

$(COBJS):	$(HFILES)

speaker.obj:	$(HFILES) ../notes.h

grqc.obj:	$(HFILES) ../colors.h

grt4k.obj:	$(HFILES) ../colors.h $(HH)/gr.h

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

timer.obj:	$(HH)/tick.h

packet.obj:	$(HH)/pktdrvr.h
	$(CC) -c $(CFLAGS) -Od -Gs2 packet.c

slip.obj:	$(HH)/pktdrvr.h
	$(CC) -c $(CFLAGS) -Od -Gs2 slip.c

msubs.obj:	msubsobj
	copy msubsobj msubs.obj

#
# Utility programs
#

gettimer.exe:	gettimer.c
	$(CC) -AS -Ox -W4 gettimer.c
	lzexe gettimer.exe
	del gettimer.old

settimer.exe:	settimer.c
	$(CC) -AS -Ox -W4 settimer.c
	lzexe settimer.exe
	del settimer.old

joytest.exe:	joytest.c
	$(CC) -AS -Ox -W4 joytest.c
	lzexe joytest.exe
	del joytest.old

joytime.exe:	joytest.c
	$(CC) -Fejoytime -DUSE_TIMER -AS -Ox -W4 joytest.c
	lzexe joytime.exe
	del joytime.old

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