From ad2623d8c4bc51638343ae9a628f8647ff558155 Mon Sep 17 00:00:00 2001 From: Thomas Albers Date: Mon, 14 Aug 2023 10:47:54 +0200 Subject: Initial commit --- stn/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 stn/Makefile (limited to 'stn/Makefile') diff --git a/stn/Makefile b/stn/Makefile new file mode 100644 index 0000000..861b459 --- /dev/null +++ b/stn/Makefile @@ -0,0 +1,40 @@ +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) -- cgit v1.2.3