#dependancies for m100 programs
#$Id: makefile,v 1.33 2017/03/15 08:59:33 goosey Exp goosey $

include m100rules.mk

DEFS= m100.def 8085undoc.def z80mac.def macros.def wp2.def
MKFILES= m100rules.mk makefile
LIBS= a2d.asm a2b.asm ah2i.asm c2b.asm c2h.asm fixpower.asm bin2asc.asm \
	psuran.Asm int2asc.asm bin2asc.asm wp2magic.def
ZMLIBS=a2b.zm  ah2i.zm c2b.zm a2d.zm  bin2asc.zm  c2h.zm  int2asc.zm \
	fixpower.zm
TARBALLS= m100def.tar.gz
ZIPS= m100def.zip dosm100.zip 
LSTAR= lsbin.tar.gz m100ls.tar.gz
LSZIP= lsbin.zip m100ls.zip
LSSRC= ls.Asm vamri.asm
LSBINS= ls.hex ls.co
HEX2CO= HEX2CO.100 HEX2CO.DOC

archives: ${TARBALLS} ${ZIPS} ${LSTAR} ${LSZIP} 

m100def.tar.gz:  ${DEFS} ${MKFILES} ${LIBS} ${ZMLIBS}
	tar cvhf - ${DEFS} ${MKFILES} ${LIBS} ${ZMLIBS} | gzip -9 > m100def.tar.gz
lsbin.tar.gz: ${LSBINS}
	tar cvhf - ${LSBINS} ${HEX2CO} lsdoc.do ls.lst | \
		gzip -9 > lsbin.tar.gz
m100ls.tar.gz:  ${LSSRC} ls.hex 
	tar cvhf - ${LSSRC} ${LSBINS}  ls.lst lsdoc.do ${HEX2CO} | \
		gzip -9 > m100ls.tar.gz

m100def.zip: ${DEFS} ${MKFILES} ${LIBS} ${ZMLIBS}
	zip m100def.zip ${DEFS} ${MKFILES} ${LIBS} ${ZMLIBS}
dosm100.zip: ${DEFS} ${LIBS}
	cd tasm ; make zip

m100ls.zip: ${LSSRC} ${LSBINS}
	zip m100ls.zip ${LSSRC} ${LSBINS} lsdoc.do
lsbin.zip: ${LSBINS}
	zip lsbin.zip ${LSBINS} ${HEX2CO} lsdoc.do

bugly.hex: bugly.Asm m100.def
gposit.hex: gposit.Asm m100.def
hello.hex: hello.zm m100.def
romstar.hex: romstar.Asm m100.def
ta2d.hex: ta2d.Asm m100.def a2d.asm
ta2b.hex: ta2b.Asm m100.def a2b.asm
th2i.hex: th2i.Asm m100.def ah2i.asm
th2c.hex: th2c.Asm m100.def ah2i.asm
tc2b.hex: tc2b.Asm m100.def ah2i.asm c2b.asm
tc2h.hex: tc2h.Asm m100.def ah2i.asm c2h.asm
ti2h.hex: ti2h.Asm m100.def ah2i.asm c2h.asm
txtcal.hex: txtcal.Asm m100.def
ls.hex: ${LSSRC} m100.def c2h.asm fixpower.asm
ls.co: ls.hex
rnstar.co: rnstar.Asm m100.def 8085undoc.def fixpower.asm psuran.Asm
tcalc1.hex: tcalc1.Asm m100.def fixpower.asm
psuran.co: M4OPTS = -DRANSTANDALONE
psuran.co: psuran.Asm 8085undoc.def
lspdd.co : lspdd.Asm m100.def 8085undoc.def fixpower.asm c2h.asm
wp2hello.cmd: wp2hello.zm wp2.def wp2magic.def
.PHONEY: clean
clean:
	rm *.lst *.hex


