Add unified build directories to create_builddir

This patch makes the benefit of the recently introduced unified Genode
ABI available to developers by enabling the use of multiple kernels from
within a single build directory. The create_builddir tool has gained a
new set of kernel-agnostic platform arguments such as x86_32, or panda.
Most build targets within directories are in principle compatible with
all kernels that support the selected hardware platform. To execute a
scenario via the run tool, one has to select the kernel to use by
setting the 'KERNEL' argument in the build configuration
(etc/build.conf). Alternatively, the 'KERNEL' can be specified as
command-line argument of the Genode build system, e.g.:

  make run/log KERNEL=nova

This allows us to easily switch from one kernel to another without
rebuilding any Genode component except for the very few kernel-specific
ones.

The new version of the 'create_builddir' tool is still compatible with
the old version. The old kernel-specific build directories can still be
created. However, those variants will eventually be removed.

Note that the commit removes the 'ports-foc' repository from the
generated 'build.conf' files. As this is only meaningful for 'foc',
I did not want to include it in the list of regular repositories (as
visible in a 'x86_32' build directory). Hence, the repository must
now be manually added in order to use L4Linux.

Issue #2190
This commit is contained in:
Norman Feske 2016-12-21 08:16:12 +01:00
parent 9ea4a491d6
commit 253097314c
71 changed files with 339 additions and 412 deletions

View File

@ -1 +1 @@
SPECS += genode fiasco x86_32 vesa pci ps2 framebuffer
SPECS += fiasco x86_32

View File

@ -1 +1 @@
SPECS += genode foc
SPECS += foc

View File

@ -4,6 +4,9 @@ FOC_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco.oc] /"
MAKEOVERRIDES := $(filter-out KERNEL=%,$(MAKEOVERRIDES))
unexport KERNEL
$(FOC_BUILD_DIR):
$(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FOC_SRC) BUILDDIR=$@ \

View File

@ -1,23 +1 @@
SPECS += genode linux sdl
#
# Detect host CPU architecture
#
UNAME_MACHINE := $(shell uname -m)
ifeq ($(UNAME_MACHINE),i686)
SPECS += x86_32
endif
ifeq ($(UNAME_MACHINE),x86_64)
SPECS += x86_64
endif
ifeq ($(UNAME_MACHINE),armv6l)
SPECS += arm_v6
endif
ifeq ($(UNAME_MACHINE),armv7l)
SPECS += arm_v7a
endif
SPECS += linux sdl

View File

@ -1 +1 @@
SPECS += genode nova vesa acpi pci ps2 framebuffer
SPECS += nova acpi

View File

@ -1 +1 @@
SPECS += genode okl4 x86_32 vesa pci ps2 framebuffer
SPECS += okl4 x86_32

View File

@ -1 +1 @@
SPECS += genode pistachio x86_32 vesa pci ps2 framebuffer
SPECS += pistachio x86_32

View File

@ -1 +1 @@
SPECS += genode sel4 vesa acpi pci ps2 framebuffer
SPECS += sel4 acpi

View File

@ -0,0 +1,3 @@
ifeq ($(filter $(SPECS),linux),)
SPECS += vesa pci ps2 framebuffer usb
endif

View File

@ -17,3 +17,4 @@ LD_MARCH ?= -melf_i386
AS_MARCH ?= -march=i686 --32
include $(call select_from_repositories,mk/spec/32bit.mk)
include $(call select_from_repositories,mk/spec/x86.mk)

View File

@ -20,5 +20,5 @@ CC_MARCH ?= -m64
#
LD_MARCH ?= -melf_x86_64
include $(call select_from_repositories,mk/spec/64bit.mk)
include $(call select_from_repositories,mk/spec/x86.mk)

View File

@ -0,0 +1,3 @@
# enable parallel build
#MAKE += -j4

View File

@ -0,0 +1,14 @@
##
## Qemu arguments, effective when using the run tool's 'power_on/qemu' back end
##
# enable GDB stub
#QEMU_OPT += -s
# use time-tested graphics backend
QEMU_OPT += -display sdl
# add kernel-specific Qemu arguments
QEMU_OPT += $(QEMU_OPT(${KERNEL})}

