]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/Makefile
x86: Fix build on 32-bit userlands
[jailhouse.git] / hypervisor / Makefile
1 #
2 # Jailhouse, a Linux-based partitioning hypervisor
3 #
4 # Copyright (c) Siemens AG, 2013
5 #
6 # Authors:
7 #  Jan Kiszka <jan.kiszka@siemens.com>
8 #
9 # This work is licensed under the terms of the GNU GPL, version 2.  See
10 # the COPYING file in the top-level directory.
11 #
12
13 LINUXINCLUDE := -I$(src)/arch/$(SRCARCH)/include -I$(src)/include
14 KBUILD_CFLAGS := -g -Os -Wall -Wstrict-prototypes -Wtype-limits \
15                  -Wmissing-declarations -Wmissing-prototypes \
16                  -fno-strict-aliasing -fno-pic -fno-common \
17                  -fno-stack-protector -fno-builtin-ffsl
18
19 ifeq ($(SRCARCH),x86)
20 KBUILD_CFLAGS += -mcmodel=kernel
21 KBUILD_CPPFLAGS += -m64
22 endif
23
24 ifneq ($(wildcard $(src)/include/jailhouse/config.h),)
25 KBUILD_CFLAGS += -include $(src)/include/jailhouse/config.h
26 endif
27
28 subdir-y := arch/$(SRCARCH)
29
30 always := jailhouse.bin
31
32 hypervisor-y := setup.o printk.o paging.o control.o lib.o \
33         arch/$(SRCARCH)/built-in.o hypervisor.lds
34 targets += $(hypervisor-y)
35
36 HYPERVISOR_OBJS = $(addprefix $(obj)/,$(hypervisor-y))
37
38 LDFLAGS_hypervisor.o := -T
39
40 targets += hypervisor.o
41 $(obj)/hypervisor.o: $(src)/hypervisor.lds $(HYPERVISOR_OBJS)
42         $(call if_changed,ld)
43
44 OBJCOPYFLAGS_jailhouse.bin := -O binary
45
46 targets += jailhouse.bin
47 $(obj)/jailhouse.bin: $(obj)/hypervisor.o
48         $(call if_changed,objcopy)