MSXBASE = ../msx
CFLAGS = -mz80 -I$(MSXBASE)
LDFLAGS = --code-loc 0x106 --data-loc 0 --no-std-crt0\
	$(MSXBASE)/crt0msx_msxdos.o $(MSXBASE)/ioport.o $(MSXBASE)/interrupt.o
OBJ = atsaas.o silhouette.o ltplay3.o \
	spitex4.o spitex6.o spitex.o spitex5.o \
	logo-bandwagon.o logo-greets.o logo-rno.o logo-zenon.o \
	logo-byterapers.o logo-hedelmae.o logo-wamma.o msxlib.o

atsaas.com: $(OBJ)
	sdcc $(CFLAGS) $(OBJ) $(LDFLAGS)
	hex2bin -e com atsaas.ihx

%.o: %.c
	sdcc $(CFLAGS) -c $<

%.o: %.s
	as-z80 -o $@ $<

atsaas.dsk: atsaas.com
	-rm $@
	wrdsk $@ $(MSXBASE)/msxdos.sys $(MSXBASE)/command.com \
	         autoexec.bat $< atsaas.sc2 endpic.sc2

run: atsaas.dsk
	openmsx -machine Philips_NMS_8250 -diska $<

clean:
	-rm *.lnk *.lst *.asm *.map *.o *.ihx atsaas.com *~ *.sym *.dsk