View File

@ -0,0 +1,20 @@
##
## Qemu arguments, effective when using the run tool's 'power_on/qemu' back end
##
# enable GDB stub
#QEMU_OPT += -s
# prevent Qemu from using KVM
QEMU_OPT += -no-kvm
# use time-tested graphics backend
QEMU_OPT += -display sdl
# use machine model that supports nested virtualization
QEMU_OPT(nova) += -cpu core2duo
# add kernel-specific Qemu arguments
QEMU_OPT += $(QEMU_OPT(${KERNEL})}

View File

@ -1,4 +1,22 @@
##
## Kernel-specific repository
##
ifdef KERNEL
REPOSITORIES += $(GENODE_DIR)/repos/base-$(KERNEL)
endif
##
## Repositories needed for the default demo scenario
##
REPOSITORIES += $(GENODE_DIR)/repos/base
REPOSITORIES += $(GENODE_DIR)/repos/os
REPOSITORIES += $(GENODE_DIR)/repos/demo
##
## Optional repositories
##
@ -36,9 +54,11 @@
#REPOSITORIES += $(GENODE_DIR)/repos/gems
#
# Genode world repository
# Collection of community-maintained components
#
# Collection of community-maintained components available at
# https://github.com/genodelabs/genode-world.git
# Please follow the instructions provided at:
#
# https://github.com/genodelabs/genode-world
#
#REPOSITORIES += $(GENODE_DIR)/repos/world

View File

@ -1,4 +1,3 @@
#
# Drivers ported from the OpenBSD
#
@ -8,3 +7,4 @@
# Drivers ported from iPXE
#
#REPOSITORIES += $(GENODE_DIR)/repos/dde_ipxe

View File

@ -0,0 +1,5 @@
##
## Run-tool configuration
##

View File

@ -0,0 +1,4 @@
ifdef KERNEL
RUN_OPT += ${KERNEL_RUN_OPT(${KERNEL})} --include boot_dir/$(KERNEL)
endif

View File

@ -0,0 +1,3 @@
# kernel to use
KERNEL ?= fiasco

View File

@ -0,0 +1,3 @@
# kernel to use
KERNEL ?= foc

View File

@ -0,0 +1,3 @@
# kernel to use
KERNEL ?= hw

View File

@ -0,0 +1,3 @@
# kernel to use (hw or foc)
KERNEL ?= hw

View File

@ -1,4 +1,6 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-linux
# kernel to use
KERNEL ?= linux
##
## Kernel-specific run tool configuration
@ -6,3 +8,4 @@ REPOSITORIES = $(GENODE_DIR)/repos/base-linux
RUN_OPT = --include boot_dir/linux \
--include power_on/linux --include log/linux

View File

@ -0,0 +1,3 @@
# kernel to use
KERNEL ?= nova

View File

@ -0,0 +1,3 @@
# kernel to use
KERNEL ?= okl4

View File

@ -0,0 +1,3 @@
# kernel to use
KERNEL ?= pistachio

View File

@ -0,0 +1,3 @@
# kernel to use
KERNEL ?= sel4

View File

@ -0,0 +1,3 @@
# kernel to use (nova, linux, sel4, foc, okl4, fiasco, or pistachio)
#KERNEL ?= nova

View File

@ -0,0 +1,3 @@
# kernel to use (nova, hw, linux, or foc)
#KERNEL ?= nova

View File

@ -0,0 +1,4 @@
# local varible for run-tool arguments that depend on the used kernel
KERNEL_RUN_OPT(hw) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(foc) := $(QEMU_RUN_OPT)

View File

@ -0,0 +1,3 @@
# local varible for run-tool arguments that depend on the used kernel
KERNEL_RUN_OPT(hw) := $(QEMU_RUN_OPT)

View File

