From ca7882fd2de1c551d10dfcfb5bd9919bf1aa191f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Tue, 3 Jul 2018 17:49:22 +0200 Subject: [PATCH] Change OS filename: os.sh -> os.bat --- example-os/.gitignore | 4 ++-- example-os/Makefile | 35 ++++++++++++++++++++++------------- test/bochs.sh | 6 +++--- test/qemu-system-i386.sh | 6 +++--- test/virtualbox.sh | 6 +++--- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/example-os/.gitignore b/example-os/.gitignore index 96a543c..f2ce617 100644 --- a/example-os/.gitignore +++ b/example-os/.gitignore @@ -1,5 +1,5 @@ -/os.sh +/os.bat /os.ndisasm.disasm /os.reasm.asm /os.reasm -/os.reasm.disasm \ No newline at end of file +/os.reasm.disasm diff --git a/example-os/Makefile b/example-os/Makefile index 097a82a..240a11f 100644 --- a/example-os/Makefile +++ b/example-os/Makefile @@ -1,47 +1,56 @@ +os_filename = os.bat + .PHONY: all -all: os.sh os.ndisasm.disasm os.reasm.asm os.reasm +all: $(os_filename) os.ndisasm.disasm os.reasm.asm os.reasm .gitignore ../deploy-screenshots: mkdir $@ -os.sh: os.asm ../deploy-screenshots Makefile +$(os_filename): os.asm ../deploy-screenshots Makefile nasm -o $@ $< chmod a+x $@ -os.ndisasm.disasm: os.sh Makefile +os.ndisasm.disasm: $(os_filename) Makefile ../utils/compact-ndisasm.sh $< $@ os.reasm.asm: os.ndisasm.disasm Makefile sed -r -e 's/^[^ ]+ +[^ ]+ +//' $< > $@ -os.reasm: os.reasm.asm os.sh Makefile +os.reasm: os.reasm.asm $(os_filename) Makefile nasm $< -o $@ - @echo "diff $@ os.sh" - @diff $@ os.sh \ - && echo "Re-assembled file is identical to os.sh" \ + @echo "diff $@ $(os_filename)" + @diff $@ $(os_filename) \ + && echo "Re-assembled file is identical to $(os_filename)" \ || (../utils/compact-ndisasm.sh $@ os.reasm.disasm; \ - echo "Re-assembled file is different from os.sh. Use meld os.ndisasm.disasm os.reasm.disasm to see differences."; \ + echo "Re-assembled file is different from $(os_filename). Use meld os.ndisasm.disasm os.reasm.disasm to see differences."; \ exit 1) .PHONY: clean Makefile clean: - rm -f os.sh os.ndisasm.disasm os.reasm.asm os.reasm + rm -f $(os_filename) os.ndisasm.disasm os.reasm.asm os.reasm + +.gitignore: Makefile + echo /$(os_filename) > $@ + echo /os.ndisasm.disasm >> $@ + echo /os.reasm.asm >> $@ + echo /os.reasm >> $@ + echo /os.reasm.disasm >> $@ .PHONY: test test: test-qemu-system-i386 test-qemu-system-arm test-virtualbox test-bochs Makefile .PHONY: test-qemu-system-i386 -test-qemu-system-i386: os.sh ../deploy-screenshots Makefile +test-qemu-system-i386: $(os_filename) ../deploy-screenshots Makefile (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-i386.sh) .PHONY: test-qemu-system-arm -test-qemu-system-arm: os.sh ../deploy-screenshots Makefile +test-qemu-system-arm: $(os_filename) ../deploy-screenshots Makefile (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-arm.sh) .PHONY: test-virtualbox -test-virtualbox: os.sh ../deploy-screenshots Makefile +test-virtualbox: $(os_filename) ../deploy-screenshots Makefile (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/virtualbox.sh) .PHONY: test-bochs -test-bochs: os.sh ../deploy-screenshots Makefile +test-bochs: $(os_filename) ../deploy-screenshots Makefile (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/bochs.sh) diff --git a/test/bochs.sh b/test/bochs.sh index 8b3c4fb..2cea0fe 100755 --- a/test/bochs.sh +++ b/test/bochs.sh @@ -1,11 +1,11 @@ #!/bin/sh set -e -os_file="example-os/os.sh" +os_filename="example-os/os.bat" bochsrc="$(mktemp)" cat > "$bochsrc" <