ceda-demo/Makefile

57 lines
994 B
Makefile
Raw Permalink Normal View History

PROJECT := demo
2023-10-16 20:13:55 +00:00
SERIALPORT = /dev/ttyUSB0
2023-10-08 19:38:15 +00:00
SRC = \
src/video_a.asm \
src/video.c \
src/crt.c \
2023-10-15 13:09:36 +00:00
src/cursor.c \
src/delay.asm \
2023-10-08 19:38:15 +00:00
src/main.c \
2023-10-13 07:44:39 +00:00
src/io_a.c \
src/performance_test.asm \
src/printf.c \
src/lfsr.c \
src/matrix.c \
src/flipflap.c \
2023-10-08 19:38:15 +00:00
\
OBJ = $(patsubst %, %.o, $(basename $(SRC)))
ECHO := @echo
QUIET := @
OUTDIR := build
$(OUTDIR)/$(PROJECT).prg: $(OUTDIR)/$(PROJECT)_code_compiler.bin
echo -n -e '\x00\x10' > $@
cat $< >> $@
2023-10-08 19:38:15 +00:00
$(OUTDIR)/$(PROJECT)_code_compiler.bin: $(OBJ) | $(OUTDIR)
zcc +conf.cfg \
-crt0=src/crt.asm \
2023-10-15 13:08:25 +00:00
-m -o $(OUTDIR)/$(PROJECT) $(OBJ)
2023-10-08 19:38:15 +00:00
%.o: %.c
zcc +z80 -c -o $@ $<
%.o: %.asm
zcc +z80 -c -o $@ $<
2023-10-16 20:13:55 +00:00
%.pkt: %.prg
script/makepacket.py $< > $@
2023-10-08 19:38:15 +00:00
$(OUTDIR):
mkdir -p $@
2023-10-16 20:13:55 +00:00
.PHONY: send
send: $(OUTDIR)/$(PROJECT).pkt
stty -F $(SERIALPORT) 9600 crtscts
script/sendpacket.py < $<
2023-10-08 19:38:15 +00:00
.PHONY: clean
clean:
$(RM) $(OBJ)
$(RM) -r $(OUTDIR)