summaryrefslogtreecommitdiffstats
path: root/rules/barebox_mlo.make
diff options
context:
space:
mode:
authorJan Weitzel <j.weitzel@phytec.de>2012-02-23 17:40:51 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-03-06 08:35:22 +0100
commite790fc7c645927cdd8b71fad079c682f9ef1fb0f (patch)
tree3bbe29b5f6a90ec9348f835806963c61e20083e5 /rules/barebox_mlo.make
parent45c8bf5d3dbb6b5f523be0de1a47852a7336f096 (diff)
downloadptxdist-e790fc7c645927cdd8b71fad079c682f9ef1fb0f.tar.gz
ptxdist-e790fc7c645927cdd8b71fad079c682f9ef1fb0f.tar.xz
Build MLO from barebox sources
Build MLO in $(BUILDDIR)/barebox_mlo-* with config PTXCONF_BAREBOX_MLO_CONFIG Default config is barebox_mlo.config. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules/barebox_mlo.make')
-rw-r--r--rules/barebox_mlo.make88
1 files changed, 88 insertions, 0 deletions
diff --git a/rules/barebox_mlo.make b/rules/barebox_mlo.make
new file mode 100644
index 000000000..0efab3b01
--- /dev/null
+++ b/rules/barebox_mlo.make
@@ -0,0 +1,88 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2012 Jan Weitzel <j.weitzel@phytec.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BAREBOX_MLO) += barebox_mlo
+
+#
+# Paths and names
+#
+BAREBOX_MLO_VERSION = $(BAREBOX_VERSION)
+BAREBOX_MLO_MD5 = $(BAREBOX_MD5)
+BAREBOX_MLO = $(BAREBOX)
+BAREBOX_MLO_DIR = $(BUILDDIR)/barebox_mlo-$(BAREBOX_MLO_VERSION)
+BAREBOX_MLO_SOURCE = $(BAREBOX_SOURCE)
+BAREBOX_MLO_LICENSE := GPLv2
+
+BAREBOX_MLO_CONFIG := $(call remove_quotes, \
+ $(PTXDIST_PLATFORMCONFIGDIR)/$(PTXCONF_BAREBOX_MLO_CONFIG))
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+BAREBOX_MLO_CONF_ENV := KCONFIG_NOTIMESTAMP=1
+BAREBOX_MLO_CONF_TOOL := kconfig
+BAREBOX_MLO_CONF_OPT := \
+ HOSTCC=$(HOSTCC) \
+ ARCH=$(PTXCONF_BAREBOX_ARCH_STRING) \
+ CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE)
+
+BAREBOX_MLO_MAKE_OPT := $(BAREBOX_MLO_CONF_OPT)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox_mlo.install:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox_mlo.targetinstall:
+ @$(call targetinfo)
+# #barebox renamed barebox.bin.ift to MLO, so fall back to barebox.bin.ift
+ @ptxd_get_path "$(BAREBOX_MLO_DIR)/MLO" \
+ "$(BAREBOX_MLO_DIR)/barebox.bin.ift" && \
+ install -D -m644 "$${ptxd_reply}" "$(IMAGEDIR)/MLO"
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/barebox_mlo.clean:
+ @$(call targetinfo)
+ @$(call clean_pkg, BAREBOX_MLO)
+ rm -rf $(IMAGEDIR)/MLO
+
+# ----------------------------------------------------------------------------
+# oldconfig / menuconfig
+# ----------------------------------------------------------------------------
+
+barebox_mlo_oldconfig barebox_mlo_menuconfig: $(STATEDIR)/barebox_mlo.extract
+ @if test -e $(BAREBOX_MLO_CONFIG); then \
+ cp $(BAREBOX_MLO_CONFIG) $(BAREBOX_MLO_DIR)/.config; \
+ fi
+ cd $(BAREBOX_MLO_DIR) && \
+ $(BAREBOX_MLO_PATH) $(BAREBOX_MLO_ENV) $(MAKE) \
+ $(BAREBOX_MLO_MAKEVARS) $(subst barebox_mlo_,,$@)
+ @if cmp -s $(BAREBOX_MLO_DIR)/.config $(BAREBOX_MLO_CONFIG); then \
+ echo "barebox_mlo configuration unchanged"; \
+ else \
+ cp $(BAREBOX_MLO_DIR)/.config $(BAREBOX_MLO_CONFIG); \
+ fi
+
+# vim: syntax=make