@ -1,4 +1,3 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
@ -11,6 +10,7 @@ RUN_OPT = --include boot_dir/hw --include image/muen
#
# The specified file must be relative to the Muen policy directory or an
# absolute path.
#
RUN_OPT += --image-muen-hardware platform/lenovo-t430s.xml
#
@ -28,13 +28,15 @@ RUN_OPT += --image-muen-spark-path /opt/spark
#
# The specified file must be relative to the Muen policy directory or an
# absolute path.
#
RUN_OPT += --image-muen-system xml/genode-base_hw.xml
#
# Muen system components
#
# Available components are located in the Muen project directory 'components/'.
RUN_OPT += --image-muen-components 'libdebuglog libmutime dbgserver sm tau0 time'
#
RUN_OPT += --image-muen-components 'dbgserver sm tau0 time'
#
# External Muen build
@ -42,4 +44,6 @@ RUN_OPT += --image-muen-components 'libdebuglog libmutime dbgserver sm tau0 time
# Specifies if the Muen kernel should be built automatically.
# If the Muen system is built and integrated externally, i.e. outside
# of the Genode build system, set this parameter to 1.
#
RUN_OPT += --image-muen-external-build 0

View File

@ -0,0 +1,7 @@
##
## Run tool configuration
##
RUN_OPT = --include power_on/spike --include log/spike

View File

@ -0,0 +1,9 @@
# local varible for run-tool arguments that depend on the used kernel
KERNEL_RUN_OPT(nova) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(sel4) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(foc) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(okl4) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(fiasco) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(pistachio) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(linux) := --include power_on/linux --include log/linux

View File

@ -0,0 +1,6 @@
# local varible for run-tool arguments that depend on the used kernel
KERNEL_RUN_OPT(nova) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(hw) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(foc) := $(QEMU_RUN_OPT)
KERNEL_RUN_OPT(linux) := --include power_on/linux --include log/linux

View File

@ -0,0 +1,3 @@
# local variable for run-tool arguments used for running scenarios in Qemu
QEMU_RUN_OPT := --include power_on/qemu --include log/qemu

View File

@ -0,0 +1,3 @@
# local variable for run-tool arguments used for running scenarios in Qemu
QEMU_RUN_OPT := --include power_on/qemu --include log/qemu --include image/iso

View File

@ -1 +0,0 @@

View File

@ -1,7 +0,0 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-fiasco
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/fiasco \
--include power_on/qemu --include log/qemu --include image/iso

View File

@ -1,8 +0,0 @@
##
## Repositories needed for the default demo scenario
##
REPOSITORIES += $(GENODE_DIR)/repos/base
REPOSITORIES += $(GENODE_DIR)/repos/os
REPOSITORIES += $(GENODE_DIR)/repos/demo

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,8 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw \
--include power_on/qemu --include log/qemu

View File

@ -1,9 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw \
--include power_on/spike --include log/spike

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,7 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw

View File

@ -1,9 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw \
--include power_on/qemu --include log/qemu --include image/iso

View File

@ -1,13 +0,0 @@
REPOSITORIES += $(GENODE_DIR)/repos/base-hw
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/hw
## Set RUN_OPT to exectute this on Qemu
RUN_OPT += --include power_on/qemu --include log/qemu
## Set RUN_OPT to execute this on actual hardware.
#RUN_OPT += --include image/uboot

View File

@ -1,8 +0,0 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-linux
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/linux \
--include power_on/linux --include log/linux

View File

@ -1,13 +0,0 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-nova
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/nova \
--include power_on/qemu --include log/qemu --include image/iso
#
# The current NOVA kernel build is optimized for Intel Core2 Duo.
#
QEMU_OPT += -cpu core2duo

View File

@ -1,13 +0,0 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-nova
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/nova \
--include power_on/qemu --include log/qemu --include image/iso
#
# The current NOVA kernel build is optimized for Intel Core2 Duo.
#
QEMU_OPT += -cpu core2duo

View File

@ -1,8 +0,0 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-okl4
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/okl4 \
--include power_on/qemu --include log/qemu --include image/iso

View File

@ -1,8 +0,0 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-pistachio
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/pistachio \
--include power_on/qemu --include log/qemu --include image/iso

View File

@ -1,5 +0,0 @@
#
# Software ported specifically for Fiasco.OC, i.e., L4Linux
#
#REPOSITORIES += $(GENODE_DIR)/repos/ports-foc

