From 101d417d53017302c021b6b66a8b76e1644e354d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sat, 28 Jul 2018 19:21:46 +0200 Subject: [PATCH] Build os.offsets.hex and os.offsets.dec --- .gitignore | 3 ++- Makefile | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index b90d00f..a93bb71 100644 --- a/.gitignore +++ b/.gitignore @@ -81,7 +81,8 @@ /build/os.hex_with_offsets /build/os.iso /build/os.ndisasm.disasm -/build/os.offsets +/build/os.offsets.dec +/build/os.offsets.hex /build/os.reasm /build/os.reasm.asm /build/os.zip diff --git a/Makefile b/Makefile index 17bc902..b2f3308 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,8 @@ built_files = ${os_filename} \ build/os.iso \ build/os.32k \ build/os.fat12 \ - build/os.offsets \ + build/os.offsets.hex \ + build/os.offsets.dec \ build/os.hex_with_offsets \ build/iso_files/os.zip \ build/iso_files/boot/iso_boot.sys \ @@ -97,7 +98,7 @@ os_floppy_chs_s = 9 .PHONY: all # all: os.arm.disasm -all: ${os_filename} build/os.ndisasm.disasm build/os.reasm.asm build/os.file build/os.gdisk build/os.offsets build/os.hex_with_offsets .gitignore build/check_makefile ${more_offset_dec} ${more_offset_hex} +all: ${os_filename} build/os.ndisasm.disasm build/os.reasm.asm build/os.file build/os.gdisk build/os.offsets.hex build/os.offsets.dec build/os.hex_with_offsets .gitignore build/check_makefile ${more_offset_dec} ${more_offset_hex} build/makefile_w_arnings: | $${@D} ${built_files}: | $${@D} @@ -300,15 +301,18 @@ build/os.gdisk: ${os_filename} build/check_makefile # * Quit printf 'p\nr\no\nq\n' | gdisk $< | tee $@ -build/os.offsets: ${offset_names:%=build/offsets/%.hex} build/check_makefile - grep '^' ${offset_names:%=build/offsets/%.hex} | sed -e 's/:/: 0x/' > $@ +build/os.offsets.hex: ${offset_names:%=build/offsets/%.hex} build/check_makefile + grep '^' ${offset_names:%=build/offsets/%.hex} | sed -e 's/:/: 0x/' | column -t > $@ + +build/os.offsets.dec: ${offset_names:%=build/offsets/%.dec} build/check_makefile + grep '^' ${offset_names:%=build/offsets/%.dec} | sed -e 's/:/: /' | column -t > $@ build/offsets/%.hex: build/offsets/%.dec printf '%x\n' $$(cat $<) > $@ -build/os.hex_with_offsets: ${os_filename} build/os.offsets +build/os.hex_with_offsets: ${os_filename} build/os.offsets.hex hexdump -C $< \ - | grep -E -e "($$(cat build/os.offsets | cut -d '=' -f 2 | sed -e 's/^[[:space:]]*0x\(.*\).$$/^\10/' | tr '\n' '|')^)" --color=yes > $@ + | grep -E -e "($$(cat build/os.offsets.hex | cut -d '=' -f 2 | sed -e 's/^[[:space:]]*0x\(.*\).$$/^\10/' | tr '\n' '|')^)" --color=yes > $@ build/os.ndisasm.disasm: ${os_filename} utils/compact-ndisasm.sh build/check_makefile ./utils/compact-ndisasm.sh $< $@