aboutsummaryrefslogtreecommitdiffhomepage
path: root/guest/Makefile
blob: 61d7790f21ec28a2e1c2e6b9619fa4c293cfb8bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ARCH16 := i8086
ARCH64 := i386:x86-64

bits = $(word 1, $(subst -, ,$(1)))

guest: guest16 guest64 guest64-msr
disasm: disasm16 disasm64 disasm64-msr

guest%: 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$(call bits, $*)) -M intel $^

clean:
	$(RM) guest16 guest64 guest64-msr