summaryrefslogtreecommitdiffstats
path: root/configs/platform-mips/rules/barebox-malta.make
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2020-02-16 09:38:21 +0100
committerRobert Schwebel <r.schwebel@pengutronix.de>2020-02-16 11:31:56 +0100
commit521707e129e9d9039b430a201a33d45af143a6d7 (patch)
treef0b1d7cb1aadff978b9775a53d2ce56f1d0aaa31 /configs/platform-mips/rules/barebox-malta.make
parente6d07898c3595d7b4f2b9cad989231cd01f72b0e (diff)
downloadDistroKit-521707e129e9d9039b430a201a33d45af143a6d7.tar.gz
DistroKit-521707e129e9d9039b430a201a33d45af143a6d7.tar.xz
platform-mips: add basic qemu malta support
Currently this platform can build rootfs and run only barebox. Other parts need more work, but even on this stage we would be able to make toolchain and barebox regression tests. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Diffstat (limited to 'configs/platform-mips/rules/barebox-malta.make')
-rw-r--r--configs/platform-mips/rules/barebox-malta.make111
1 files changed, 111 insertions, 0 deletions
diff --git a/configs/platform-mips/rules/barebox-malta.make b/configs/platform-mips/rules/barebox-malta.make
new file mode 100644
index 0000000..b60f163
--- /dev/null
+++ b/configs/platform-mips/rules/barebox-malta.make
@@ -0,0 +1,111 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Robert Schwebel <r.schwebel@pengutronix.de>
+# Copyright (C) 2020 by Oleksij Rempel <o.rempel@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BAREBOX_MALTA) += barebox-malta
+
+#
+# Paths and names
+#
+BAREBOX_MALTA_VERSION := $(call remove_quotes,$(PTXCONF_BAREBOX_COMMON_VERSION))
+BAREBOX_MALTA_MD5 := $(call remove_quotes,$(PTXCONF_BAREBOX_COMMON_MD5))
+BAREBOX_MALTA := barebox-malta-$(BAREBOX_MALTA_VERSION)
+BAREBOX_MALTA_SUFFIX := tar.bz2
+BAREBOX_MALTA_URL := $(call barebox-url, BAREBOX_MALTA)
+BAREBOX_MALTA_PATCHES := barebox-$(BAREBOX_MALTA_VERSION)
+BAREBOX_MALTA_SOURCE := $(SRCDIR)/$(BAREBOX_MALTA_PATCHES).$(BAREBOX_MALTA_SUFFIX)
+BAREBOX_MALTA_DIR := $(BUILDDIR)/$(BAREBOX_MALTA)
+BAREBOX_MALTA_BUILD_DIR := $(BAREBOX_MALTA_DIR)-build
+BAREBOX_MALTA_CONFIG := $(call ptx/in-platformconfigdir, barebox-malta.config)
+BAREBOX_MALTA_REF_CONFIG := $(call ptx/in-platformconfigdir, barebox.config)
+BAREBOX_MALTA_LICENSE := GPL-2.0-only
+BAREBOX_MALTA_BUILD_OOT := KEEP
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+# use host pkg-config for host tools
+BAREBOX_MALTA_PATH := PATH=$(HOST_PATH)
+
+BAREBOX_MALTA_WRAPPER_BLACKLIST := \
+ $(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+BAREBOX_MALTA_CONF_OPT := \
+ -C $(BAREBOX_MALTA_DIR) \
+ O=$(BAREBOX_MALTA_BUILD_DIR) \
+ $(call barebox-opts, BAREBOX_MALTA)
+
+BAREBOX_MALTA_MAKE_OPT := $(BAREBOX_MALTA_CONF_OPT)
+
+BAREBOX_MALTA_IMAGES := images/barebox-qemu-malta.img
+BAREBOX_MALTA_IMAGES := $(addprefix $(BAREBOX_MALTA_BUILD_DIR)/,$(BAREBOX_MALTA_IMAGES))
+
+ifdef PTXCONF_BAREBOX_MALTA
+$(BAREBOX_MALTA_CONFIG):
+ @echo
+ @echo "****************************************************************************"
+ @echo " Please generate a bareboxconfig with 'ptxdist menuconfig barebox-malta'"
+ @echo "****************************************************************************"
+ @echo
+ @echo
+ @exit 1
+endif
+
+$(STATEDIR)/barebox-malta.prepare: $(BAREBOX_MALTA_CONFIG)
+ @$(call targetinfo)
+ @$(call world/prepare, BAREBOX_MALTA)
+ @rm -f "$(BAREBOX_MALTA_BUILD_DIR)/.ptxdist-defaultenv"
+ @ln -s "$(call ptx/in-platformconfigdir, barebox-malta-defaultenv)" \
+ "$(BAREBOX_MALTA_BUILD_DIR)/.ptxdist-defaultenv"
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-malta.install:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-malta.targetinstall:
+ @$(call targetinfo)
+ @$(foreach image, $(BAREBOX_MALTA_IMAGES), \
+ install -m 644 \
+ $(image) $(IMAGEDIR)/$(notdir $(image))$(ptx/nl))
+ @install -D -m644 $(BAREBOX_MALTA_BUILD_DIR)/defaultenv/barebox_zero_env $(IMAGEDIR)/barebox-zero-env-malta
+ @install -D -m644 $(BAREBOX_MALTA_BUILD_DIR)/arch/mips/dts/qemu-malta.dtb $(IMAGEDIR)/qemu-malta.dtb-bb
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox-malta.clean:
+ @$(call targetinfo)
+ @$(call clean_pkg, BAREBOX_MALTA)
+ @$(foreach image, $(BAREBOX_MALTA_IMAGES), \
+ rm -fv $(IMAGEDIR)/$(notdir $(image))$(ptx/nl))
+ @rm -vf $(IMAGEDIR)/barebox-zero-env-malta \
+ $(IMAGEDIR)/qemu-malta.dtb-bb
+
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+barebox-malta_oldconfig barebox-malta_menuconfig barebox-malta_nconfig: $(STATEDIR)/barebox-malta.extract
+ @$(call world/kconfig, BAREBOX_MALTA, $(subst barebox-malta_,,$@))
+
+# vim: syntax=make