2 # Jailhouse, a Linux-based partitioning hypervisor
4 # Copyright (c) Siemens AG, 2015, 2016
7 # Jan Kiszka <jan.kiszka@siemens.com>
9 # This work is licensed under the terms of the GNU GPL, version 2. See
10 # the COPYING file in the top-level directory.
13 always := lib.a lib32.a
15 TARGETS := header.o hypercall.o ioapic.o printk.o smp.o
16 TARGETS += ../pci.o ../string.o ../cmdline.o
17 TARGETS_64_ONLY := int.o mem.o pci.o timing.o
19 ccflags-y := -ffunction-sections
21 lib-y := $(TARGETS) $(TARGETS_64_ONLY)
23 lib32-y := $(addprefix $(obj)/,$(TARGETS:.o=-32.o))
25 quiet_cmd_link_archive32 = AR $@
26 cmd_link_archive32 = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib32-y)
28 $(obj)/lib32.a: $(lib32-y)
29 $(call if_changed,link_archive32)
31 AFLAGS_header-32.o := -m32
32 targets += header-32.o
34 $(obj)/%-32.o: c_flags += -m32
35 $(obj)/%-32.o: $(src)/%.c
36 $(call if_changed_rule,cc_o_c)