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
|
|
|
|
@echo " create_builddir <platform> BUILD_DIR=<build-dir>"
|
|
|
|
@echo
|
2012-05-22 14:36:56 +00:00
|
|
|
@echo " <platform> can be:"
|
|
|
|
@echo " 'linux_x86'"
|
|
|
|
@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-05-22 14:36:56 +00:00
|
|
|
@echo " 'codezero_vpb926'"
|
2012-11-20 14:38:32 +00:00
|
|
|
@echo " 'hw_panda'"
|
2012-05-29 09:26:37 +00:00
|
|
|
@echo " 'hw_vea9x4'"
|
|
|
|
@echo " 'hw_pbxa9'"
|
2012-11-28 16:35:03 +00:00
|
|
|
@echo " 'hw_imx31'"
|
2012-12-14 13:55:37 +00:00
|
|
|
@echo " 'hw_imx53'"
|
2013-01-25 13:24:41 +00:00
|
|
|
@echo " 'hw_arndale'"
|
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_vea9x4'"
|
|
|
|
@echo " 'foc_panda'"
|
2013-01-22 18:20:30 +00:00
|
|
|
@echo " 'foc_arndale'"
|
2012-05-22 14:36:56 +00:00
|
|
|
@echo " 'lx_hybrid_x86'"
|
2011-12-23 13:04:29 +00:00
|
|
|
@echo
|
2011-12-22 15:19:25 +00:00
|
|
|
@echo " <build-dir> is the location of the build directory to create"
|
|
|
|
@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))/..)
|
|
|
|
|
|
|
|
ifeq ($(BUILD_DIR),)
|
|
|
|
$(PLATFORM):: usage
|
|
|
|
@echo "Error: BUILD_DIR not defined." ; false
|
|
|
|
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)))
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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::
|
|
|
|
@echo "GENODE_DIR = $(GENODE_ABS_DIR)" > $@
|
|
|
|
@echo 'BASE_DIR = $$(GENODE_DIR)/base' >> $@
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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
|
|
|
#
|
|
|
|
# Add optional repositories for all platforms except for lx_hybrid
|
|
|
|
#
|
|
|
|
# Those repositories rely on Genode's libc or contain device drivers.
|
|
|
|
# Both prerequisites are not available for hybrid Linux/Genode programs.
|
|
|
|
#
|
|
|
|
ifneq ($(PLATFORM),lx_hybrid_x86)
|
|
|
|
$(BUILD_DIR)/etc/build.conf::
|
|
|
|
@cat $(BUILD_CONF).optional >> $@
|
|
|
|
endif
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# Add 'ports-okl4' repository to OKL4 build directory
|
|
|
|
#
|
|
|
|
ifeq ($(PLATFORM),okl4_x86)
|
|
|
|
$(BUILD_DIR)/etc/build.conf::
|
|
|
|
@cat $(BUILD_CONF).ports-okl4 >> $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(BUILD_DIR)/Makefile:
|
|
|
|
@ln -sf $(GENODE_ABS_DIR)/tool/builddir/build.mk $@
|
|
|
|
|
|
|
|
#
|
|
|
|
# Add 'ports-foc' repository to Fiasco.OC build directory
|
|
|
|
#
|
2012-10-17 07:34:23 +00:00
|
|
|
ifeq ($(filter-out foc_x86_32 foc_imx53 foc_pbxa9 foc_vea9x4 foc_panda,$(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
|
|
|
|
#
|
2012-06-27 08:53:35 +00:00
|
|
|
ifeq ($(filter-out foc_x86_32 foc_x86_64 okl4_x86 nova_x86_32 nova_x86_64 pistachio_x86 fiasco_x86,$(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
|
|
|
|
#
|
2013-01-22 18:20:30 +00:00
|
|
|
ifeq ($(filter-out foc_panda foc_arndale hw_panda foc_imx53,$(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
|
|
|
|
#
|
|
|
|
codezero_vpb926::
|
|
|
|
@echo "SPECS += codezero_platform_vpb926" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
|
|
|
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
|
|
|
|
|
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
|
2012-06-06 08:19:48 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
foc_pbxa9::
|
|
|
|
@echo "SPECS = genode foc_pbxa9" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
|
|
|
foc_vea9x4::
|
|
|
|
@echo "SPECS = genode foc_vea9x4" > $(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
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
codezero_vpb926::
|
|
|
|
@echo "CODEZERO_DIR = $(GENODE_DIR)/base-codezero/contrib" > $(BUILD_DIR)/etc/codezero.conf
|
|
|
|
|
2012-05-29 09:26:37 +00:00
|
|
|
hw_pbxa9::
|
|
|
|
@echo "SPECS = genode hw_pbxa9" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
|
|
|
hw_vea9x4::
|
|
|
|
@echo "SPECS = genode hw_vea9x4" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2012-11-20 14:38:32 +00:00
|
|
|
hw_panda::
|
|
|
|
@echo "SPECS = genode hw_panda" > $(BUILD_DIR)/etc/specs.conf
|
2012-05-29 09:26:37 +00:00
|
|
|
|
2012-11-28 16:35:03 +00:00
|
|
|
hw_imx31::
|
|
|
|
@echo "SPECS = genode hw_imx31" > $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2012-12-14 13:55:37 +00:00
|
|
|
hw_imx53::
|
|
|
|
@echo "SPECS = genode hw_imx53" > $(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
|
|
|
|
|
2011-12-23 13:04:29 +00:00
|
|
|
lx_hybrid_x86::
|
|
|
|
@echo "CROSS_DEV_PREFIX =" > $(BUILD_DIR)/etc/tools.conf
|
|
|
|
@echo "SPECS += always_hybrid" >> $(BUILD_DIR)/etc/specs.conf
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
$(PLATFORM)::
|
|
|
|
@echo "successfully created build directory at $(BUILD_DIR)"
|
|
|
|
|
|
|
|
.PHONY: $(PLATFORM)
|