]> rtime.felk.cvut.cz Git - jailhouse.git/blob - inmates/lib/x86/Makefile
inmates: Build library archive and link it implicitly
[jailhouse.git] / inmates / lib / x86 / Makefile
1 #
2 # Jailhouse, a Linux-based partitioning hypervisor
3 #
4 # Copyright (c) Siemens AG, 2015
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 always := lib.a lib32.a
14
15 TARGETS := header.o hypercall.o ioapic.o printk.o
16 TARGETS_64_ONLY := int.o mem.o pci.o timing.o
17
18 lib-y := $(TARGETS) $(TARGETS_64_ONLY)
19
20 lib32-y := $(addprefix $(obj)/,$(TARGETS:.o=-32.o))
21
22 quiet_cmd_link_archive32 = AR      $@
23 cmd_link_archive32 = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib32-y)
24
25 $(obj)/lib32.a: $(lib32-y)
26         $(call if_changed,link_archive32)
27
28 AFLAGS_header-32.o := -m32
29 targets += header-32.o
30
31 $(obj)/%-32.o: c_flags += -m32
32 $(obj)/%-32.o: $(src)/%.c
33         $(call if_changed_rule,cc_o_c)