ceda-demo/Makefile
giomba b461731f45 Add CRT to run under CP/M.
The Makefile now builds the demo with $100 as its entry point, then it
is linked both against the bios-only crt, and the CP/M-aware crt.
The bios-only version can be run without the operating system, but needs
to be loaded via serial directly using a BIOS rom with a custom loading
routine.
The CP/M-aware version, instead, can be run as a normal executable from
a diskette, but keep in mind that this is a demo, so it is not designed
in such a way that it is safe to go back to CP/M at the end of the demo.
It may be possible, but I won't make any effort to guarantee it.
2024-12-14 18:58:42 +01:00

68 lines
1.3 KiB
Makefile

PROJECT := demo
SERIALPORT = /dev/ttyUSB0
SRC = \
src/video_a.asm \
src/video.c \
src/crt.c \
src/cursor.c \
src/delay.asm \
src/main.c \
src/io_a.c \
src/performance_test.asm \
src/printf.c \
src/lfsr.c \
src/matrix.c \
src/flipflap.c \
\
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 $< >> $@
$(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)
%.o: %.c
zcc +z80 -c -o $@ $<
%.o: %.asm
zcc +z80 -c -o $@ $<
%.pkt: %.prg
script/makepacket.py $< > $@
$(OUTDIR):
mkdir -p $@
.PHONY: send
send: $(OUTDIR)/$(PROJECT).pkt
stty -F $(SERIALPORT) 9600 crtscts
script/sendpacket.py < $<
.PHONY: clean
clean:
$(RM) $(OBJ)
$(RM) -r $(OUTDIR)