## vxWorks makefile

## files and directories

UP1		= ../
UP2		= ../../
H1		= $(VW)h/
H2		= $(VW)h/net/
H3		= $(VW)h/rpc/
BIN		= $(VW)bin/
LIB		= $(VW)lib/
MISC		= $(VW)misc/
SRC		= $(VW)src/
SRCALL		= $(VW)src/all/
SRCNET		= $(VW)src/net/
SRCRPC		= $(VW)src/rpc/
SRCFORT		= $(VW)src/fortran/
SRCBIN		= $(VW)src/bin/
VRTX		= $(VW)src/vrtx/
PSOS		= $(VW)src/psos/
WIND		= $(VW)src/wind/
PUB_RPC		= $(VW)pub/rpc3.9/
PUB_RPCGEN	= $(PUB_RPC)rpcgen/
DEMO_1		= $(VW)demo/1/
DEMO_DG		= $(VW)demo/dg/
DEMO_SPRITES	= $(VW)demo/sprites/
ALL		= $(VW)config/all/
DY4		= $(VW)config/dy4/
HKV2F		= $(VW)config/hkv2f/
HKVF		= $(VW)config/hkvf/
FRC21		= $(VW)config/frc21/
FRC30		= $(VW)config/frc30/
FRC31		= $(VW)config/frc31/
FRC37		= $(VW)config/frc37/
MS100		= $(VW)config/ms100/
MZ7122		= $(VW)config/mz7122/
MZ8115		= $(VW)config/mz8115/
MV131		= $(VW)config/mv131/
MV133		= $(VW)config/mv133/
MV135		= $(VW)config/mv135/
MV147		= $(VW)config/mv147/
IS20		= $(VW)config/is20/
IV24		= $(VW)config/iv24/
SUN3E		= $(VW)config/sun3e/
UBAR		= $(VW)config/ubar/


## defines

MKMK = csh -f /usr/tools/bin/mkmk

## files and directories

VW =

MH = misc/makeHost
MT = misc/makeTarget
ML = misc/makeLibrary

MAKEFILES = $(SRCALL)Makefile $(SRCNET)Makefile $(SRCRPC)Makefile \
	    $(SRCFORT)Makefile $(SRCBIN)Makefile $(VRTX)Makefile \
	    $(PSOS)Makefile $(WIND)Makefile $(ALL)Makefile \
	    $(DY4)Makefile $(HKV2F)Makefile $(IS20)Makefile \
	    $(MS100)Makefile $(MZ7122)Makefile $(MZ8115)Makefile \
	    $(MV131)Makefile $(MV133)Makefile $(MV147)Makefile $(FRC21)Makefile\
	    $(FRC30)Makefile $(FRC31)Makefile $(FRC37)Makefile \
	    $(IV24)Makefile $(SUN3E)Makefile $(MV135)Makefile $(UBAR)Makefile \
	    $(DEMO_1)Makefile $(DEMO_DG)Makefile

default : mf vw aux
release : mf vw fortran bootrom aux
sun	: default sprites

sprites : $(DEMO_SPRITES)Makefile
	(cd $(DEMO_SPRITES);	make)

vw :
	(cd $(SRCALL);		make)
	(cd $(SRCBIN);		make)
	(cd $(SRCNET);		make)
	(cd $(SRCRPC);		make)
	(cd $(VRTX);		make)
	(cd $(PSOS);		make)
	(cd $(WIND);		make)
	(cd $(ALL);		make)
	(cd $(DY4);		make master)
	(cd $(HKV2F);		make master)
#	(cd $(HKVF);		make master)
	(cd $(FRC21);		make master)
	(cd $(FRC30);		make master)
	(cd $(FRC31);		make master)
	(cd $(FRC37);		make master)
	(cd $(MS100);		make master)
	(cd $(MZ7122);		make master)
	(cd $(MZ8115);		make master)
	(cd $(MV131);		make master)
	(cd $(MV133);		make master)
	(cd $(MV135);		make master)
	(cd $(MV147);		make master)
	(cd $(IS20);		make master)
	(cd $(IV24);		make master)
	(cd $(SUN3E);		make master)
	(cd $(UBAR);		make master)
	(cd $(PUB_RPCGEN);	make install);
	(cd $(DEMO_1);		make)
	(cd $(DEMO_DG);		make)

