mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-26 13:59:57 +00:00
tool_chain: add ENABLE_FEATURE support
default: "c c++ ada go gdb" This allows to build a subset of the Genode tool chain issue #4094
This commit is contained in:
parent
ece33d37f8
commit
a6fe6c90d4
@ -25,6 +25,7 @@ help:
|
|||||||
$(ECHO) "BUILD_LOCATION=... - build location (default: $(DEFAULT_BUILD_LOCATION))"
|
$(ECHO) "BUILD_LOCATION=... - build location (default: $(DEFAULT_BUILD_LOCATION))"
|
||||||
$(ECHO) "INSTALL_LOCATION=... - install location (default: $(DEFAULT_INSTALL_LOCATION))"
|
$(ECHO) "INSTALL_LOCATION=... - install location (default: $(DEFAULT_INSTALL_LOCATION))"
|
||||||
$(ECHO) "SUDO=... - name of sudo command, leave empty to not use sudo (default: sudo)"
|
$(ECHO) "SUDO=... - name of sudo command, leave empty to not use sudo (default: sudo)"
|
||||||
|
$(ECHO) "ENABLE_FEATURES=... - features to enable (default: \"$(ENABLE_FEATURES)\")"
|
||||||
$(ECHO)
|
$(ECHO)
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -32,6 +33,7 @@ help:
|
|||||||
#
|
#
|
||||||
|
|
||||||
SUPPORTED_PLATFORMS := x86 arm riscv aarch64
|
SUPPORTED_PLATFORMS := x86 arm riscv aarch64
|
||||||
|
ENABLE_FEATURES ?= c c++ ada go gdb
|
||||||
|
|
||||||
PLATFORM := $(firstword $(filter $(SUPPORTED_PLATFORMS),$(MAKECMDGOALS)))
|
PLATFORM := $(firstword $(filter $(SUPPORTED_PLATFORMS),$(MAKECMDGOALS)))
|
||||||
|
|
||||||
@ -169,8 +171,11 @@ GNAT_OK = $(call check_equal_f,$(shell gnatmake --version | sed -n -e 's/GNATMAK
|
|||||||
Need to have GNAT installed and the GNAT version must match the GCC version (found GCC $(HOST_GCC_VERSION)).)
|
Need to have GNAT installed and the GNAT version must match the GCC version (found GCC $(HOST_GCC_VERSION)).)
|
||||||
|
|
||||||
TOOLS_OK = $(AUTOCONF_OK) $(AUTOCONFINST_OK) $(PKG_CONFIG_OK) $(CURSES_OK) \
|
TOOLS_OK = $(AUTOCONF_OK) $(AUTOCONFINST_OK) $(PKG_CONFIG_OK) $(CURSES_OK) \
|
||||||
$(TEXINFO_OK) $(WGET_OK) $(AUTOGEN_OK) $(GPG_OK) $(EXPAT_OK) \
|
$(TEXINFO_OK) $(WGET_OK) $(AUTOGEN_OK) $(GPG_OK) $(EXPAT_OK)
|
||||||
$(GNAT_OK)
|
|
||||||
|
ifneq ($(filter ada,$(ENABLE_FEATURES)),)
|
||||||
|
TOOLS_OK += $(GNAT_OK) $(GPRBUILD_OK)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(strip $(TOOLS_OK)),)
|
ifneq ($(strip $(TOOLS_OK)),)
|
||||||
$(error Please install missing tools.)
|
$(error Please install missing tools.)
|
||||||
@ -191,6 +196,8 @@ TARGET_NAME_riscv = riscv64-unknown-elf
|
|||||||
TARGET_NAME_aarch64 = aarch64-none-elf
|
TARGET_NAME_aarch64 = aarch64-none-elf
|
||||||
|
|
||||||
GCC_CONFIG_riscv = --with-arch=rv64imac --with-abi=lp64
|
GCC_CONFIG_riscv = --with-arch=rv64imac --with-abi=lp64
|
||||||
|
INSTALL_riscv = cd $(INSTALL_LOCATION)/lib/gcc/riscv64-unknown-elf/$(GCC_VERSION)/rv64imac/lp64 && \
|
||||||
|
$(SUDO) ln -sf ../../include include
|
||||||
|
|
||||||
ifneq ($(VERBOSE),)
|
ifneq ($(VERBOSE),)
|
||||||
CONFIG_QUIET = --quiet
|
CONFIG_QUIET = --quiet
|
||||||
@ -204,17 +211,19 @@ COMMON_BOOTSTRAP_CONFIG = $(CONFIG_QUIET) \
|
|||||||
|
|
||||||
BINUTILS_BOOTSTRAP_CONFIG += $(COMMON_BOOTSTRAP_CONFIG)
|
BINUTILS_BOOTSTRAP_CONFIG += $(COMMON_BOOTSTRAP_CONFIG)
|
||||||
|
|
||||||
ifeq ($(PLATFORM),riscv)
|
LANGUAGES := $(filter-out gdb, $(ENABLE_FEATURES))
|
||||||
LANGUAGES = c,c++
|
LANGUAGES := $(shell echo "${LANGUAGES}" | sed -e 's/ /,/g')
|
||||||
LIB_GCC = cd $(INSTALL_LOCATION)/lib/gcc/riscv64-unknown-elf/$(GCC_VERSION)/rv64imac/lp64 && \
|
|
||||||
$(SUDO) ln -sf ../../include include
|
ifeq ($(filter ada,$(LANGUAGES)),)
|
||||||
else
|
ALI2DEP_INSTALLED_BINARY =
|
||||||
LANGUAGES = c,c++,ada
|
endif
|
||||||
LIB_GCC =
|
|
||||||
|
ifeq ($(filter gdb,$(ENABLE_FEATURES)),)
|
||||||
|
GDB_INSTALLED_BINARIES =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GCC_BOOTSTRAP_CONFIG += $(COMMON_BOOTSTRAP_CONFIG) \
|
GCC_BOOTSTRAP_CONFIG += $(COMMON_BOOTSTRAP_CONFIG) \
|
||||||
--enable-languages=c,c++,ada \
|
--enable-languages=$(LANGUAGES) \
|
||||||
--disable-libatomic \
|
--disable-libatomic \
|
||||||
--disable-libcilkrts \
|
--disable-libcilkrts \
|
||||||
--disable-libgomp \
|
--disable-libgomp \
|
||||||
@ -258,7 +267,7 @@ BINUTILS_CONFIG += $(BINUTILS_CONFIG_$(PLATFORM))
|
|||||||
GDB_CONFIG += $(COMMON_CONFIG) --disable-werror --disable-sim
|
GDB_CONFIG += $(COMMON_CONFIG) --disable-werror --disable-sim
|
||||||
|
|
||||||
GCC_CONFIG += $(COMMON_CONFIG) \
|
GCC_CONFIG += $(COMMON_CONFIG) \
|
||||||
--enable-languages=$(LANGUAGES),go \
|
--enable-languages=$(LANGUAGES) \
|
||||||
--disable-libgo \
|
--disable-libgo \
|
||||||
--disable-gotools \
|
--disable-gotools \
|
||||||
--disable-libssp \
|
--disable-libssp \
|
||||||
@ -321,9 +330,9 @@ BINUTILS_INSTALLED_BINARIES = $(LOCAL_INSTALL_LOCATION)/bin/genode-$(PLATFORM)-o
|
|||||||
GCC_BINARIES = $(BUILD_LOCATION)/$(PLATFORM)/gcc/gcc/g++-cross
|
GCC_BINARIES = $(BUILD_LOCATION)/$(PLATFORM)/gcc/gcc/g++-cross
|
||||||
GCC_INSTALLED_BINARIES = $(LOCAL_INSTALL_LOCATION)/bin/genode-$(PLATFORM)-g++
|
GCC_INSTALLED_BINARIES = $(LOCAL_INSTALL_LOCATION)/bin/genode-$(PLATFORM)-g++
|
||||||
GDB_BINARIES = $(BUILD_LOCATION)/$(PLATFORM)/gdb/gdb/gdb
|
GDB_BINARIES = $(BUILD_LOCATION)/$(PLATFORM)/gdb/gdb/gdb
|
||||||
GDB_INSTALLED_BINARIES = $(LOCAL_INSTALL_LOCATION)/bin/genode-$(PLATFORM)-gdb
|
GDB_INSTALLED_BINARIES ?= $(LOCAL_INSTALL_LOCATION)/bin/genode-$(PLATFORM)-gdb
|
||||||
ALI2DEP_BINARY = $(BUILD_LOCATION)/ali2dep/ali2dep
|
ALI2DEP_BINARY = $(BUILD_LOCATION)/ali2dep/ali2dep
|
||||||
ALI2DEP_INSTALLED_BINARY = $(LOCAL_INSTALL_LOCATION)/bin/genode-$(PLATFORM)-ali2dep
|
ALI2DEP_INSTALLED_BINARY ?= $(LOCAL_INSTALL_LOCATION)/bin/genode-$(PLATFORM)-ali2dep
|
||||||
|
|
||||||
build_all: $(GCC_INSTALLED_BINARIES) $(GDB_INSTALLED_BINARIES) $(ALI2DEP_INSTALLED_BINARY)
|
build_all: $(GCC_INSTALLED_BINARIES) $(GDB_INSTALLED_BINARIES) $(ALI2DEP_INSTALLED_BINARY)
|
||||||
|
|
||||||
@ -478,6 +487,7 @@ install: build_all
|
|||||||
$(VERBOSE)$(SUDO) mkdir -p $(INSTALL_LOCATION)
|
$(VERBOSE)$(SUDO) mkdir -p $(INSTALL_LOCATION)
|
||||||
$(VERBOSE)$(SUDO) cp -a --remove-destination --no-target-directory $(LOCAL_INSTALL_LOCATION) $(INSTALL_LOCATION)
|
$(VERBOSE)$(SUDO) cp -a --remove-destination --no-target-directory $(LOCAL_INSTALL_LOCATION) $(INSTALL_LOCATION)
|
||||||
$(VERBOSE)$(LIB_GCC)
|
$(VERBOSE)$(LIB_GCC)
|
||||||
|
$(VERBOSE)$(INSTALL_$(PLATFORM))
|
||||||
ifeq ($(INSTALL_LOCATION),$(DEFAULT_INSTALL_LOCATION))
|
ifeq ($(INSTALL_LOCATION),$(DEFAULT_INSTALL_LOCATION))
|
||||||
$(VERBOSE)$(SUDO) ln -snf $(TOOL_CHAIN_VERSION) $(dir $(INSTALL_LOCATION))current
|
$(VERBOSE)$(SUDO) ln -snf $(TOOL_CHAIN_VERSION) $(dir $(INSTALL_LOCATION))current
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user