genode/repos/base-fiasco/lib/mk/kernel-fiasco.inc
Christian Helmuth d182b20705 build: ensure rules with pipes might fail
.SHELLFLAGS is extended by option pipefail to make pipes fail if any pipe
element fails. As .SHELLFLAGS is exported into sub-make instances it
must be unexported before calling third-party build systems recursively.
2022-03-21 13:43:13 +01:00

59 lines
1.9 KiB
PHP

L4_SRC_DIR = $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot
FIASCO_BUILD_DIR = $(shell pwd)/build
FIASCO = $(FIASCO_BUILD_DIR)/fiasco
FIASCO_SRC = $(L4_SRC_DIR)/kernel/fiasco
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco] /"
KERNEL_CXXFLAGS = -std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN) \
-Wno-address-of-packed-member
$(FIASCO_BUILD_DIR):
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@ \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $@ oldconfig \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FIASCO): $(FIASCO_BUILD_DIR)
$(VERBOSE_MK) MAKEFLAGS= CFLAGS="-std=gnu89 $(CWARN)" \
CXXFLAGS="$(KERNEL_CXXFLAGS)" \
$(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR) \
$(KERNEL_BUILD_OUTPUT_FILTER)
#
# Sigma0 and bootstrap are provided as L4 packages
#
# We build them within the L4 build directory created by the 'syscall-fiasco'
# library.
#
LIBS += syscall-fiasco
PKGS = l4sys/lib \
uclibc/lib/uclibc \
uclibc/lib/include \
crtx \
l4util/lib \
cxx \
sigma0/server \
bootstrap
L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-fiasco
include $(REP_DIR)/lib/mk/l4_pkg.inc
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'.
#
ifeq ($(called_from_lib_mk),yes)
all: $(FIASCO)
endif