diff options
Diffstat (limited to 'guest/Makefile')
-rw-r--r-- | guest/Makefile | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/guest/Makefile b/guest/Makefile index 635759a..61d7790 100644 --- a/guest/Makefile +++ b/guest/Makefile @@ -1,14 +1,16 @@ ARCH16 := i8086 ARCH64 := i386:x86-64 -guest: guest16 guest64 -disasm: disasm16 disasm64 +bits = $(word 1, $(subst -, ,$(1))) + +guest: guest16 guest64 guest64-msr +disasm: disasm16 disasm64 disasm64-msr guest%: guest.ld guest%.S - $(CC) $(CFLAGS) -m$* -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest$*.S + $(CC) $(CFLAGS) -m$(call bits, $*) -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest$*.S disasm%: guest% - objdump -D -b binary -m $(ARCH$*) -M intel $^ + objdump -D -b binary -m $(ARCH$(call bits, $*)) -M intel $^ clean: - $(RM) guest16 guest64 + $(RM) guest16 guest64 guest64-msr |