From patchwork Thu Jul 2 09:15:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Viallard X-Patchwork-Id: 490518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 940131402B8 for ; Thu, 2 Jul 2015 19:15:28 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CCA7191E6D; Thu, 2 Jul 2015 09:15:27 +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 cXpL+dHtwf+2; Thu, 2 Jul 2015 09:15:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 1163B91E3F; Thu, 2 Jul 2015 09:15:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9AAFB1CE559 for ; Thu, 2 Jul 2015 09:15:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 967B8955B2 for ; Thu, 2 Jul 2015 09:15:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tRm9Xc6Ip3xN for ; Thu, 2 Jul 2015 09:15:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-sh2.infomaniak.ch (smtp-sh2.infomaniak.ch [128.65.195.6]) by hemlock.osuosl.org (Postfix) with ESMTPS id D0599955AC for ; Thu, 2 Jul 2015 09:15:22 +0000 (UTC) Received: from smtp3.infomaniak.ch (smtp3.infomaniak.ch [84.16.68.91]) by smtp-sh.infomaniak.ch (8.14.5/8.14.5) with ESMTP id t629FJfo004576 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 2 Jul 2015 11:15:19 +0200 Received: from localhost.localdomain (mail.borm.ch [213.200.221.18] (may be forged)) (authenticated bits=0) by smtp3.infomaniak.ch (8.14.5/8.14.5) with ESMTP id t629FGKi012457 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Thu, 2 Jul 2015 11:15:19 +0200 From: Anthony Viallard To: buildroot@buildroot.org Date: Thu, 2 Jul 2015 11:15:15 +0200 Message-Id: <1435828515-16620-1-git-send-email-viallard@syscom-instruments.com> X-Mailer: git-send-email 2.1.4 X-Antivirus: Dr.Web (R) for Unix mail servers drweb plugin ver.6.0.2.8 X-Antivirus-Code: 0x100000 Subject: [Buildroot] [PATCH 1/1] force rsync of local package and try to rebuild it with its dependencies X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The purpose of this patch is to force rsync of local site packages and rebuild them if their source code has changed. Therefore, if the source of a package has changed, it will be rebuild if you type make or make . Likewise, if a package has a library dependency which is local site package too and you type make , the library will be rebuild if the source has been modified. This behavior is pretty useful if you use buildroot with many of your own packages. Especially if you share these packages with a developer team through a version control system like git. Signed-off-by: Anthony Viallard --- package/pkg-generic.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index d5b29f0..d31ebc2 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -102,7 +102,7 @@ $(BUILD_DIR)/%/.stamp_rsynced: @$(call MESSAGE,"Syncing from source dir $(SRCDIR)") @test -d $(SRCDIR) || (echo "ERROR: $(SRCDIR) does not exist" ; exit 1) $(foreach hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep)) - rsync -au $(RSYNC_VCS_EXCLUSIONS) $(SRCDIR)/ $(@D) + rsync -au $(RSYNC_VCS_EXCLUSIONS) --include core $(SRCDIR)/ $(@D) $(foreach hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep)) $(Q)touch $@ @@ -458,7 +458,11 @@ $(2)_PRE_LEGAL_INFO_HOOKS ?= $(2)_POST_LEGAL_INFO_HOOKS ?= # human-friendly targets and target sequencing +ifeq ($$($(2)_SITE_METHOD),local) +$(1): $(1)-clean-for-rebuild $(1)-install +else $(1): $(1)-install +endif ifeq ($$($(2)_TYPE),host) $(1)-install: $(1)-install-host @@ -604,12 +608,12 @@ $(1)-reinstall: $(1)-clean-for-reinstall $(1) $(1)-clean-for-rebuild: $(1)-clean-for-reinstall rm -f $$($(2)_TARGET_BUILD) -$(1)-rebuild: $(1)-clean-for-rebuild $(1) +$(1)-rebuild: $(1)-clean-for-rebuild $(1)-install $(1)-clean-for-reconfigure: $(1)-clean-for-rebuild rm -f $$($(2)_TARGET_CONFIGURE) -$(1)-reconfigure: $(1)-clean-for-reconfigure $(1) +$(1)-reconfigure: $(1)-clean-for-reconfigure $(1)-install # define the PKG variable for all targets, containing the # uppercase package variable prefix