os-test-framework/example-os/Makefile

46 lines
1.4 KiB
Makefile
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

os_filename = os.bat
tests = test/qemu-system-i386 test/qemu-system-arm test/virtualbox test/bochs test/gui-sh test/dosbox
.PHONY: all
all: $(os_filename) os.ndisasm.disasm os.reasm.asm os.reasm .gitignore test Makefile
../deploy-screenshots: Makefile
mkdir -p $@
$(os_filename): os.asm ../deploy-screenshots Makefile
nasm -o $@ $<
chmod a+x $@
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_filename) Makefile
nasm $< -o $@
@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_filename). Use meld os.ndisasm.disasm os.reasm.disasm to see differences."; \
exit 1)
.PHONY: clean
clean: Makefile
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: $(tests) Makefile
.PHONY: $(tests)
$(tests): $(os_filename) ../deploy-screenshots Makefile
(cd .. && ./utils/gui-wrapper.sh 800x600x24 ./$@.sh example-os/$<)