PROGS=wavegen.bin shifter.bin ffthc11.bin div48.bin bufk42.bin buf34.bin \
 bufd3_4.bin example3.bin example10.bin warnexpl8.bin b6test.bin \
 failfuzz.bin

#	set LISTASM to - l to see listings (goes to stdout)
LISTASM=


###############################################
# ~BEGIN STD MACROS~ - DONT'T REMOVE THIS LINE!
#
# User modifiable section for proper commands and arguments on system
CC	=	cc
CFLAGS	=	-O -c
CLIBS	=
CP	=	cp
MV	=	mv
DONE	=	echo 
LN	=	cc
LNFLAGS	=
LNLIB1	=
LNLIB2	=	-lc
LB	=	ar
LBFLAGS	=	q
POSTCC	=
POSTLN	=	$(CP) $@ ../bin
PR	=	lpr
RM	=	rm
RMFLAGS	=
TOUCH	=	touch
CI	=	ci
CO	=	co
LOCBIN	=	../bin
SYSBIN	=	/usr/local/bin
#
# ~END STD MACROS~   - DONT'T REMOVE THIS LINE!
###############################################

all: $(PROGS)
	$(DONE)

# programs
#
#	srec2bin <rom_size_in_kbytes> <rom_start_addr> <infile> <outfile>
#
wavegen.bin : wavegen.s19
	$(LOCBIN)/srec2bin 2 0 $< $@

shifter.bin : shifter.s19
	$(LOCBIN)/srec2bin 8 f800h $< $@

ffthc11.bin : ffthc11.s19
	$(LOCBIN)/srec2bin 8 c000h $< $@

div48.bin : div48.s19
	$(LOCBIN)/srec2bin 8 c000h $< $@

buf34.bin : buf34.s19
	$(LOCBIN)/srec2bin 8 e000h $< $@

bufd3_4.bin : bufd3_4.s19
	$(LOCBIN)/srec2bin 8 a000h $< $@

bufk42.bin : bufk42.s19
	$(LOCBIN)/srec2bin 16 c000h $< $@

b6test.bin : b6test.s19
	$(LOCBIN)/srec2bin 16 c000h $< $@

failfuzz.bin : failfuzz.s19
	$(LOCBIN)/srec2bin 16 c000h $< $@

example3.bin : example3.s19
	$(LOCBIN)/srec2bin 8 a000h $< $@

example10.bin : example10.s19
	$(LOCBIN)/srec2bin 8 c000h $< $@

warnexpl8.bin : warnexpl8.s19
	$(LOCBIN)/srec2bin 8 c000h $< $@

# objects

wavegen.s19: wavegen.a01
	$(LOCBIN)/as1 $< $(LISTASM)

shifter.s19: shifter.a01
	$(LOCBIN)/as1 $< $(LISTASM)

b6test.s19: b6test.a05
	$(LOCBIN)/ashc5 $< $(LISTASM)

ffthc11.s19: ffthc11.a11
	$(LOCBIN)/as11 $< $(LISTASM)

div48.s19: div48.a11
	$(LOCBIN)/as11 $< $(LISTASM)

bufd3_4.s19: bufd3_4.a11
	$(LOCBIN)/as11 $< $(LISTASM)

buf34.s19: buf34.a11
	$(LOCBIN)/as11 $< $(LISTASM)

bufk42.s19: bufk42.a11
	$(LOCBIN)/as11 $< $(LISTASM)

failfuzz.s19: failfuzz.a11
	@echo "Don't panic. The following failures are expected"
	@sleep 2
	$(LOCBIN)/as11 $< $(LISTASM)

example3.s19: example3.a11
	$(LOCBIN)/as11 $< $(LISTASM)

example10.s19: example10.a11
	$(LOCBIN)/as11 $< $(LISTASM)

warnexpl8.s19: warnexpl8.a11
	@echo "Don't panic. The following warnings are expected"
	@sleep 2
	$(LOCBIN)/as11 $< $(LISTASM)


# compare validated tests for current output
comptests:
	../agents/comptests.bsh

# save validated tests for future comparisons
savetests:
	../agents/savetests.bsh

#
# ~STD TARGETS~
#
#
install:
	echo no 'install' support
#
sysinstall:
	echo no 'sysinstall' support
#
archive:
	echo no 'archive' support	
#
touch:
	echo no 'touch' support
#
cleanprogs:
	-$(RM) $(RMFLAGS) $(PROGS)
#
cleanobjs:
	-$(RM) $(RMFLAGS) *.s19
#
cleanbase:
	-$(RM) $(RMFLAGS) *.pass *.fail
#
realclean: cleanobjs cleanprogs
	echo 'realclean' done
#
clean: cleanobjs cleanprogs
	echo 'clean' done
#
checkin:
	echo no 'checkin' support
#
checkout:
	echo no 'checkout' support
#
print:
	echo no 'print' support
#
# ~END STD TARGETS~
#