bootrom :
	(cd $(DY4);		make bootrom.hex)
	(cd $(HKV2F);		make bootrom.hex)
#	(cd $(HKVF);		make bootrom.hex)
	(cd $(FRC21);		make bootrom.hex)
	(cd $(FRC30);		make bootrom.hex)
	(cd $(FRC31);		make bootrom.hex)
	(cd $(FRC37);		make bootrom.hex)
	(cd $(MS100);		make bootrom.hex)
	(cd $(MZ7122);		make bootrom.hex)
	(cd $(MZ8115);		make bootrom.hex)
	(cd $(MV131);		make bootrom.hex)
	(cd $(MV133);		make bootrom.hex)
	(cd $(MV135);		make bootrom.hex)
	(cd $(MV147);		make bootrom.hex)
##	(cd $(IS20);		make bootrom.hex)
	(cd $(IV24);		make bootrom.hex)
	(cd $(SUN3E);		make bootrom.hex)
	(cd $(UBAR);		make bootrom.hex)

fortran : $(SRCFORT)Makefile
	(cd $(SRCFORT); make fort default aux)

aux :
	(cd $(SRCALL);	make aux)
	(cd $(SRCNET);	make aux)
	(cd $(SRCRPC);	make aux)
	(cd $(SRCBIN);  make aux)
	(cd $(VRTX);	make aux)
	(cd $(PSOS);	make aux)
	(cd $(WIND);	make aux)
	(cd $(ALL);	make aux)
	(cd $(DY4);	make aux)
	(cd $(HKV2F);	make aux)
#	(cd $(HKVF);	make aux)
	(cd $(FRC21);	make aux)
	(cd $(FRC30);	make aux)
	(cd $(FRC31);	make aux)
	(cd $(FRC37);	make aux)
	(cd $(MS100);	make aux)
	(cd $(MZ7122);	make aux)
	(cd $(MZ8115);	make aux)
	(cd $(MV131);	make aux)
	(cd $(MV133);	make aux)
	(cd $(MV135);   make aux)
	(cd $(MV147);   make aux)
	(cd $(IS20);    make aux)
	(cd $(IV24);    make aux)
	(cd $(SUN3E);   make aux)
	(cd $(UBAR);    make aux)

################# makefiles ###################

mf : $(MAKEFILES)

$(SRCALL)Makefile : $(SRCALL)MakeSkel $(SRCALL)*.c $(SRCALL)*.s $(H1)*.h \
		    $(H2)*.h $(MH) $(ML)
	@ rm -f $@
	(cd $(SRCALL); $(MKMK) >Makefile)
$(SRCNET)Makefile : $(SRCNET)MakeSkel $(SRCNET)*.c $(SRCNET)*.s $(H1)*.h \
		    $(H2)*.h $(MH) $(ML)
	@ rm -f $@
	(cd $(SRCNET); $(MKMK) >Makefile)
$(SRCRPC)Makefile : $(SRCRPC)MakeSkel $(SRCRPC)*.c $(H1)*.h \
		    $(H2)*.h $(H3)*.h $(MH) $(ML)
	@ rm -f $@
	(cd $(SRCRPC); $(MKMK) >Makefile)
$(SRCFORT)Makefile : $(SRCFORT)MakeSkel $(MH) $(ML)
	@ rm -f $@
	(cd $(SRCFORT); $(MKMK) >Makefile)
$(SRCBIN)Makefile : $(SRCBIN)MakeSkel $(SRCBIN)*.c $(H1)*.h $(MH)
	@ rm -f $@
	(cd $(SRCBIN); $(MKMK) >Makefile)
