ceda-demo/Makefile

68 lines
1.3 KiB
Makefile
Raw 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
.PHONY: all
all: $(OUTDIR)/$(PROJECT).prg $(OUTDIR)/$(PROJECT).com
$(OUTDIR)/$(PROJECT).com: $(OUTDIR)/$(PROJECT)-cpm_code_compiler.bin
cp $< $@
$(OUTDIR)/$(PROJECT).prg: $(OUTDIR)/$(PROJECT)-bios_code_compiler.bin
echo -n -e '\x00\x01' > $@
cat $< >> $@
2023-10-08 19:38:15 +00:00
$(OUTDIR)/$(PROJECT)-cpm_code_compiler.bin: $(OBJ) | $(OUTDIR)
zcc +conf.cfg \
-crt0=crt/cpm.asm \
-m -o $(OUTDIR)/$(PROJECT)-cpm $(OBJ)
$(OUTDIR)/$(PROJECT)-bios_code_compiler.bin: $(OBJ) | $(OUTDIR)
zcc +conf.cfg \
-crt0=crt/bios.asm \
-m -o $(OUTDIR)/$(PROJECT)-bios $(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)