2011-12-22 15:19:25 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
|
|
|
|
#
|
|
|
|
# \brief Prepare Genode build directory
|
|
|
|
# \author Christian Helmuth, Norman Feske
|
|
|
|
# \date 2008-08-14
|
|
|
|
#
|
|
|
|
|
|
|
|
MAKEOVERRIDES =
|
|
|
|
|
|
|
|
PLATFORM = $(MAKECMDGOALS)
|
|
|
|
|
|
|
|
usage:
|
|
|
|
@echo
|
|
|
|
@echo "Tool for preparing Genode build directories"
|
|
|
|
@echo
|
|
|
|
@echo "usage:"
|
|
|
|
@echo
|
2014-05-07 09:48:19 +00:00
|
|
|
@echo " create_builddir <platform> [BUILD_DIR=<build-dir>]"
|
2011-12-22 15:19:25 +00:00
|
|
|
@echo
|
2012-05-22 14:36:56 +00:00
|
|
|
@echo " <platform> can be:"
|
|
|
|
@echo " 'linux_x86'"
|
2013-05-24 09:04:42 +00:00
|
|
|
@echo " 'linux_arm'"
|
2012-05-22 14:36:56 +00:00
|
|
|
@echo " 'fiasco_x86'"
|
|
|
|
@echo " 'pistachio_x86'"
|
|
|
|
@echo " 'okl4_x86'"
|
2012-06-06 08:19:48 +00:00
|
|
|
@echo " 'nova_x86_32'"
|
|
|
|
@echo " 'nova_x86_64'"
|
2012-11-20 14:38:32 +00:00
|
|
|
@echo " 'hw_panda'"
|
2012-05-29 09:26:37 +00:00
|
|
|
@echo " 'hw_pbxa9'"
|
2015-02-24 15:31:50 +00:00
|
|
|
@echo " 'hw_imx53_qsb'"
|
|
|
|
@echo " 'hw_imx53_qsb_tz'"
|
|
|
|
@echo " 'hw_usb_armory'"
|
2015-03-25 18:30:37 +00:00
|
|
|
@echo " 'hw_wand_quad'"
|
2013-01-25 13:24:41 +00:00
|
|
|
@echo " 'hw_arndale'"
|
2013-12-03 10:10:13 +00:00
|
|
|
@echo " 'hw_odroid_xu'"
|
2013-04-08 17:05:44 +00:00
|
|
|
@echo " 'hw_rpi'"
|
2015-09-02 11:59:31 +00:00
|
|
|
@echo " 'hw_zynq'"
|
2015-02-06 16:27:44 +00:00
|
|
|
@echo " 'hw_x86_64'"
|
2015-04-14 09:26:19 +00:00
|
|
|
@echo " 'hw_x86_64_muen'"
|
2016-02-11 10:37:17 +00:00
|
|
|
@echo " 'hw_riscv'"
|
2012-05-22 14:36:56 +00:00
|
|
|
@echo " 'foc_x86_32'"
|
|
|
|
@echo " 'foc_x86_64'"
|
|
|
|
@echo " 'foc_pbxa9'"
|
2012-10-17 07:34:23 +00:00
|
|
|
@echo " 'foc_imx53'"
|
2012-05-22 14:36:56 +00:00
|
|
|
@echo " 'foc_panda'"
|
2013-01-22 18:20:30 +00:00
|
|
|
@echo " 'foc_arndale'"
|
2015-06-21 14:53:54 +00:00
|
|
|
@echo " 'foc_rpi'"
|
2015-04-28 12:04:37 +00:00
|
|
|
@echo " 'foc_odroid_x2'"
|
2015-05-17 20:35:04 +00:00
|
|
|
@echo " 'sel4_x86_32'"
|
2011-12-23 13:04:29 +00:00
|
|
|
@echo
|
2014-05-07 09:48:19 +00:00
|
|
|
@echo " The definition of BUILD_DIR is optional. If specified,"
|
|
|
|
@echo " <build-dir> is the location of the build directory to create."
|
|
|
|
@echo " If not specified, the build directory will be created at"
|
|
|
|
@echo " <genode-dir>/build/<platform>."
|
2011-12-22 15:19:25 +00:00
|
|
|
@echo
|
|
|
|
|
|
|
|
#
|
|
|
|
# Determine Genode base directory based on the known location of the
|
|
|
|
# 'create_builddir' tool within the Genode source tree
|
|
|
|
#
|
|
|
|
GENODE_DIR ?= $(realpath $(dir $(MAKEFILE_LIST))/..)
|
|
|
|
|
2014-05-07 09:48:19 +00:00
|
|
|
#
|
|
|
|
# Define default location of the build directory if not explicitly specified
|
|
|
|
#
|
|
|
|
BUILD_DIR ?= $(GENODE_DIR)/build/$(PLATFORM)
|
|
|
|
|
2014-05-08 14:42:38 +00:00
|
|
|
SHELL := bash
|
|
|
|
|
2014-05-07 09:48:19 +00:00
|
|
|
ifneq ($(wildcard $(BUILD_DIR)),)
|
|
|
|
$(PLATFORM):: build_dir_already_exists
|
|
|
|
build_dir_already_exists:
|
|
|
|
@echo "Directory $(BUILD_DIR) already exists."
|
|
|
|
@false
|
2011-12-22 15:19:25 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Convert GENODE_DIR to an absolute directory because the user
|
|
|
|
# may have specified a '~'-relative location or a pwd-relative
|
|
|
|
# location.
|
|
|
|
#
|
|
|
|
GENODE_ABS_DIR := $(realpath $(shell echo $(GENODE_DIR)))
|
|
|
|
|
2014-05-08 14:42:38 +00:00
|
|
|
#
|
|
|
|
# Define absolute path to the contrib directory as written to the
|
|
|
|
# 'etc/build.conf' file. We use 'abs_path' instead of 'realpath' because the
|
|
|
|
# contrib directory may not exist when the build directory is created. In this
|
|
|
|
# case, 'realpath' would return an empty string.
|
|
|
|
#
|
|
|
|
ifeq ($(CONTRIB_DIR),)
|
|
|
|
CONTRIB_ABS_DIR := $$(GENODE_DIR)/contrib
|
|
|
|
else
|
|
|
|
CONTRIB_ABS_DIR := $(abspath $(shell echo $(CONTRIB_DIR)))
|
|
|
|
endif
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# 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 $@
|
|
|
|
|
2013-05-14 09:03:35 +00:00
|
|
|
$(BUILD_DIR)/etc/build.conf:: $(BUILD_CONF_PLATFORM)
|
2011-12-22 15:19:25 +00:00
|
|
|
@echo "GENODE_DIR = $(GENODE_ABS_DIR)" > $@
|
2014-05-07 09:48:19 +00:00
|
|
|
@echo 'BASE_DIR = $$(GENODE_DIR)/repos/base' >> $@
|
2014-05-08 14:42:38 +00:00
|
|
|
@echo 'CONTRIB_DIR = $(CONTRIB_ABS_DIR)' >> $@
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Supply -no-kvm argument to Qemu for kernels that are incompatible with KVM
|
|
|
|
#
|
2012-06-06 08:19:48 +00:00
|
|
|
ifeq ($(filter-out foc_x86_32 foc_x86_64 okl4_x86 nova_x86_32 nova_x86_64 pistachio_x86,$(PLATFORM)),)
|
2011-12-22 15:19:25 +00:00
|
|
|
$(BUILD_DIR)/etc/build.conf::
|
|
|
|
@cat $(BUILD_CONF).qemu_no_kvm >> $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Add 'base-<platform>' and generic repositories
|
|
|
|
#
|
|
|
|
$(BUILD_DIR)/etc/build.conf:: $(BUILD_CONF_PLATFORM)
|
|
|
|
@echo >> $@
|
|
|
|
@echo "##" >> $@
|
|
|
|
@echo "## Kernel-specific base repository" >> $@
|
|
|
|
@echo "##" >> $@
|
|
|
|
@echo >> $@
|
|
|
|
@cat $< >> $@
|
|
|
|
@cat $(BUILD_CONF).generic >> $@
|
|
|
|
|
2011-12-23 13:04:29 +00:00
|
|
|
#
|
2015-08-31 14:33:05 +00:00
|
|
|
# Add optional repositories for all platforms
|
2011-12-23 13:04:29 +00:00
|
|
|
#
|
|
|
|
# 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 >> $@
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
$(BUILD_DIR)/Makefile:
|
|
|
|
@ln -sf $(GENODE_ABS_DIR)/tool/builddir/build.mk $@
|
|
|
|
|
|
|
|
#
|
|
|
|
# Add 'ports-foc' repository to Fiasco.OC build directory
|
|
|
|
#
|
2015-04-28 12:04:37 +00:00
|
|
|
ifeq ($(filter-out foc_x86_32 foc_imx53 foc_pbxa9 foc_panda foc_arndale foc_rpi foc_odroid_x2,$(PLATFORM)),)
|
2011-12-22 15:19:25 +00:00
|
|
|
$(BUILD_DIR)/etc/build.conf::
|
|
|
|
@cat $(BUILD_CONF).ports-foc >> $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Add x86 drivers repositories to x86 build directories
|
|
|
|
#
|
2015-04-14 09:26:19 +00:00
|
|
|
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)),)
|
2011-12-22 15:19:25 +00:00
|
|
|
$(BUILD_DIR)/etc/build.conf::
|
|
|
|
@cat $(BUILD_CONF).drivers_x86 >> $@
|
|
|
|
endif
|
|
|
|
|
2012-06-20 22:32:16 +00:00
|
|
|
#
|
|
|
|
# Add ARM drivers repositories to ARM build directories
|
|
|
|
#
|
2015-04-28 12:04:37 +00:00
|
|
|
ifeq ($(filter-out foc_panda foc_arndale hw_panda hw_arndale hw_odroid_xu foc_imx53 foc_rpi foc_odroid_x2,$(PLATFORM)),)
|
2012-06-20 22:32:16 +00:00
|
|
|
$(BUILD_DIR)/etc/build.conf::
|
|
|
|
@cat $(BUILD_CONF).drivers_arm >> $@
|
|
|
|
endif
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# Generic platform dependencies
|
|
|
|
#
|
|
|
|
$(PLATFORM):: $(BUILD_DIR)/etc
|
|
|
|
$(PLATFORM):: $(BUILD_DIR)/etc/build.conf
|
|
|
|
$(PLATFORM):: $(BUILD_DIR)/Makefile
|
|
|
|
|
|
|
|
#
|
|
|
|
# Platform-specific dependencies
|
|
|
|
#
|
|
|
|
foc_x86_32::
|
2013-01-10 22:04:22 +00:00
|
|
|
@echo "SPECS = genode foc_x86_32" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
foc_x86_64::
|
|
|
|
@echo "SPECS = genode foc_x86_64" > $(BUILD_DIR)/etc/specs.conf
|
2013-04-17 14:09:58 +00:00
|
|
|
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2012-06-06 08:19:48 +00:00
|
|
|
nova_x86_32::
|
2013-01-10 22:04:22 +00:00
|
|
|
@echo "SPECS = genode nova_x86_32" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
|
2012-06-06 08:19:48 +00:00
|
|
|
|
|
|
|
nova_x86_64::
|
2013-01-10 22:04:22 +00:00
|
|
|
@echo "SPECS = genode nova_x86_64" > $(BUILD_DIR)/etc/specs.conf
|
2013-04-17 14:09:58 +00:00
|
|
|
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
|
2012-06-06 08:19:48 +00:00
|
|
|
|
2015-05-17 20:35:04 +00:00
|
|
|
sel4_x86_32::
|
|
|
|
@echo "SPECS = genode sel4_x86_32" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
foc_pbxa9::
|
|
|
|
@echo "SPECS = genode foc_pbxa9" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2012-05-22 14:36:56 +00:00
|
|
|
foc_panda::
|
|
|
|
@echo "SPECS = genode foc_panda" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2012-10-17 07:34:23 +00:00
|
|
|
foc_imx53::
|
|
|
|
@echo "SPECS = genode foc_imx53" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2013-01-22 18:20:30 +00:00
|
|
|
foc_arndale::
|
|
|
|
@echo "SPECS = genode foc_arndale" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2015-06-21 14:53:54 +00:00
|
|
|
foc_rpi::
|
|
|
|
@echo "SPECS = genode foc_rpi" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2015-04-28 12:04:37 +00:00
|
|
|
foc_odroid_x2::
|
|
|
|
@echo "SPECS = genode foc_odroid_x2" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2015-02-10 14:19:04 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2012-05-29 09:26:37 +00:00
|
|
|
hw_pbxa9::
|
|
|
|
@echo "SPECS = genode hw_pbxa9" > $(BUILD_DIR)/etc/specs.conf
|
2015-02-10 14:19:04 +00:00
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
2012-05-29 09:26:37 +00:00
|
|
|
|
2012-11-20 14:38:32 +00:00
|
|
|
hw_panda::
|
|
|
|
@echo "SPECS = genode hw_panda" > $(BUILD_DIR)/etc/specs.conf
|
2015-02-10 14:19:04 +00:00
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
2012-05-29 09:26:37 +00:00
|
|
|
|
2015-02-24 15:31:50 +00:00
|
|
|
hw_imx53_qsb::
|
|
|
|
@echo "SPECS = genode hw_imx53_qsb" > $(BUILD_DIR)/etc/specs.conf
|
2015-02-10 14:19:04 +00:00
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
2012-12-14 13:55:37 +00:00
|
|
|
|
2015-02-24 15:31:50 +00:00
|
|
|
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
|
2015-02-10 14:19:04 +00:00
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
2014-07-01 10:20:02 +00:00
|
|
|
|
2015-03-25 18:30:37 +00:00
|
|
|
hw_wand_quad::
|
|
|
|
@echo "SPECS = genode hw_wand_quad" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2013-01-25 13:24:41 +00:00
|
|
|
hw_arndale::
|
|
|
|
@echo "SPECS = genode hw_arndale" > $(BUILD_DIR)/etc/specs.conf
|
2015-02-10 14:19:04 +00:00
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
2013-01-25 13:24:41 +00:00
|
|
|
|
2013-04-08 17:05:44 +00:00
|
|
|
hw_rpi::
|
|
|
|
@echo "SPECS = genode hw_rpi" > $(BUILD_DIR)/etc/specs.conf
|
2015-02-10 14:19:04 +00:00
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
2013-04-08 17:05:44 +00:00
|
|
|
|
2015-09-02 11:59:31 +00:00
|
|
|
hw_zynq::
|
|
|
|
@echo "SPECS = genode hw_zynq" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2013-12-03 10:10:13 +00:00
|
|
|
hw_odroid_xu::
|
|
|
|
@echo "SPECS = genode hw_odroid_xu" > $(BUILD_DIR)/etc/specs.conf
|
2015-02-10 14:19:04 +00:00
|
|
|
@echo "SPECS += perf_counter" >> $(BUILD_DIR)/etc/specs.conf
|
2013-12-03 10:10:13 +00:00
|
|
|
|
2015-02-06 16:27:44 +00:00
|
|
|
hw_x86_64::
|
|
|
|
@echo "SPECS = genode hw_x86_64" > $(BUILD_DIR)/etc/specs.conf
|
2015-05-15 08:54:14 +00:00
|
|
|
@echo "SPECS += acpi" >> $(BUILD_DIR)/etc/specs.conf
|
2015-02-06 16:27:44 +00:00
|
|
|
|
2015-04-14 09:26:19 +00:00
|
|
|
hw_x86_64_muen::
|
|
|
|
@echo "SPECS = genode hw_x86_64_muen" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2016-02-11 10:37:17 +00:00
|
|
|
hw_riscv::
|
|
|
|
@echo "SPECS = genode hw_riscv" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
$(PLATFORM)::
|
2014-05-07 09:48:19 +00:00
|
|
|
@echo "Successfully created build directory at $(BUILD_DIR)."
|
|
|
|
@echo "Please adjust $(BUILD_DIR)/etc/build.conf according to your needs."
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
.PHONY: $(PLATFORM)
|