]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
inmates: arm: Fix and improve build
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 29 Sep 2014 10:37:29 +0000 (12:37 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sat, 27 Dec 2014 11:43:56 +0000 (12:43 +0100)
Introduce and use DECLARE_TARGETS just like x86 does. This prevents
unconditional rebuilding of the inmates on every make. Also move the
filtering of "-include asm/unified.h" into reusable Makefile.lib.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
inmates/demos/arm/Makefile
inmates/lib/arm/Makefile.lib

index b4beb11ad2b17a16c33962eef3e8973bad83652f..020deae6b9634795595acf482818d4e5f8b4d2f6 100644 (file)
@@ -10,8 +10,6 @@
 # the COPYING file in the top-level directory.
 #
 
-KBUILD_AFLAGS := $(filter-out -include asm/unified.h,$(KBUILD_AFLAGS))
-
 include $(INMATES_LIB)/Makefile.lib
 
 LIBDIR := ../../lib/arm
@@ -24,6 +22,4 @@ gic-demo-y := gic-demo.o \
 uart-demo-y := uart-demo.o \
        $(addprefix $(LIBDIR)/,header.o printk.o $(DRIVERS))
 
-
-targets += $(INMATES:.bin=-y) $(INMATES:.bin=-linked.o) $(INMATES)
-always := $(INMATES)
+$(eval $(call DECLARE_TARGETS,$(INMATES)))
index 0bc63cddcd86dc1eeb4b91c71c52d17b4a64f8f7..0992fd55910eb4c0b8c4834e69b4cb65bd19d828 100644 (file)
@@ -2,9 +2,11 @@
 # Jailhouse, a Linux-based partitioning hypervisor
 #
 # Copyright (c) ARM Limited, 2014
+# Copyright (c) Siemens AG, 2014
 #
 # Authors:
 #  Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+#  Jan Kiszka <jan.kiszka@siemens.com>
 #
 # This work is licensed under the terms of the GNU GPL, version 2.  See
 # the COPYING file in the top-level directory.
 
 -include $(obj)/../../../hypervisor/include/jailhouse/config.mk
 
+KBUILD_AFLAGS := $(filter-out -include asm/unified.h,$(KBUILD_AFLAGS))
+
 KBUILD_CFLAGS                          += -I$(INMATES_LIB)/include
-KBUILD_AFLAGE                          += -I$(INMATES_LIB)/include
+KBUILD_AFLAGS                          += -I$(INMATES_LIB)/include
+
+define DECLARE_TARGETS =
+ _TARGETS = $(1)
+ always := $$(_TARGETS)
+ # $(NAME-y) NAME-linked.o NAME.bin
+ targets += $$(foreach t,$$(_TARGETS:.bin=-y),$$($$t)) \
+            $$(_TARGETS:.bin=-linked.o) $$(_TARGETS)
+endef
 
 mach-$(CONFIG_ARCH_VEXPRESS)           := vexpress