VolksForth/8080/CPM/Makefile
Philip Zembrod 4724cfe581 Generate test-min.golden from prelim.golden and core.golden as
copied and adapted from the msdos tests. Also move include log2file.fb
into test-min.fth
2023-09-02 22:19:18 +02:00

144 lines
4.0 KiB
Makefile

srcfbfiles = $(wildcard src/*.fb)
srcfthfiles = $(patsubst src/%.fb, src/%.fth, $(srcfbfiles))
testsfbfiles = $(wildcard tests/*.fb)
testsfthfiles = $(patsubst tests/%.fb, tests/%.fth, $(testsfbfiles))
fthfiles = $(srcfthfiles) $(testsfthfiles)
whitch_runcpm = $(shell which RunCPM)
runcpmdir = runcpm
cpmfilesdir = cpmfiles
fth: $(fthfiles)
clean:
rm -f *.log *.golden *.result
rm -rf $(runcpmdir)
rm -f msdos
test: logtest.result inctest.result test-std.result test-min.result
run-editor: | msdos
FORTHPATH="f:\\src;f:\\tests;f:\\msdos" \
../../8086/msdos/emulator/run-in-dosbox.sh f:\\msdos\\volks4th.com
msdos:
ln -s ../../8086/msdos msdos
src/%.fth: src/%.fb ../../tools/fb2fth.py
../../tools/fb2fth.py $< $@
tests/%.fth: tests/%.fb ../../tools/fb2fth.py
../../tools/fb2fth.py $< $@
run-volks4th: \
$(patsubst %, $(cpmfilesdir)/%, volks4th.com) \
| emu
./emulator/run-in-runcpm.sh \
"volks4th"
logtest.log: \
$(patsubst %, $(cpmfilesdir)/%, volks4th.com) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/log2file.fb) \
| emu
./emulator/run-in-runcpm.sh \
"volks4th" \
"include log2file.fb" \
"logopen" \
".( hello world) cr" \
".( 0123456789abcdef0123456789abcdef) cr" \
".( 1123456789abcdef0123456789abcdef) cr" \
".( 2123456789abcdef0123456789abcdef) cr" \
".( 3123456789abcdef0123456789abcdef) cr" \
"logclose" \
"bye" \
"exit"
dos2unix -n $(runcpmdir)/logfile.txt $@
inctest.log: \
$(patsubst %, $(cpmfilesdir)/%, volks4th.com) \
$(patsubst src/%, $(cpmfilesdir)/%, src/include.fb) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/log2file.fb) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/inctest.fth) \
| emu
./emulator/run-in-runcpm.sh \
"volks4th" \
"include include.fb" \
"include log2file.fb" \
"logopen" \
"include inctest.fth" \
"logclose" \
"bye" \
"exit"
dos2unix -n $(runcpmdir)/logfile.txt $@
test-std.log: \
$(patsubst %, $(cpmfilesdir)/%, volks4th.com) \
$(patsubst src/%, $(cpmfilesdir)/%, src/include.fb) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/log2file.fb) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/ans-shim.fth) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/prelim.fth) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/tester.fth) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/core.fr) \
| emu
./emulator/run-in-runcpm.sh \
"volks4th" \
"include include.fb" \
"include log2file.fb" \
"logopen" \
"include ans-shim.fth" \
": \\vf [compile] \\ ; immediate" \
"include prelim.fth" \
"include tester.fth" \
"include core.fr" \
"logclose" \
"bye" \
"exit"
dos2unix -n $(runcpmdir)/logfile.txt $@
test-min.log: \
$(patsubst %, $(cpmfilesdir)/%, volks4th.com) \
$(patsubst src/%, $(cpmfilesdir)/%, src/include.fb) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/log2file.fb) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/ans-shim.fth) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/prelim.fth) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/tester.fth) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/core.fr) \
$(patsubst tests/%, $(cpmfilesdir)/%, tests/test-min.fth) \
| emu
./emulator/run-in-runcpm.sh \
"volks4th" \
"include include.fb" \
"include test-min.fth" \
"bye" \
"exit"
dos2unix -n $(runcpmdir)/logfile.txt $@
emu: $(runcpmdir)/RunCPM
test-min.golden: $(patsubst %, tests/golden/%.golden, prelim core)
cat $^ > $@
%.golden: tests/golden/%.golden
cp -p $< $@
%.result: %.log %.golden tests/evaluate-test.sh
rm -f $@
tests/evaluate-test.sh $(basename $@)
$(runcpmdir)/RunCPM: $(whitch_runcpm)
test -d $(runcpmdir) || mkdir -p $(runcpmdir)
cp $< $@
$(cpmfilesdir)/%: src/%
test -d $(cpmfilesdir) || mkdir -p $(cpmfilesdir)
cp $< $@
$(cpmfilesdir)/%: tests/%
test -d $(cpmfilesdir) || mkdir -p $(cpmfilesdir)
cp $< $@
$(cpmfilesdir)/%: %
test -d $(cpmfilesdir) || mkdir -p $(cpmfilesdir)
cp $< $@