From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.x-arc.co.uk ([217.6.246.34] helo=root.phytec.de) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1S0T9R-0005hq-Nb for ptxdist@pengutronix.de; Thu, 23 Feb 2012 08:31:43 +0100 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 4C7C4BF0E0 for ; Wed, 22 Feb 2012 13:35:43 +0100 (CET) From: Jan Weitzel Date: Thu, 23 Feb 2012 08:31:12 +0100 Message-Id: <1329982272-6194-1-git-send-email-j.weitzel@phytec.de> In-Reply-To: <20120221164736.GI29102@pengutronix.de> References: <20120221164736.GI29102@pengutronix.de> Subject: [ptxdist] [RFC] Build MLO from barebox sources Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Build MLO in $(BUILDDIR)/barebox_mlo-* with config PTXCONF_BAREBOX_MLO_CONFIG Default config is barebox_mlo.config. Signed-off-by: Jan Weitzel --- platforms/barebox_mlo.in | 19 +++++++ rules/barebox_mlo.make | 124 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 0 deletions(-) create mode 100644 platforms/barebox_mlo.in create mode 100644 rules/barebox_mlo.make diff --git a/platforms/barebox_mlo.in b/platforms/barebox_mlo.in new file mode 100644 index 0000000..f1e9c78 --- /dev/null +++ b/platforms/barebox_mlo.in @@ -0,0 +1,19 @@ +## SECTION=bootloader + +menuconfig BAREBOX_MLO + prompt "barebox mlo " + bool + depends on BAREBOX + help + Build mlo from barebox sources. + +if BAREBOX_MLO + +config BAREBOX_MLO_CONFIG + prompt "mlo config file" + string + default "barebox_mlo.config" + help + This entry specifies the .config file used to compile mlo. + +endif diff --git a/rules/barebox_mlo.make b/rules/barebox_mlo.make new file mode 100644 index 0000000..12e8743 --- /dev/null +++ b/rules/barebox_mlo.make @@ -0,0 +1,124 @@ +# -*-makefile-*- +# +# Copyright (C) 2012 Jan Weitzel +# based on barebox.make +# +# 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 = barebox_mlo-$(BAREBOX_MLO_VERSION) +BAREBOX_MLO_DIR = $(BUILDDIR)/$(BAREBOX_MLO) +BAREBOX_MLO_SOURCE = $(BAREBOX_SOURCE) +BAREBOX_MLO_LICENSE := GPLv2 + +BAREBOX_MLO_CONFIG := $(call remove_quotes, $(PTXDIST_PLATFORMCONFIGDIR)/$(PTXCONF_BAREBOX_MLO_CONFIG)) + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- +$(STATEDIR)/barebox_mlo.get: $(STATEDIR)/barebox.get + @$(call targetinfo) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- +$(STATEDIR)/barebox_mlo.extract: + @$(call targetinfo) + @$(call clean, $(BAREBOX_MLO_DIR)) + @mkdir -p $(BAREBOX_MLO_DIR) + @$(call extract, BAREBOX_MLO) + @$(call patchin, BAREBOX, $(BAREBOX_MLO_DIR)) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +BAREBOX_MLO_PATH := PATH=$(CROSS_PATH) +BAREBOX_MLO_ENV := KCONFIG_NOTIMESTAMP=1 +BAREBOX_MLO_MAKEVARS := \ + HOSTCC=$(HOSTCC) \ + ARCH=$(PTXCONF_BAREBOX_ARCH_STRING) \ + CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) + +$(STATEDIR)/barebox_mlo.prepare: $(BAREBOX_MLO_CONFIG) + @$(call targetinfo) + + @echo "Using barebox_mlo config file: $(BAREBOX_MLO_CONFIG)" + @install -m 644 $(BAREBOX_MLO_CONFIG) $(BAREBOX_MLO_DIR)/.config + + @$(call ptx/oldconfig, BAREBOX_MLO) + + @$(call touch) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/barebox_mlo.compile: + @$(call targetinfo) + cd $(BAREBOX_MLO_DIR) && $(BAREBOX_MLO_PATH) $(MAKE) $(BAREBOX_MLO_MAKEVARS) + @$(call touch) + +# ---------------------------------------------------------------------------- +# 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 + @if test -e $(BAREBOX_MLO_DIR)/MLO; then \ + install -D -m644 $(BAREBOX_MLO_DIR)/MLO $(IMAGEDIR)/MLO ; \ + else \ + install -D -m644 $(BAREBOX_MLO_DIR)/barebox.bin.ift $(IMAGEDIR)/MLO ; \ + fi + + @$(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 -- 1.7.0.4 -- ptxdist mailing list ptxdist@pengutronix.de