CPPFLAGS := $(V3_INCLUDE) -D__V3VEE__
-CFLAGS := -fno-stack-protector -Wall -Werror -mno-red-zone -fno-common
+#
+# We want no-strict-aliasing here whether or not the target kernel
+# has it configued. See Linus's rant about gcc's "if the standard
+# says we can do anything, we will do the wrong thing" behavior with
+# regard to this option
+#
+CFLAGS := -fno-stack-protector -Wall -Werror -mno-red-zone -fno-common \
+ -fno-strict-aliasing -ffreestanding \
+ $(call cc-option, -Wno-unused-but-set-variable,)
endif
ifeq ($(KBUILD_EXTMOD),)
- ifneq ($(filter config %config,$(MAKECMDGOALS)),)
+ ifneq ($(filter %config,$(MAKECMDGOALS)),)
config-targets := 1
- ifneq ($(filter-out config %config,$(MAKECMDGOALS)),)
+ ifneq ($(filter-out %config,$(MAKECMDGOALS)),)
mixed-targets := 1
endif
endif
include $(srctree)/Makefile.$(ARCH)
export KBUILD_DEFCONFIG
-config %config: scripts_basic outputmakefile FORCE
+%config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p palacios/include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
# $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
devices-y := palacios/src/devices/
interfaces-y := palacios/src/interfaces/
extensions-y := palacios/src/extensions/
+vnet-y := palacios/src/vnet/
+gears-y := palacios/src/gears/
modules-y := modules/
endif
-ifdef CONFIG_LINUX
+ifdef V3_CONFIG_LINUX
DEFAULT_EXTRA_TARGETS=linux_module
else
DEFAULT_EXTRA_TARGETS=
all: palacios $(DEFAULT_EXTRA_TARGETS)
-ifdef CONFIG_LINUX
+ifdef V3_CONFIG_LINUX
CFLAGS += -mcmodel=kernel
else
CFLAGS += -fPIC
endif
-ifdef CONFIG_FRAME_POINTER
+ifdef V3_CONFIG_FRAME_POINTER
CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
else
CFLAGS += -fomit-frame-pointer
endif
-ifdef CONFIG_UNWIND_INFO
+ifdef V3_CONFIG_UNWIND_INFO
CFLAGS += -fasynchronous-unwind-tables
endif
-ifdef CONFIG_DEBUG_INFO
+ifdef V3_CONFIG_DEBUG_INFO
CFLAGS += -g
-else
-CFLAGS += -O
endif
# disable pointer signedness warnings in gcc 4.0
CFLAGS += $(call cc-option,-Wno-pointer-sign,)
+CFLAGS += -O
+
# Default kernel image to build when no specific target is given.
# KBUILD_IMAGE may be overruled on the commandline or
# set in the environment
palacios-dirs := $(patsubst %/,%,$(filter %/, \
- $(core-y) $(devices-y) $(interfaces-y) $(extensions-y) $(libs-y)) $(modules-y))
+ $(core-y) $(devices-y) $(interfaces-y) $(extensions-y) $(vnet-y) $(gears-y) $(libs-y)) $(modules-y))
palacios-cleandirs := $(sort $(palacios-dirs) $(patsubst %/,%,$(filter %/, \
$(core-n) $(core-) $(devices-n) $(devices-) \
- $(interfaces-n) $(interfaces-) $(extensions-n) $(extensions-) $(modules-n) $(modules-))))
+ $(interfaces-n) $(interfaces-) $(extensions-n) $(extensions-) $(vnet-n) $(vnet-) $(gears-n) $(gears-) $(modules-n) $(modules-))))
interfaces-y := $(patsubst %/, %/built-in.o, $(interfaces-y))
extensions-y := $(patsubst %/, %/built-in.o, $(extensions-y))
libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
+vnet-y := $(patsubst %/, %/built-in.o, $(vnet-y))
+gears-y := $(patsubst %/, %/built-in.o, $(gears-y))
modules-y := $(patsubst %/, %/built-in.o, $(modules-y))
#lnxmod-y := $(patsubst %/, %/built-in.o, $(lnxmod-y))
-palacios := $(core-y) $(devices-y) $(interfaces-y) $(extensions-y) $(libs-y) $(modules-y)
+palacios := $(core-y) $(devices-y) $(interfaces-y) $(extensions-y) $(vnet-y) $(gears-y) $(libs-y) $(modules-y)
# Rule to link palacios - also used during CONFIG_CONFIGKALLSYMS
linux_module/v3vee.ko: linux_module/*.c linux_module/*.h libv3vee.a
- cd linux_module/ && make CONFIG_LINUX_KERN=$(CONFIG_LINUX_KERN)
+ cd linux_module/ && make -j 8
cp linux_module/v3vee.ko v3vee.ko
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
# Modules
-/ %/: prepare scripts FORCE
- $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+%/: prepare scripts FORCE
+ $(Q)$(MAKE) KBUILD_MODULES=$(if $(V3_CONFIG_MODULES),1) \
$(build)=$(build-dir)
%.ko: prepare scripts FORCE
- $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
+ $(Q)$(MAKE) KBUILD_MODULES=$(if $(V3_CONFIG_MODULES),1) \
$(build)=$(build-dir) $(@:.ko=.o)
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost