]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - hypervisor/Makefile
jailhouse: inmates: bench: Add -R option -- repeats count.
[jailhouse.git] / hypervisor / Makefile
index 6c7d1160e84f7269e518a5715340a09cfd32bb0d..0532e4e354eca764f4c47c47d502954c0d051d8d 100644 (file)
@@ -11,7 +11,9 @@
 # This work is licensed under the terms of the GNU GPL, version 2.  See
 # the COPYING file in the top-level directory.
 #
-# asm-defines.h generation code derived from Linux kernel.
+# asm-defines.h generation code derived from linux/Kbuild:
+#
+# Copyright (c) Linux kernel developers, 2014
 #
 
 LINUXINCLUDE := -I$(src)/arch/$(SRCARCH)/include -I$(src)/include
@@ -21,22 +23,42 @@ KBUILD_CFLAGS := -g -Os -Wall -Wstrict-prototypes -Wtype-limits \
                 -fno-stack-protector -fno-builtin-ffsl
 
 ifeq ($(SRCARCH),x86)
-KBUILD_CFLAGS += -mcmodel=kernel
+KBUILD_CFLAGS += -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
+KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
 KBUILD_CPPFLAGS += -m64
 BUILD_VARIANTS := amd intel
 endif
 
+ifeq ($(SRCARCH),arm)
+KBUILD_CFLAGS += -marm
+endif
+
 ifneq ($(wildcard $(obj)/include/jailhouse/config.h),)
 KBUILD_CFLAGS += -include $(obj)/include/jailhouse/config.h
 endif
 
-CORE_OBJECTS = setup.o printk.o paging.o control.o lib.o
+CORE_OBJECTS = setup.o printk.o paging.o control.o lib.o mmio.o
+
+define filechk_config_mk
+(                                                                      \
+       echo "\$$(foreach config,\$$(filter CONFIG_%,           \
+               \$$(.VARIABLES)), \$$(eval undefine \$$(config)))";     \
+       if [ -f $(src)/include/jailhouse/config.h ]; then               \
+               sed -e "/^#define \([^[:space:]]*\)[[:space:]]*1/!d"    \
+                   -e "s/^#define \([^[:space:]]*\)[[:space:]]*1/\1=y/" \
+                       $(src)/include/jailhouse/config.h;              \
+       fi                                                              \
+)
+endef
+
+$(obj)/include/generated/config.mk: Makefile FORCE
+       $(call filechk,config_mk)
 
 define filechk_version
        $(src)/../scripts/gen_version_h $(src)/..
 endef
 
-clean-files := $(obj)/include/jailhouse/version.h
+clean-dirs += include/generated/
 
 define sed-y
        "/^=>/{s:=>#\(.*\):/* \1 */:; \
@@ -73,16 +95,17 @@ $(obj)/$(defines-file): $(obj)/arch/$(SRCARCH)/asm-defines.s
        $(Q)mkdir -p $(dir $@)
        $(call cmd,defines)
 
-$(obj)/include/jailhouse/version.h: $(src)/Makefile FORCE
+$(obj)/include/generated/version.h: $(src)/Makefile FORCE
        $(call filechk,version)
 
 $(foreach co,$(CORE_OBJECTS),\
        $(eval $(obj)/$(co): $(obj)/$(defines-file)))
 
-$(obj)/setup.o: $(obj)/include/jailhouse/version.h
+$(obj)/setup.o: $(obj)/include/generated/version.h
 
-arch-builtin: $(obj)/$(defines-file) FORCE
-       $(Q)$(MAKE) $(build)=$(obj)/arch/$(SRCARCH)
+arch-builtin: $(obj)/$(defines-file) $(obj)/include/generated/config.mk FORCE
+       $(Q)$(MAKE) $(build)=$(obj)/arch/$(SRCARCH) \
+               CONFIG_MK=$(obj)/include/generated/config.mk
 
 always :=