$(VRTX)Makefile : $(VRTX)MakeSkel $(VRTX)*.c $(VRTX)*.s $(H1)*.h $(MH)
	@ rm -f $@
	(cd $(VRTX); $(MKMK) >Makefile)
$(PSOS)Makefile : $(PSOS)MakeSkel $(PSOS)*.c $(PSOS)*.s $(H1)*.h $(MH)
	@ rm -f $@
	(cd $(PSOS); $(MKMK) >Makefile)
$(WIND)Makefile : $(WIND)MakeSkel $(WIND)*.c $(WIND)*.s $(H1)*.h $(MH)
	@ rm -f $@
	(cd $(WIND); $(MKMK) >Makefile)
$(ALL)Makefile : $(ALL)MakeSkel $(ALL)*.c $(H1)*.h $(MH) $(ML)
	@ rm -f $@
	(cd $(ALL); $(MKMK) >Makefile)
$(DY4)Makefile : $(DY4)MakeSkel $(DY4)*.c $(DY4)*.s $(DY4)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(DY4); $(MKMK) >Makefile)
$(HKV2F)Makefile : $(HKV2F)MakeSkel $(HKV2F)*.c $(HKV2F)*.s $(HKV2F)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(HKV2F); $(MKMK) >Makefile)
$(HKVF)Makefile : $(HKVF)MakeSkel $(HKVF)*.c $(HKVF)*.s $(HKVF)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(HKVF); $(MKMK) >Makefile)
$(FRC21)Makefile : $(FRC21)MakeSkel $(FRC21)*.c $(FRC21)*.s $(FRC21)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(FRC21); $(MKMK) >Makefile)
$(FRC30)Makefile : $(FRC30)MakeSkel $(FRC30)*.c $(FRC30)*.s $(FRC30)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(FRC30); $(MKMK) >Makefile)
$(FRC31)Makefile : $(FRC31)MakeSkel $(FRC31)*.c $(FRC31)*.s $(FRC31)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(FRC31); $(MKMK) >Makefile)
$(FRC37)Makefile : $(FRC37)MakeSkel $(FRC37)*.c $(FRC37)*.s $(FRC37)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(FRC37); $(MKMK) >Makefile)
$(MS100)Makefile : $(MS100)MakeSkel $(MS100)*.c $(MS100)*.s $(MS100)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(MS100); $(MKMK) >Makefile)
$(MZ7122)Makefile : $(MZ7122)MakeSkel $(MZ7122)*.c $(MZ7122)*.s $(MZ7122)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(MZ7122); $(MKMK) >Makefile)
$(MZ8115)Makefile : $(MZ8115)MakeSkel $(MZ8115)*.c $(MZ8115)*.s $(MZ8115)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(MZ8115); $(MKMK) >Makefile)
$(MV131)Makefile : $(MV131)MakeSkel $(MV131)*.c $(MV131)*.s $(MV131)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(MV131); $(MKMK) >Makefile)
$(MV133)Makefile : $(MV133)MakeSkel $(MV133)*.c $(MV133)*.s $(MV133)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(MV133); $(MKMK) >Makefile)
$(MV135)Makefile : $(MV135)MakeSkel $(MV135)*.c $(MV135)*.s $(MV135)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(MV135); $(MKMK) >Makefile)
$(MV147)Makefile : $(MV147)MakeSkel $(MV147)*.c $(MV147)*.s $(MV147)*.h \
		   $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(MV147); $(MKMK) >Makefile)
$(IS20)Makefile : $(IS20)MakeSkel $(IS20)*.c $(IS20)*.s $(IS20)*.h $(H1)*.h \
		  $(MH) $(MT)
	@ rm -f $@
	(cd $(IS20); $(MKMK) >Makefile)
$(IV24)Makefile : $(IV24)MakeSkel $(IV24)*.c $(IV24)*.s $(IV24)*.h $(H1)*.h \
		  $(MH) $(MT)
	@ rm -f $@
	(cd $(IV24); $(MKMK) >Makefile)
