From patchwork Wed Aug 15 07:59:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 177562 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 1FFC12C0085 for ; Wed, 15 Aug 2012 18:06:15 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7180425621; Wed, 15 Aug 2012 08:06:13 +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 kTP7PF3E4-ms; Wed, 15 Aug 2012 08:05:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id F2BCB260FA; Wed, 15 Aug 2012 07:50:21 +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 F2F328F753 for ; Wed, 15 Aug 2012 07:50:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6D6D18F78E for ; Wed, 15 Aug 2012 07:50:18 +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 HvlcFQI6CSoP for ; Wed, 15 Aug 2012 07:49:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe006.messaging.microsoft.com [216.32.180.189]) by whitealder.osuosl.org (Postfix) with ESMTPS id E66F783074 for ; Wed, 15 Aug 2012 07:47:55 +0000 (UTC) Received: from mail6-co1-R.bigfish.com (10.243.78.229) by CO1EHSOBE006.bigfish.com (10.243.66.69) with Microsoft SMTP Server id 14.1.225.23; Wed, 15 Aug 2012 07:47:55 +0000 Received: from mail6-co1 (localhost [127.0.0.1]) by mail6-co1-R.bigfish.com (Postfix) with ESMTP id 14C17C0024C; Wed, 15 Aug 2012 07:47:55 +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 (mail6-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 mail6-co1 (localhost.localdomain [127.0.0.1]) by mail6-co1 (MessageSwitch) id 1345016873498377_28433; Wed, 15 Aug 2012 07:47:53 +0000 (UTC) Received: from CO1EHSMHS005.bigfish.com (unknown [10.243.78.237]) by mail6-co1.bigfish.com (Postfix) with ESMTP id 77B5CAC004D; Wed, 15 Aug 2012 07:47:53 +0000 (UTC) Received: from nwd2mta2.analog.com (137.71.25.57) by CO1EHSMHS005.bigfish.com (10.243.66.15) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 15 Aug 2012 07:47:53 +0000 Received: from NWD2HUBCAS2.ad.analog.com (nwd2hubcas2.ad.analog.com [10.64.73.30]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id q7F8pfZ9012832 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 15 Aug 2012 04:51:41 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS2.ad.analog.com (10.64.73.30) with Microsoft SMTP Server id 8.3.83.0; Wed, 15 Aug 2012 03:47:51 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.5/8.14.5) with ESMTP id q7F7lopx030345; Wed, 15 Aug 2012 03:47:51 -0400 Received: from localhost.localdomain (unknown [10.99.22.81]) by linux.site (Postfix) with ESMTP id 8C53A42888E0; Tue, 14 Aug 2012 18:13:50 -0600 (MDT) From: Sonic Zhang To: Thomas Petazzoni , Peter Korsgaard Date: Wed, 15 Aug 2012 15:59:01 +0800 Message-ID: <1345017542-32000-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 v3] 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) Remove unused makefile target .stamp_rsynced and .stamp_rsync_sourced. 3) Add .stamp_patch target to patch the external source tree if _OVERRIDE_SRCDIR is defined. Signed-off-by: Sonic Zhang --- package/pkg-cmake.mk | 8 ++++++-- package/pkg-generic.mk | 46 +++++++++------------------------------------- 2 files changed, 15 insertions(+), 39 deletions(-) diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk index 626a0b0..2d7b067 100644 --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -47,8 +47,12 @@ $(2)_INSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) install $(2)_INSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) install $(2)_CLEAN_OPT ?= clean -$(2)_SRCDIR = $$($(2)_DIR)/$($(2)_SUBDIR) -$(2)_BUILDDIR = $$($(2)_SRCDIR) +ifneq ($$($(2)_OVERRIDE_SRCDIR),) + $(2)_SRCDIR = $$($(2)_OVERRIDE_SRCDIR)/$($(2)_SUBDIR) +else + $(2)_SRCDIR = $$($(2)_DIR)/$($(2)_SUBDIR) +endif +$(2)_BUILDDIR = $$($(2)_DIR)/$($(2)_SUBDIR) # # Configure step. Only define it if not already defined by the package diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 68d23ba..2189c6b 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 @@ -220,11 +201,13 @@ ifndef $(2)_SUBDIR endif endif -$(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) -$(2)_BUILDDIR ?= $$($(2)_SRCDIR) +$(2)_BUILDDIR ?= $$($(2)_DIR)/$$($(2)_SUBDIR) ifneq ($$($(2)_OVERRIDE_SRCDIR),) -$(2)_VERSION = custom + $(2)_VERSION = custom + $(2)_SRCDIR = $$($(2)_OVERRIDE_SRCDIR)/$$($(2)_SUBDIR) +else + $(2)_SRCDIR = $$($(2)_DIR)/$$($(2)_SUBDIR) endif ifndef $(2)_SOURCE @@ -293,8 +276,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 +356,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 +378,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 +399,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)