X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=360dbd64eefdf03362258f9a968ad1ee9f8b25bf;hb=4156ab67859b157da5d78ea6984f3af067bb7edd;hp=9acf2de7e3d5a53a4a0d37ab6db3ede9e9b11b43;hpb=83f60861f497f76eab73fbd856870b9c32dca8ac;p=palacios.git diff --git a/Makefile b/Makefile index 9acf2de..360dbd6 100644 --- a/Makefile +++ b/Makefile @@ -298,8 +298,10 @@ V3_INCLUDE := -Ipalacios/include \ CPPFLAGS := $(V3_INCLUDE) -D__V3VEE__ -CFLAGS := -fno-stack-protector -Wall -Werror -fPIC -mno-red-zone -fno-common -#-fPIC +CFLAGS := -fno-stack-protector -Wall -Werror -mno-red-zone -fno-common + + + #-ffreestanding @@ -434,6 +436,8 @@ libs-y := palacios/lib/$(ARCH)/ devices-y := palacios/src/devices/ modules-y := modules/ + + ifeq ($(dot-config),1) # In this section, we need .config @@ -460,7 +464,12 @@ else palacios/include/autoconf.h: ; endif + +ifdef CONFIG_LINUX +DEFAULT_EXTRA_TARGETS=linux_module +else DEFAULT_EXTRA_TARGETS= +endif # The all: target is the default when no target is given on the # command line. @@ -469,6 +478,12 @@ DEFAULT_EXTRA_TARGETS= all: palacios $(DEFAULT_EXTRA_TARGETS) +ifdef CONFIG_LINUX +CFLAGS += -mcmodel=kernel +else +CFLAGS += -fPIC +endif + ifdef CONFIG_FRAME_POINTER CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,) else @@ -515,6 +530,8 @@ export INSTALL_PATH ?= /build palacios-dirs := $(patsubst %/,%,$(filter %/, \ $(core-y) $(devices-y) $(libs-y)) $(modules-y)) + + #palacios-alldirs := $(sort $(palacios-dirs) $(patsubst %/,%,$(filter %/, \ # $(core-n) $(core-) $(devices-n) $(devices-) \ # $(libs-n) $(libs-)))) @@ -529,6 +546,8 @@ core-y := $(patsubst %/, %/built-in.o, $(core-y)) devices-y := $(patsubst %/, %/built-in.o, $(devices-y)) libs-y := $(patsubst %/, %/built-in.o, $(libs-y)) modules-y := $(patsubst %/, %/built-in.o, $(modules-y)) +#lnxmod-y := $(patsubst %/, %/built-in.o, $(lnxmod-y)) + #core-y := $(patsubst %/, %/lib.a, $(core-y)) #devices-y := $(patsubst %/, %/lib.a, $(devices-y)) @@ -553,7 +572,8 @@ modules-y := $(patsubst %/, %/built-in.o, $(modules-y)) palacios := $(core-y) $(devices-y) $(libs-y) $(modules-y) -# Rule to link palacios - also used during CONFIG_KALLSYMS + +# Rule to link palacios - also used during CONFIG_CONFIGKALLSYMS # May be overridden by /Makefile.$(ARCH) quiet_cmd_palacios__ ?= AR $@ cmd_palacios__ ?= $(AR) rcs $@ $^ @@ -592,6 +612,18 @@ libv3vee.a: $(palacios) palacios: libv3vee.a + + + +linux_module/v3vee.ko: linux_module/*.c linux_module/*.h libv3vee.a + cd linux_module/ && make CONFIG_LINUX_KERN=$(CONFIG_LINUX_KERN) + cp linux_module/v3vee.ko v3vee.ko + + +linux_module: linux_module/v3vee.ko + + + palacios.asm: palacios $(OBJDUMP) --disassemble $< > $@ @@ -707,7 +739,7 @@ clean: archclean $(clean-dirs) @find . $(RCS_FIND_IGNORE) \ \( -name 'lib' \) -prune -o \ \( -name '*.[oas]' -o -name '.*.cmd' \ - -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ + -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' -o -name '*.ko' \) \ -type f -print | xargs rm -f # mrproper - Delete all generated files, including .config