$(SUN3E)Makefile : $(SUN3E)MakeSkel $(SUN3E)*.c $(SUN3E)*.s $(SUN3E)*.h  \
		$(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(SUN3E); $(MKMK) >Makefile)
$(UBAR)Makefile : $(UBAR)MakeSkel $(UBAR)*.c $(UBAR)*.s $(UBAR)*.h $(H1)*.h \
		  $(MH) $(MT)
	@ rm -f $@
	(cd $(UBAR); $(MKMK) >Makefile)
$(DEMO_1)Makefile : $(DEMO_1)MakeSkel $(DEMO_1)*.c $(DEMO_1)*.h $(H1)*.h \
		    $(MH) $(MT)
	@ rm -f $@
	(cd $(DEMO_1); $(MKMK) >Makefile)
$(DEMO_DG)Makefile : $(DEMO_DG)MakeSkel $(DEMO_DG)*.c $(H1)*.h $(MH) $(MT)
	@ rm -f $@
	(cd $(DEMO_DG); $(MKMK) >Makefile)
$(DEMO_SPRITES)Makefile : $(DEMO_SPRITES)MakeSkel $(DEMO_SPRITES)*.c \
			  $(DEMO_SPRITES)*.x $(DEMO_SPRITES)*.h $(H1)*.h \
			  $(MH) $(MT)
	@ rm -f $@
	(cd $(DEMO_SPRITES); $(MKMK) >Makefile)

###############

dy4 : 68020 $(DY4)Makefile
	(cd $(DY4); make)

hkv2f : 68020 $(HKV2F)Makefile
	(cd $(HKV2F); make)

hkvf : 68020 $(HKVF)Makefile
	(cd $(HKVF); make)

frc21 : 68020 $(FRC21)Makefile
	(cd $(FRC21); make)

frc30 : 68020 $(FRC30)Makefile
	(cd $(FRC30); make)

frc31 : 68020 $(FRC31)Makefile
	(cd $(FRC31); make)

frc37 : 68020 $(FRC37)Makefile
	(cd $(FRC37); make)

ms100 : 68020 $(MS100)Makefile
	(cd $(MS100); make)

mz7122 : 68020 $(MZ7122)Makefile
	(cd $(MZ7122); make)

mz8115 : 68010 $(MZ8115)Makefile
	(cd $(MZ8115); make)

mv131 : 68020 $(MV131)Makefile
	(cd $(MV131); make)

mv133 : 68020 $(MV133)Makefile
	(cd $(MV133); make)

mv135 : 68020 $(MV135)Makefile
	(cd $(MV135); make)

mv147 : 68020 $(MV147)Makefile
	(cd $(MV147); make)

is20 : 68020 $(IS20)Makefile
	(cd $(IS20); make)

iv24 : 68010 $(IV24)Makefile
	(cd $(IV24); make)

sun3e : 68020 $(SUN3E)Makefile
	(cd $(SUN3E); make)

ubar : 68000 $(UBAR)Makefile
	(cd $(UBAR); make)

68000 :
	(cd $(SRCALL);	make 68000)
	(cd $(SRCNET);	make 68000)
	(cd $(SRCRPC);	make 68000)
	(cd $(VRTX);	make 68000)
	(cd $(PSOS);	make 68000)
	(cd $(WIND);	make 68000)
	(cd $(ALL);	make 68000)

68010 :
	(cd $(SRCALL);	make 68010)
	(cd $(SRCNET);	make 68010)
	(cd $(SRCRPC);	make 68010)
	(cd $(VRTX);	make 68010)
	(cd $(PSOS);	make 68010)
	(cd $(WIND);	make 68010)
	(cd $(ALL);	make 68010)

68020 :
	(cd $(SRCALL);	make 68020)
	(cd $(SRCNET);	make 68020)
	(cd $(SRCRPC);	make 68020)
	(cd $(VRTX);	make 68020)
	(cd $(PSOS);	make 68020)
	(cd $(WIND);	make 68020)
	(cd $(ALL);	make 68020)