View File

@ -1,10 +0,0 @@
#
# Prevent Qemu from using KVM
#
# Qemu version that come with major Linux distributions (i.e., Ubuntu) enable
# KVM by default. To use Qemu without KVM, Qemu must be started with the
# '-no-kvm' argument. However, if your Qemu version does not support this
# argument, comment-out this line.
#
QEMU_OPT += -no-kvm

View File

@ -1,7 +0,0 @@
REPOSITORIES = $(GENODE_DIR)/repos/base-sel4
##
## Kernel-specific run tool configuration
##
RUN_OPT = --include boot_dir/sel4 \
--include power_on/qemu --include log/qemu --include image/iso

View File

@ -19,35 +19,53 @@ usage:
@echo " create_builddir <platform> [BUILD_DIR=<build-dir>]"
@echo
@echo " <platform> can be:"
@echo " 'linux_x86'"
@echo " 'linux_arm'"
@echo " 'fiasco_x86'"
@echo " 'pistachio_x86'"
@echo " 'okl4_x86'"
@echo " 'nova_x86_32'"
@echo " 'nova_x86_64'"
@echo " 'hw_panda'"
@echo " 'hw_pbxa9'"
@echo " 'hw_imx53_qsb'"
@echo " 'hw_imx53_qsb_tz'"
@echo " 'hw_usb_armory'"
@echo " 'hw_wand_quad'"
@echo " 'hw_arndale'"
@echo " 'hw_odroid_xu'"
@echo " 'hw_rpi'"
@echo " 'hw_zynq'"
@echo " 'hw_x86_64'"
@echo " 'hw_x86_64_muen'"
@echo " 'hw_riscv'"
@echo " 'foc_x86_32'"
@echo " 'foc_x86_64'"
@echo " 'foc_pbxa9'"
@echo " 'foc_imx53'"
@echo " 'foc_panda'"
@echo " 'foc_arndale'"
@echo " 'foc_rpi'"
@echo " 'foc_odroid_x2'"
@echo " 'sel4_x86_32'"
@echo " 'x86_32'"
@echo " 'x86_64'"
@echo " 'panda'"
@echo " 'pbxa9'"
@echo " 'rpi'"
@echo " 'arndale'"
@echo " 'imx53_qsb'"
@echo " 'imx53_qsb_tz'"
@echo " 'usb_armory'"
@echo " 'wand_quad'"
@echo " 'odroid_xu'"
@echo " 'odroid_x2'"
@echo " 'zynq'"
@echo " 'muen'"
@echo " 'riscv_spike'"
@echo " 'linux'"
@echo
@echo " the following <platform> arguments are deprecated:"
@echo " 'linux_x86' (use 'linux')"
@echo " 'linux_arm' (use 'linux')"
@echo " 'fiasco_x86' (use 'x86_32')"
@echo " 'okl4_x86' (use 'x86_32')"
@echo " 'pistachio_x86' (use 'x86_32')"
@echo " 'nova_x86_32' (use 'x86_32')"
@echo " 'nova_x86_64' (use 'x86_64')"
@echo " 'hw_x86_64' (use 'x86_64')"
@echo " 'foc_x86_32' (use 'x86_32')"
@echo " 'foc_x86_64' (use 'x86_64')"
@echo " 'sel4_x86_32' (use 'x86_32')"
@echo " 'hw_panda' (use 'panda')"
@echo " 'foc_panda' (use 'panda')"
@echo " 'hw_pbxa9' (use 'pbxa9')"
@echo " 'foc_pbxa9' (use 'pbxa9')"
@echo " 'hw_rpi' (use 'rpi')"
@echo " 'foc_rpi' (use 'rpi')"
@echo " 'hw_arndale' (use 'arndale')"
@echo " 'foc_arndale' (use 'arndale')"
@echo " 'hw_imx53_qsb' (use 'imx53_qsb')"
@echo " 'foc_imx53' (use 'imx53_qsb')"
@echo " 'hw_imx53_qsb_tz' (use 'imx53_qsb_tz')"
@echo " 'hw_usb_armory' (use 'usb_armory')"
@echo " 'hw_wand_quad' (use 'wand_quad')"
@echo " 'hw_odroid_xu' (use 'odroid_xu')"
@echo " 'hw_zynq' (use 'zynq')"
@echo " 'hw_x86_64_muen' (use 'muen')"
@echo " 'hw_riscv' (use 'riscv_spike')"
@echo " 'foc_odroid_x2' (use 'odroid_x2')"
@echo
@echo " The definition of BUILD_DIR is optional. If specified,"
@echo " <build-dir> is the location of the build directory to create."
@ -94,183 +112,152 @@ else
CONTRIB_ABS_DIR := $(abspath $(shell echo $(CONTRIB_DIR)))
endif
#
# Generic build-directory preparation rules
#
BUILD_CONF = $(GENODE_ABS_DIR)/tool/builddir/etc/build.conf
BUILD_CONF_PLATFORM = $(BUILD_CONF).$(PLATFORM)
$(BUILD_DIR)/etc:
@mkdir -p $@
$(BUILD_DIR)/etc/build.conf:: $(BUILD_CONF_PLATFORM)
@echo "GENODE_DIR = $(GENODE_ABS_DIR)" > $@
@echo 'BASE_DIR = $$(GENODE_DIR)/repos/base' >> $@
@echo 'CONTRIB_DIR = $(CONTRIB_ABS_DIR)' >> $@
BUILD_CONF_X86_32 := run_qemu_iso run_opt_x86_32 run_boot_dir qemu_opt_x86 repos repos_x86
BUILD_CONF_X86_64 := run_qemu_iso run_opt_x86_64 run_boot_dir qemu_opt_x86 repos repos_x86
BUILD_CONF_PBXA9 := run_qemu run_opt_arm_hw_foc run_boot_dir qemu_opt_arm repos
#
# Supply -no-kvm argument to Qemu for kernels that are incompatible with KVM
#
ifeq ($(filter-out foc_x86_32 foc_x86_64 okl4_x86 nova_x86_32 nova_x86_64 pistachio_x86,$(PLATFORM)),)
$(BUILD_DIR)/etc/build.conf::
@cat $(BUILD_CONF).qemu_no_kvm >> $@
endif
BUILD_CONF(x86_32) := run_kernel_x86_32 $(BUILD_CONF_X86_32)
BUILD_CONF(x86_64) := run_kernel_x86_64 $(BUILD_CONF_X86_64)
BUILD_CONF(pbxa9) := run_kernel_hw_foc $(BUILD_CONF_PBXA9)
BUILD_CONF(panda) := run_kernel_hw_foc run_boot_dir repos
BUILD_CONF(rpi) := run_kernel_hw_foc run_boot_dir repos
BUILD_CONF(arndale) := run_kernel_hw_foc run_boot_dir repos
BUILD_CONF(imx53_qsb) := run_kernel_hw_foc run_boot_dir repos
BUILD_CONF(imx53_qsb_tz) := run_kernel_hw run_boot_dir repos
BUILD_CONF(usb_armory) := run_kernel_hw run_boot_dir repos
BUILD_CONF(wand_quad) := run_kernel_hw run_boot_dir repos
BUILD_CONF(odroid_xu) := run_kernel_hw run_boot_dir repos
BUILD_CONF(odroid_x2) := run_kernel_foc run_boot_dir repos
BUILD_CONF(zynq) := run_kernel_hw run_qemu run_opt_hw run_boot_dir qemu_opt_arm repos
BUILD_CONF(muen) := run_kernel_hw run_opt_muen run_boot_dir repos
BUILD_CONF(riscv_spike) := run_kernel_hw run_opt_spike run_boot_dir repos
BUILD_CONF(linux) := run_kernel_linux repos
#
# Add 'base-<platform>' and generic repositories
#
$(BUILD_DIR)/etc/build.conf:: $(BUILD_CONF_PLATFORM)
# deprecated platforms, to be removed
BUILD_CONF(linux_x86) := run_kernel_linux repos
BUILD_CONF(linux_arm) := run_kernel_linux repos
BUILD_CONF(fiasco_x86) := run_kernel_fiasco $(BUILD_CONF_X86_32)
BUILD_CONF(okl4_x86) := run_kernel_okl4 $(BUILD_CONF_X86_32)
BUILD_CONF(pistachio_x86) := run_kernel_pistachio $(BUILD_CONF_X86_32)
BUILD_CONF(nova_x86_32) := run_kernel_nova $(BUILD_CONF_X86_32)
BUILD_CONF(nova_x86_64) := run_kernel_nova $(BUILD_CONF_X86_64)
BUILD_CONF(hw_x86_64) := run_kernel_hw $(BUILD_CONF_X86_64)
BUILD_CONF(foc_x86_32) := run_kernel_foc $(BUILD_CONF_X86_32)
BUILD_CONF(foc_x86_64) := run_kernel_foc $(BUILD_CONF_X86_64)
BUILD_CONF(sel4_x86_32) := run_kernel_sel4 $(BUILD_CONF_X86_32)
BUILD_CONF(hw_panda) := ${BUILD_CONF(panda)}
BUILD_CONF(foc_panda) := run_kernel_foc run_boot_dir repos
BUILD_CONF(hw_pbxa9) := ${BUILD_CONF(pbxa9)}
BUILD_CONF(foc_pbxa9) := run_kernel_foc $(BUILD_CONF_PBXA9)
BUILD_CONF(hw_rpi) := ${BUILD_CONF(rpi)}
BUILD_CONF(foc_rpi) := run_kernel_foc run_boot_dir repos
BUILD_CONF(hw_arndale) := ${BUILD_CONF(arndale)}
BUILD_CONF(foc_arndale) := run_kernel_foc run_boot_dir repos
BUILD_CONF(hw_imx53_qsb) := ${BUILD_CONF(imx53_qsb)}
BUILD_CONF(foc_imx53) := run_kernel_foc run_boot_dir repos
BUILD_CONF(hw_imx53_qsb_tz) := ${BUILD_CONF(imx53_qsb_tz)}
BUILD_CONF(hw_usb_armory) := ${BUILD_CONF(usb_armory)}
BUILD_CONF(hw_wand_quad) := ${BUILD_CONF(wand_quad)}
BUILD_CONF(hw_odroid_xu) := ${BUILD_CONF(odroid_xu)}
BUILD_CONF(hw_zynq) := ${BUILD_CONF(zynq)}
BUILD_CONF(hw_x86_64_muen) := ${BUILD_CONF(muen)}
BUILD_CONF(hw_riscv) := ${BUILD_CONF(riscv_spike)}
BUILD_CONF(foc_odroid_x2) := ${BUILD_CONF(odroid_x2)}
message: $(BUILD_DIR)/etc/build.conf
$(BUILD_DIR)/etc/build.conf:
@echo "GENODE_DIR := $(GENODE_ABS_DIR)" > $@
@echo 'BASE_DIR := $$(GENODE_DIR)/repos/base' >> $@
@echo 'CONTRIB_DIR := $(CONTRIB_ABS_DIR)' >> $@
@echo >> $@
@echo "##" >> $@
@echo "## Kernel-specific base repository" >> $@
@echo "##" >> $@
@echo >> $@
@cat $< >> $@
@cat $(BUILD_CONF).generic >> $@
#
# Add optional repositories for all platforms
#
# Those repositories rely on Genode's libc or contain device drivers.
# Both prerequisites are not available for hybrid Linux/Genode programs.
#
$(BUILD_DIR)/etc/build.conf::
@cat $(BUILD_CONF).optional >> $@
@for i in make_j run; do \
cat $(GENODE_DIR)/tool/builddir/build.conf/$$i; done >> $@
@for i in ${BUILD_CONF(${PLATFORM})}; do \
cat $(GENODE_DIR)/tool/builddir/build.conf/$$i; done >> $@
message: $(BUILD_DIR)/Makefile
$(BUILD_DIR)/Makefile:
@ln -sf $(GENODE_ABS_DIR)/tool/builddir/build.mk $@
$(BUILD_DIR)/etc/build.conf: $(BUILD_DIR)/etc
$(BUILD_DIR)/etc/specs.conf: $(BUILD_DIR)/etc
#
# Add 'ports-foc' repository to Fiasco.OC build directory
# Detect host CPU architecture (needed for creating Linux build directory that
# matches the host system)
#
ifeq ($(filter-out foc_x86_32 foc_imx53 foc_pbxa9 foc_panda foc_arndale foc_rpi foc_odroid_x2,$(PLATFORM)),)
$(BUILD_DIR)/etc/build.conf::
@cat $(BUILD_CONF).ports-foc >> $@
UNAME_MACHINE := $(shell uname -m)
SPEC_ARCH(i686) := x86_32
SPEC_ARCH(x86_64) := x86_64
SPEC_ARCH(armv6l) := armv_v6
SPEC_ARCH(armv7l) := armv_v7
HOST_SPEC_ARCH := ${SPEC_ARCH(${UNAME_MACHINE})}
#
# SPECS definitions
#
SPECS(x86_32) := x86_32
SPECS(x86_64) := x86_64
SPECS(pbxa9) := pbxa9
SPECS(panda) := panda
SPECS(rpi) := rpi
SPECS(arndale) := arndale
SPECS(imx53_qsb) := imx53_qsb
SPECS(imx53_qsb_tz) := imx53_qsb_tz
SPECS(usb_armory) := hw_usb_armory usb_armory
SPECS(wand_quad) := hw_wand_quad wand_quad
SPECS(odroid_xu) := hw_odroid_xu odroid_xu
SPECS(odroid_x2) := foc_odroid_x2 odroid_x2
SPECS(zynq_qemu) := hw_zynq zynq_qemu
SPECS(muen) := hw_x86_64_muen muen x86_64
SPECS(riscv_spike) := hw_riscv riscv
SPECS(linux) := $(HOST_SPEC_ARCH)
# deprecated platforms
SPECS(linux_x86) := $(HOST_SPEC_ARCH)
SPECS(linux_arm) := $(HOST_SPEC_ARCH)
SPECS(fiasco_x86) :=
SPECS(okl4_x86) :=
SPECS(pistachio_x86) :=
SPECS(nova_x86_32) := nova_x86_32 x86_32 acpi
SPECS(nova_x86_64) := nova_x86_64 x86_64 acpi
SPECS(hw_x86_64) := hw_x86_64 x86_64 acpi
SPECS(foc_x86_32) := foc_x86_32 x86_32 acpi
SPECS(foc_x86_64) := foc_x86_64 x86_64 acpi
SPECS(sel4_x86_32) := sel4_x86_32 x86_32 acpi
SPECS(hw_panda) := hw_panda panda perf_counter
SPECS(foc_panda) := foc_panda panda
SPECS(hw_pbxa9) := hw_pbxa9 pbxa9 perf_counter
SPECS(foc_pbxa9) := foc_pbxa9 pbxa9
SPECS(hw_rpi) := hw_rpi rpi perf_counter
SPECS(foc_rpi) := foc_rpi rpi
SPECS(hw_arndale) := hw_arndale arndale perf_counter
SPECS(foc_arndale) := foc_arndale arndale
SPECS(hw_imx53_qsb) := hw_imx53_qsb imx53_qsb perf_counter
SPECS(foc_imx53) := foc_imx53 imx53_qsb
SPECS(hw_imx53_qsb_tz) := hw_imx53_qsb_tz imx53_qsb_tz perf_counter
SPECS(hw_usb_armory) := hw_usb_armory usb_armory perf_counter
SPECS(hw_wand_quad) := hw_wand_quad wand_quad perf_counter
SPECS(hw_odroid_xu) := hw_odroid_xu odroid_xu perf_counter
SPECS(hw_zynq) := hw_zynq zynq perf_counter zynq_qemu
SPECS(hw_x86_64_muen) := hw_x86_64_muen x86_64 muen
SPECS(hw_riscv) := hw_riscv riscv
SPECS(foc_odroid_x2) := foc_odroid_x2 odroid_x2
ifneq (${SPECS(${PLATFORM})},)
message: $(BUILD_DIR)/etc/specs.conf
$(BUILD_DIR)/etc/specs.conf:
@echo "SPECS += ${SPECS(${PLATFORM})}" > $@
endif
#
# Add x86 drivers repositories to x86 build directories
#
ifeq ($(filter-out foc_x86_32 foc_x86_64 okl4_x86 nova_x86_32 nova_x86_64 pistachio_x86 fiasco_x86 hw_x86_64 hw_x86_64_muen sel4_x86_32,$(PLATFORM)),)
$(BUILD_DIR)/etc/build.conf::
@cat $(BUILD_CONF).drivers_x86 >> $@
endif
#
# Add ARM drivers repositories to ARM build directories
#
ifeq ($(filter-out foc_panda foc_arndale hw_panda hw_arndale hw_odroid_xu foc_imx53 foc_rpi foc_odroid_x2,$(PLATFORM)),)
$(BUILD_DIR)/etc/build.conf::
@cat $(BUILD_CONF).drivers_arm >> $@
endif
#
# Generic platform dependencies
#
$(PLATFORM):: $(BUILD_DIR)/etc
$(PLATFORM):: $(BUILD_DIR)/etc/build.conf
$(PLATFORM):: $(BUILD_DIR)/Makefile
#
# Platform-specific dependencies
#
foc_x86_32::
@echo "SPECS = genode foc_x86_32" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
foc_x86_64::
@echo "SPECS = genode foc_x86_64" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
nova_x86_32::
@echo "SPECS = genode nova_x86_32" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
nova_x86_64::
@echo "SPECS = genode nova_x86_64" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
sel4_x86_32::
@echo "SPECS = genode sel4_x86_32" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
foc_pbxa9::
@echo "SPECS = genode foc_pbxa9" > $(BUILD_DIR)/etc/specs.conf
foc_panda::
@echo "SPECS = genode foc_panda" > $(BUILD_DIR)/etc/specs.conf
foc_imx53::
@echo "SPECS = genode foc_imx53" > $(BUILD_DIR)/etc/specs.conf
foc_arndale::
@echo "SPECS = genode foc_arndale" > $(BUILD_DIR)/etc/specs.conf
foc_rpi::
@echo "SPECS = genode foc_rpi" > $(BUILD_DIR)/etc/specs.conf
foc_odroid_x2::
@echo "SPECS = genode foc_odroid_x2" > $(BUILD_DIR)/etc/specs.conf
#
# On all other platforms, the performance counter is assumed to be active by
# default. On HW, its activation is done by an optional core lib. To be
# conform to the other platforms, opt it in by default and, e.g. for security
# reasons, allow users to opt it out.
#
hw_pbxa9::
@echo "SPECS = genode hw_pbxa9" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_panda::
@echo "SPECS = genode hw_panda" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_imx53_qsb::
@echo "SPECS = genode hw_imx53_qsb" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_imx53_qsb_tz::
@echo "SPECS = genode hw_imx53_qsb_tz" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_usb_armory::
@echo "SPECS = genode hw_usb_armory" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_wand_quad::
@echo "SPECS = genode hw_wand_quad" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_arndale::
@echo "SPECS = genode hw_arndale" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_rpi::
@echo "SPECS = genode hw_rpi" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_zynq::
@echo "SPECS = genode hw_zynq" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
@echo "## By default, hw_zynq is executed on Qemu" >> $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += zynq_qemu" >> $(BUILD_DIR)/etc/specs.conf
hw_odroid_xu::
@echo "SPECS = genode hw_odroid_xu" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
hw_x86_64::
@echo "SPECS = genode hw_x86_64" > $(BUILD_DIR)/etc/specs.conf
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
hw_x86_64_muen::
@echo "SPECS = genode hw_x86_64_muen" > $(BUILD_DIR)/etc/specs.conf
hw_riscv::
@echo "SPECS = genode hw_riscv" > $(BUILD_DIR)/etc/specs.conf
$(PLATFORM)::
$(PLATFORM): message
message:
@echo "Successfully created build directory at $(BUILD_DIR)."
@echo "Please adjust $(BUILD_DIR)/etc/build.conf according to your needs."