ASM=crt0.asm SRC=crc16.c zbootloader.c OBJ=$(ASM:%.asm=build/%.rel) $(SRC:%.c=build/%.rel) IHX=build/bootloader.ihx TARGET=bootloader.hex CFLAGS=-mz80 -I. --Werror LDFLAGS=-mz80 --no-std-crt0 --code-loc 0x100 --data-loc 0x8000 -Wl-b_GSINIT=0x80 ROM_CHIP=SST39SF040 all : $(TARGET) build/%.rel : %.asm @echo ' (AS)' $< @sdcpp -P -I. -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 : z80up $(TARGET) -p /dev/ttyUSB0 .PHONE : flash flash : minipro -y -sp $(ROM_CHIP) -w $(TARGET) .PHONY : clean clean : @rm -rf build/* $(TARGET)