2023-10-11 20:07:04 +00:00
|
|
|
PROJECT := demo
|
|
|
|
|
2023-10-16 20:13:55 +00:00
|
|
|
SERIALPORT = /dev/ttyUSB0
|
|
|
|
|
2023-10-08 19:38:15 +00:00
|
|
|
SRC = \
|
2023-10-22 09:42:03 +00:00
|
|
|
src/video_a.asm \
|
|
|
|
src/video.c \
|
2023-10-16 20:14:25 +00:00
|
|
|
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 \
|
2023-10-22 09:42:03 +00:00
|
|
|
src/performance_test.asm \
|
|
|
|
src/printf.c \
|
|
|
|
src/lfsr.c \
|
|
|
|
src/matrix.c \
|
2023-10-22 20:08:37 +00:00
|
|
|
src/flipflap.c \
|
2023-10-08 19:38:15 +00:00
|
|
|
\
|
|
|
|
|
|
|
|
OBJ = $(patsubst %, %.o, $(basename $(SRC)))
|
|
|
|
|
|
|
|
ECHO := @echo
|
|
|
|
QUIET := @
|
|
|
|
OUTDIR := build
|
|
|
|
|
2024-12-13 22:48:53 +00:00
|
|
|
.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' > $@
|
2023-10-11 20:07:04 +00:00
|
|
|
cat $< >> $@
|
2023-10-08 19:38:15 +00:00
|
|
|
|
2024-12-13 22:48:53 +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)
|
2023-10-11 20:07:04 +00:00
|
|
|
zcc +conf.cfg \
|
2024-12-13 22:48:53 +00:00
|
|
|
-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)
|
|
|
|
|