Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Nautilus Host Support (proof of concept)
[palacios.git] / Makefile
index 69493df..8e51d8f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,15 @@ V3_INCLUDE      := -Ipalacios/include \
 
 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,)
 
 
 
@@ -379,9 +387,9 @@ ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
 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
@@ -407,7 +415,7 @@ ifeq ($(config-targets),1)
 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
@@ -437,6 +445,7 @@ 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/
 
 
@@ -474,6 +483,13 @@ else
 DEFAULT_EXTRA_TARGETS=
 endif
 
+ifdef V3_CONFIG_NAUTILUS
+DEFAULT_EXTRA_TARGETS=nautilus
+else
+DEFAULT_EXTRA_TARGETS=
+endif
+
+
 # The all: target is the default when no target is given on the
 # command line.
 # This allow a user to issue only 'make' to build a kernel including modules
@@ -484,8 +500,19 @@ all: palacios $(DEFAULT_EXTRA_TARGETS)
 ifdef V3_CONFIG_LINUX
 CFLAGS          += -mcmodel=kernel 
 else
+ifdef V3_CONFIG_NAUTILUS
+CFLAGS          += -O2 \
+                  -fno-omit-frame-pointer \
+                  -ffreestanding \
+                  -fno-stack-protector \
+                  -fno-strict-aliasing \
+                  -mno-red-zone \
+                  -mcmodel=large 
+LDFLAGS         += -z max-page-size=0x1000
+else
 CFLAGS          += -fPIC
 endif
+endif
 
 ifdef V3_CONFIG_FRAME_POINTER
 CFLAGS         += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
@@ -512,6 +539,8 @@ NOSTDINC_FLAGS +=
 # disable pointer signedness warnings in gcc 4.0
 CFLAGS += $(call cc-option,-Wno-pointer-sign,)
 
+CFLAGS += -O2
+
 # Default kernel image to build when no specific target is given.
 # KBUILD_IMAGE may be overruled on the commandline or
 # set in the environment
@@ -529,7 +558,7 @@ export      INSTALL_PATH ?= /build
 
 
 palacios-dirs  := $(patsubst %/,%,$(filter %/,  \
-                    $(core-y) $(devices-y) $(interfaces-y) $(extensions-y) $(vnet-y) $(libs-y)) $(modules-y))
+                    $(core-y) $(devices-y) $(interfaces-y) $(extensions-y) $(vnet-y) $(gears-y) $(libs-y)) $(modules-y))
 
 
 
@@ -540,7 +569,7 @@ palacios-dirs       := $(patsubst %/,%,$(filter %/,  \
 
 palacios-cleandirs := $(sort $(palacios-dirs) $(patsubst %/,%,$(filter %/, \
                        $(core-n) $(core-) $(devices-n) $(devices-) \
-                       $(interfaces-n) $(interfaces-) $(extensions-n) $(extensions-) $(vnet-n) $(vnet-) $(modules-n) $(modules-))))
+                       $(interfaces-n) $(interfaces-) $(extensions-n) $(extensions-) $(vnet-n) $(vnet-) $(gears-n) $(gears-) $(modules-n) $(modules-))))
 
 
 
@@ -550,6 +579,7 @@ 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))
 
@@ -575,7 +605,7 @@ modules-y       := $(patsubst %/, %/built-in.o, $(modules-y))
 
 
 
-palacios := $(core-y) $(devices-y) $(interfaces-y) $(extensions-y) $(vnet-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
@@ -621,12 +651,17 @@ palacios: libv3vee.a
 
 
 linux_module/v3vee.ko: linux_module/*.c linux_module/*.h libv3vee.a
-       cd linux_module/ && make
+       cd linux_module/ && make -j 8
        cp linux_module/v3vee.ko v3vee.ko
 
 
 linux_module: linux_module/v3vee.ko 
 
+nautilus/libnautilus.a: nautilus/*.c nautilus/*.h libv3vee.a
+       cd nautilus/ && make 
+       cp nautilus/libnautilus.a .
+
+nautilus: nautilus/libnautilus.a
 
 
 palacios.asm: palacios
@@ -940,7 +975,7 @@ target-dir = $(dir $@)
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
 
 # Modules
-/ %/: prepare scripts FORCE
+%/: prepare scripts FORCE
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(V3_CONFIG_MODULES),1) \
        $(build)=$(build-dir)
 %.ko: prepare scripts FORCE