]> rtime.felk.cvut.cz Git - jailhouse.git/blob - inmates/Makefile
x86: Fix build on 32-bit userlands
[jailhouse.git] / inmates / 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)
14 KBUILD_CFLAGS := -g -Os -Wall -Wstrict-prototypes -Wtype-limits \
15                  -Wmissing-declarations -Wmissing-prototypes \
16                  -fno-strict-aliasing -fomit-frame-pointer -fno-pic \
17                  -fno-common -fno-stack-protector -I. \
18                  -I$(src)/../hypervisor/arch/$(SRCARCH)/include \
19                  -I$(src)/../hypervisor/include
20 ifneq ($(wildcard $(src)/../hypervisor/include/jailhouse/config.h),)
21 KBUILD_CFLAGS += -include $(src)/../hypervisor/include/jailhouse/config.h
22 endif
23
24 OBJCOPYFLAGS := -O binary
25 LDFLAGS += -T
26
27 ifeq ($(SRCARCH), x86)
28 KBUILD_CFLAGS += -m64
29 always := tiny-demo.bin apic-demo.bin
30 endif
31
32 tiny-demo-y := tiny-demo.o header.o printk.o pm-timer.o
33 targets += $(tiny-demo-y)
34
35 TINY_DEMO_OBJS = $(addprefix $(obj)/,$(tiny-demo-y))
36
37 target += tiny-demo-linked.o
38 $(obj)/tiny-demo-linked.o: $(src)/inmate.lds $(TINY_DEMO_OBJS)
39         $(call if_changed,ld)
40
41
42 apic-demo-y := apic-demo.o header.o printk.o pm-timer.o
43 targets += $(apic-demo-y)
44
45 APIC_DEMO_OBJS = $(addprefix $(obj)/,$(apic-demo-y))
46
47 target += apic-demo-linked.o
48 $(obj)/apic-demo-linked.o: $(src)/inmate.lds $(APIC_DEMO_OBJS)
49         $(call if_changed,ld)
50
51
52 targets += tiny-demo.bin apic-demo.bin
53 $(obj)/%.bin: $(obj)/%-linked.o
54         $(call if_changed,objcopy)