ASM=crt0.asm SRC=stn.c OBJ=$(ASM:%.asm=build/%.rel) $(SRC:%.c=build/%.rel) IHX=build/stn.ihx TARGET=stn.hex CFLAGS=-mz80 -I../dev/include -I. --Werror LDFLAGS=-mz80 --no-std-crt0 --code-loc 0x4100 --data-loc 0xC000 -Wl-b_GSINIT=0x4080 all : $(TARGET) build/%.rel : %.asm @echo ' (AS)' $< @sdcpp -P -I. -I../dev/include -DASSEMBLY $< > build/$< @sdasz80 -g -o $@ build/$< build/%.rel : %.c @echo ' (CC)' $< @sdcc $(CFLAGS) -c -o $@ $< $(IHX) : $(OBJ) @echo ' (LD)' $(OBJ) @sdcc $(LDFLAGS) -o $@ $(OBJ) $(TARGET) : $(IHX) @hex2bin.py $< $@ .PHONY : upload upload : .PHONE : flash flash : @zup -a 5 -P -b38400 -p /dev/ttyUSB0 "w:0:4000:$(TARGET)" # zup -a 5 -P -p /dev/ttyUSB0 "w:0:4000:$(TARGET)" .PHONY : clean clean : @rm -rf build/* $(TARGET)