genode/repos/base-nova/src/kernel/nova/target.mk

64 lines
2.7 KiB
Makefile
Raw Normal View History

include $(call select_from_repositories,mk/spec/nova.mk)
2011-12-22 16:19:25 +01:00
TARGET = hypervisor
REQUIRES = x86 nova
2011-12-22 16:19:25 +01:00
NOVA_BUILD_DIR = $(BUILD_BASE_DIR)/kernel
Disambiguate kernel-specific file names This patch removes possible ambiguities with respect to the naming of kernel-dependent binaries and libraries. It also removes the use of kernel-specific global side effects from the build system. The reach of kernel-specific peculiarities has thereby become limited to the actual users of the respective 'syscall-<kernel>' libraries. Kernel-specific build artifacts are no longer generated at magic places within the build directory (like okl4's includes, or the L4 build directories of L4/Fiasco and Fiasco.OC, or the build directories of various kernels). Instead, such artifacts have been largely moved to the libcache. E.g., the former '<build-dir>/l4/' build directory for the L4 build system resides at '<build-dir>/var/libcache/syscall-foc/build/'. This way, the location is unique to the kernel. Note that various tools are still generated somewhat arbitrarily under '<build-dir>/tool/' as there is no proper formalism for building host tools yet. As the result of this work, it has become possible to use a joint Genode build directory that is usable with all kernels of a given hardware platform. E.g., on x86_32, one can now seamlessly switch between linux, nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any components except for core, the kernel, the dynamic linker, and the timer driver. At the current stage, such a build directory must still be created manually. A change of the 'create_builddir' tool will follow to make this feature easily available. This patch also simplifies various 'run/boot_dir' plugins by removing the option for an externally hosted kernel. This option remained unused for many years now. Issue #2190
2016-12-10 01:30:38 +01:00
NOVA_SRC_DIR = $(call select_from_ports,nova)/src/kernel/nova
2011-12-22 16:19:25 +01:00
SRC_CC = $(sort $(notdir $(wildcard $(NOVA_SRC_DIR)/src/*.cpp)))
SRC_S = $(sort $(notdir $(wildcard $(NOVA_SRC_DIR)/src/*.S)))
INC_DIR = $(NOVA_SRC_DIR)/include
override CC_OLEVEL := -Os
2011-12-22 16:19:25 +01:00
CC_WARN = -Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual \
-Wconversion -Wdisabled-optimization -Wformat=2 \
-Wmissing-format-attribute -Wmissing-noreturn -Wpacked \
-Wpointer-arith -Wredundant-decls -Wshadow -Wwrite-strings \
-Wctor-dtor-privacy -Wno-non-virtual-dtor \
2011-12-22 16:19:25 +01:00
-Wold-style-cast -Woverloaded-virtual -Wsign-promo \
-Wlogical-op -Wstrict-null-sentinel \
2011-12-22 16:19:25 +01:00
-Wstrict-overflow=5 -Wvolatile-register-var
# XXX fix the warnings and remove this option
CC_WARN += -Wno-error=implicit-fallthrough
CC_OPT += -pipe \
2011-12-22 16:19:25 +01:00
-fdata-sections -fomit-frame-pointer -freg-struct-return \
-freorder-blocks -funit-at-a-time -fno-exceptions -fno-rtti \
-fno-stack-protector -fvisibility-inlines-hidden \
-fno-asynchronous-unwind-tables -std=gnu++0x
# kernel memory: 28M minimum dynamic or 10 pro mill of the system memory
CC_OPT += -DCONFIG_MEMORY_DYN_MIN=0x1c00000 \
-DCONFIG_MEMORY_DYN_PER_MILL=10
CC_OPT_PIC :=
ifeq ($(filter-out $(SPECS),32bit),)
override CC_MARCH = -m32
CC_WARN += -Wframe-larger-than=96
CC_OPT += -mpreferred-stack-boundary=2 -mregparm=3
else
ifeq ($(filter-out $(SPECS),64bit),)
override CC_MARCH = -m64
CC_WARN += -Wframe-larger-than=256
CC_OPT += -mpreferred-stack-boundary=4 -mcmodel=kernel -mno-red-zone
else
$(error Unsupported environment)
endif
endif
# disable -Wsuggest-override
CC_CXX_WARN_STRICT = -Wextra -Weffc++ -Werror
git_version = $(shell cd $(NOVA_SRC_DIR) && (git rev-parse HEAD 2>/dev/null || echo 0) | cut -c1-7)
CXX_LINK_OPT = -Wl,--gc-sections -Wl,--warn-common -Wl,-static -Wl,-n -Wl,--defsym=GIT_VER=0x$(call git_version)
LD_TEXT_ADDR = # 0xc000000000 - when setting this 64bit compile fails because of relocation issues!!
2011-12-22 16:19:25 +01:00
LD_SCRIPT_STATIC = hypervisor.o
$(TARGET): hypervisor.o
hypervisor.o: $(NOVA_SRC_DIR)/src/hypervisor.ld target.mk
$(VERBOSE)$(CC) $(INCLUDES) -DCONFIG_MEMORY_BOOT=4M -MP -MMD -pipe $(CC_MARCH) -xc -E -P $< -o $@
2011-12-22 16:19:25 +01:00
clean cleanall:
$(VERBOSE)rm -rf $(NOVA_BUILD_DIR)
vpath %.cpp $(NOVA_SRC_DIR)/src
vpath %.S $(NOVA_SRC_DIR)/src