ceda-code-experiments/Makefile

37 lines
676 B
Makefile
Raw Normal View History

2023-03-04 22:09:40 +00:00
.POSIX:
ECHO := @echo
QUIET := @
OUTDIR := build
SERIALPORT := /dev/ttyUSB0
$(OUTDIR)/main.bin: main.asm
$(ECHO) ' ASM'
$(QUIET) mkdir -p $(OUTDIR)
$(QUIET) zcc +z80 -subtype=none -o $(OUTDIR)/main.bin main.asm
2023-06-02 21:38:04 +00:00
.PHONY: prg
prg: $(OUTDIR)/main.bin.prg
$(OUTDIR)/%.bin.prg: $(OUTDIR)/%.bin
$(ECHO) ' PRG'
$(QUIET) echo -n -e '\x00\x10' > "$@"
$(QUIET) cat "$<" >> "$@"
2023-03-04 22:09:40 +00:00
.PHONY: send
send: $(OUTDIR)/main.bin.pkt
$(ECHO) ' SEND'
$(QUIET) stty -F $(SERIALPORT) 9600 -crtscts
$(QUIET) cat "$<" > $(SERIALPORT)
$(OUTDIR)/%.bin.pkt: $(OUTDIR)/%.bin
$(ECHO) ' PKT'
$(QUIET) python3 makepacket.py "$<"
.PHONY: clean
clean:
$(ECHO) ' RM'
$(QUIET) rm -rf $(OUTDIR)