From patchwork Tue Aug 14 08:57:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 177189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 460662C0080 for ; Tue, 14 Aug 2012 18:46:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 29EE62508C; Tue, 14 Aug 2012 08:46:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6izaEOeBK1uF; Tue, 14 Aug 2012 08:46:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8A7C425058; Tue, 14 Aug 2012 08:46:38 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 3DF5F8F753 for ; Tue, 14 Aug 2012 08:46:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 75C9B883AD for ; Tue, 14 Aug 2012 08:46:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P8KG7sw8sdFN for ; Tue, 14 Aug 2012 08:46:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe002.messaging.microsoft.com [216.32.180.185]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3ACC086758 for ; Tue, 14 Aug 2012 08:46:10 +0000 (UTC) Received: from mail2-co1-R.bigfish.com (10.243.78.247) by CO1EHSOBE001.bigfish.com (10.243.66.64) with Microsoft SMTP Server id 14.1.225.23; Tue, 14 Aug 2012 08:46:09 +0000 Received: from mail2-co1 (localhost [127.0.0.1]) by mail2-co1-R.bigfish.com (Postfix) with ESMTP id 276B54C03B7; Tue, 14 Aug 2012 08:46:09 +0000 (UTC) X-Forefront-Antispam-Report: CIP:137.71.25.57; KIP:(null); UIP:(null); IPV:NLI; H:nwd2mta2.analog.com; RD:nwd2mail11.analog.com; EFVD:NLI X-SpamScore: 14 X-BigFish: VS14(z1039oz709fIzz1202hzz8275bhz2ei87h2a8h668h839hd24he5bhe96h107ahff4o) Received-SPF: neutral (mail2-co1: 137.71.25.57 is neither permitted nor denied by domain of gmail.com) client-ip=137.71.25.57; envelope-from=sonic.adi@gmail.com; helo=nwd2mta2.analog.com ; 2.analog.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail2-co1 (localhost.localdomain [127.0.0.1]) by mail2-co1 (MessageSwitch) id 134493396788912_15854; Tue, 14 Aug 2012 08:46:07 +0000 (UTC) Received: from CO1EHSMHS027.bigfish.com (unknown [10.243.78.227]) by mail2-co1.bigfish.com (Postfix) with ESMTP id 138D274004B; Tue, 14 Aug 2012 08:46:07 +0000 (UTC) Received: from nwd2mta2.analog.com (137.71.25.57) by CO1EHSMHS027.bigfish.com (10.243.66.37) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 14 Aug 2012 08:46:06 +0000 Received: from NWD2HUBCAS1.ad.analog.com (nwd2hubcas1.ad.analog.com [10.64.73.29]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id q7E9niG9008670 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 14 Aug 2012 05:49:44 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS1.ad.analog.com (10.64.73.29) with Microsoft SMTP Server id 8.3.83.0; Tue, 14 Aug 2012 04:46:05 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.5/8.14.5) with ESMTP id q7E8k38q012024; Tue, 14 Aug 2012 04:46:04 -0400 Received: from localhost.localdomain (unknown [10.99.22.81]) by linux.site (Postfix) with ESMTP id EEE6742CABDC; Mon, 13 Aug 2012 19:12:01 -0600 (MDT) From: Sonic Zhang To: Thomas Petazzoni , Peter Korsgaard Date: Tue, 14 Aug 2012 16:57:00 +0800 Message-ID: <1344934621-7121-1-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Cc: buildroot@busybox.net, Sonic Zhang , buildroot-devel@blackfin.uclinux.org Subject: [Buildroot] [PATCH 1/2] package: pkg-generic: Support building override source without copying in common package infrastructure. X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Sonic Zhang 1) Set _SRCDIR a different path from _DIR if _OVERRIDE_SRCDIR is defined. Generic package's make rules should replace $@ by $(_SRCDIR). 2) Set object path to _MAKE_FLAGS if _OVERRIDE_SRCDIR is defined. Generic package's make rules should forward _MAKE_FLAGS to the make command. 3) Remove unused makefile target .stamp_rsynced and .stamp_rsync_sourced. 4) Add .stamp_patch target to patch the external source tree if _OVERRIDE_SRCDIR is defined. Signed-off-by: Sonic Zhang --- package/pkg-generic.mk | 42 ++++++++---------------------------------- 1 files changed, 8 insertions(+), 34 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 68d23ba..9dfc0e3 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -50,25 +50,6 @@ $(BUILD_DIR)/%/.stamp_extracted: $(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep)) $(Q)touch $@ -# Rsync the source directory if the _OVERRIDE_SRCDIR feature is -# used. -$(BUILD_DIR)/%/.stamp_rsynced: - @$(call MESSAGE,"Syncing from source dir $(SRCDIR)") - @test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1) - rsync -au $(SRCDIR)/ $(@D) - $(Q)touch $@ - -# Handle the SOURCE_CHECK and SHOW_EXTERNAL_DEPS cases for rsynced -# packages -$(BUILD_DIR)/%/.stamp_rsync_sourced: -ifeq ($(DL_MODE),SOURCE_CHECK) - test -d $(SRCDIR) -else ifeq ($(DL_MODE),SHOW_EXTERNAL_DEPS) - echo "file://$(SRCDIR)" -else - @true # Nothing to do to source a local package -endif - # Patch # # The RAWNAME variable is the lowercased package name, which allows to @@ -225,6 +206,10 @@ $(2)_BUILDDIR ?= $$($(2)_SRCDIR) ifneq ($$($(2)_OVERRIDE_SRCDIR),) $(2)_VERSION = custom +$(2)_MAKE_FLAGS = O="$$($(2)_DIR)" +$(2)_SRCDIR = $$($(2)_OVERRIDE_SRCDIR) +else +$(2)_SRCDIR = $$($(2)_DIR) endif ifndef $(2)_SOURCE @@ -293,8 +278,6 @@ $(2)_TARGET_INSTALL_IMAGES = $$($(2)_DIR)/.stamp_images_installed $(2)_TARGET_INSTALL_HOST = $$($(2)_DIR)/.stamp_host_installed $(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built $(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured -$(2)_TARGET_RSYNC = $$($(2)_DIR)/.stamp_rsynced -$(2)_TARGET_RSYNC_SOURCE = $$($(2)_DIR)/.stamp_rsync_sourced $(2)_TARGET_PATCH = $$($(2)_DIR)/.stamp_patched $(2)_TARGET_EXTRACT = $$($(2)_DIR)/.stamp_extracted $(2)_TARGET_SOURCE = $$($(2)_DIR)/.stamp_downloaded @@ -375,17 +358,15 @@ $(1)-depends: $$($(2)_DEPENDENCIES) $(1)-source: $$($(2)_TARGET_SOURCE) else # In the package override case, the sequence of steps -# source, by rsyncing +# patch # depends # configure -$(1)-configure: $(1)-depends \ +$(1)-configure: $(1)-patch $(1)-depends \ $$($(2)_TARGET_CONFIGURE) -$(1)-depends: $(1)-rsync $$($(2)_DEPENDENCIES) - -$(1)-rsync: $$($(2)_TARGET_RSYNC) +$(1)-patch: $$($(2)_TARGET_PATCH) -$(1)-source: $$($(2)_TARGET_RSYNC_SOURCE) +$(1)-depends: $$($(2)_DEPENDENCIES) endif $(1)-show-depends: @@ -399,9 +380,6 @@ $(1)-clean: $(1)-uninstall \ $(1)-dirclean: $$($(2)_TARGET_DIRCLEAN) $(1)-clean-for-rebuild: -ifneq ($$($(2)_OVERRIDE_SRCDIR),) - rm -f $$($(2)_TARGET_RSYNC) -endif rm -f $$($(2)_TARGET_BUILD) rm -f $$($(2)_TARGET_INSTALL_STAGING) rm -f $$($(2)_TARGET_INSTALL_TARGET) @@ -423,10 +401,6 @@ $$($(2)_TARGET_INSTALL_IMAGES): PKG=$(2) $$($(2)_TARGET_INSTALL_HOST): PKG=$(2) $$($(2)_TARGET_BUILD): PKG=$(2) $$($(2)_TARGET_CONFIGURE): PKG=$(2) -$$($(2)_TARGET_RSYNC): SRCDIR=$$($(2)_OVERRIDE_SRCDIR) -$$($(2)_TARGET_RSYNC): PKG=$(2) -$$($(2)_TARGET_RSYNC_SOURCE): SRCDIR=$$($(2)_OVERRIDE_SRCDIR) -$$($(2)_TARGET_RSYNC_SOURCE): PKG=$(2) $$($(2)_TARGET_PATCH): PKG=$(2) $$($(2)_TARGET_PATCH): RAWNAME=$(patsubst host-%,%,$(1)) $$($(2)_TARGET_EXTRACT): PKG=$(2)