From 46f0c31dc4b0ea3b395b347bef7617ae0227c528 Mon Sep 17 00:00:00 2001 From: Philip Zembrod Date: Sun, 2 Jul 2023 11:23:26 +0200 Subject: [PATCH] Move script file content for run-in-runcpm.sh into command line params --- 8080/CPM/Makefile | 28 ++++++++++++++-------------- 8080/CPM/emulator/run-in-runcpm.sh | 4 ++++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/8080/CPM/Makefile b/8080/CPM/Makefile index 45429fc..fef4c46 100644 --- a/8080/CPM/Makefile +++ b/8080/CPM/Makefile @@ -33,26 +33,26 @@ inctest.log: $(patsubst %, $(cpmfilesdir)/%, volks4th.com) \ $(patsubst src/%, $(cpmfilesdir)/%, \ src/include.fb src/inctest.fth) \ | emu - echo "volks4th" > $(runcpmdir)/input.script - echo "include include.fb" >> $(runcpmdir)/input.script - echo "include inctest.fth" >> $(runcpmdir)/input.script - echo "bye" >> $(runcpmdir)/input.script - echo "exit" >> $(runcpmdir)/input.script - ./emulator/run-in-runcpm.sh volks4th + ./emulator/run-in-runcpm.sh \ + "volks4th" \ + "include include.fb" \ + "include inctest.fth" \ + "bye" \ + "exit" cp $(runcpmdir)/output.log $@ logtest.log: $(patsubst %, $(cpmfilesdir)/%, volks4th.com) \ $(patsubst tests/%, $(cpmfilesdir)/%, \ tests/log2file.fb) \ | emu - echo "volks4th" > $(runcpmdir)/input.script - echo "include log2file.fb" >> $(runcpmdir)/input.script - echo "logopen" >> $(runcpmdir)/input.script - echo ".( hello world) cr" >> $(runcpmdir)/input.script - echo "logclose" >> $(runcpmdir)/input.script - echo "bye" >> $(runcpmdir)/input.script - echo "exit" >> $(runcpmdir)/input.script - ./emulator/run-in-runcpm.sh volks4th + ./emulator/run-in-runcpm.sh \ + "volks4th" \ + "include log2file.fb" \ + "logopen" \ + ".( hello world) cr" \ + "logclose" \ + "bye" \ + "exit" cp $(runcpmdir)/output.log output.log ../../tools/trunc-ctrl-z.py $(runcpmdir)/A/0/LOGFILE.TXT \ $(runcpmdir)/logfile.txt diff --git a/8080/CPM/emulator/run-in-runcpm.sh b/8080/CPM/emulator/run-in-runcpm.sh index 19dabbf..14181e4 100755 --- a/8080/CPM/emulator/run-in-runcpm.sh +++ b/8080/CPM/emulator/run-in-runcpm.sh @@ -12,6 +12,10 @@ toolsdir="${basedir}/../../tools" logfile="${runcpmdir}/output.log" scriptfile="${runcpmdir}/input.script" rm -f "${logfile}" +rm -f "${scriptfile}" +for line in "$@"; do + echo "${line}" >> "${scriptfile}" +done test -d "${runcpm_a0}" || mkdir -p "${runcpm_a0}"