aboutsummaryrefslogtreecommitdiffhomepage
path: root/guest
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2021-12-11 20:55:48 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2021-12-11 20:55:48 +0100
commit643f932bcdc8d35ffd0e50d1291f4f895de76fac (patch)
treef998a9b4fc2ea182f0aeb87e5d5ed44d54561111 /guest
parent1be06acc235878253977ae75467db591763f31bf (diff)
downloadmini-kvm-rs-643f932bcdc8d35ffd0e50d1291f4f895de76fac.tar.gz
mini-kvm-rs-643f932bcdc8d35ffd0e50d1291f4f895de76fac.zip
guest: merge make rules
Diffstat (limited to 'guest')
-rw-r--r--guest/Makefile17
1 files changed, 7 insertions, 10 deletions
diff --git a/guest/Makefile b/guest/Makefile
index a2eea1b..635759a 100644
--- a/guest/Makefile
+++ b/guest/Makefile
@@ -1,17 +1,14 @@
+ARCH16 := i8086
+ARCH64 := i386:x86-64
+
guest: guest16 guest64
disasm: disasm16 disasm64
-guest16: guest.ld guest16.S
- $(CC) $(CFLAGS) -m16 -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest16.S
-
-guest64: guest.ld guest64.S
- $(CC) $(CFLAGS) -m64 -o $@ -nostdlib -fPIC -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest64.S
-
-disasm16: guest16
- objdump -D -b binary -m i8086 -M intel $^
+guest%: guest.ld guest%.S
+ $(CC) $(CFLAGS) -m$* -o $@ -nostdlib -ffreestanding -Wpedantic -Wall -Wextra -Werror -T guest.ld guest$*.S
-disasm64: guest64
- objdump -D -b binary -m i386:x86-64 -M intel $^
+disasm%: guest%
+ objdump -D -b binary -m $(ARCH$*) -M intel $^
clean:
$(RM) guest16 guest64