From patchwork Tue Apr 29 15:32:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 343896 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 471F31400DE for ; Wed, 30 Apr 2014 01:33:03 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0C1528BF30; Tue, 29 Apr 2014 15:33:02 +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 usxXYh5Jfncl; Tue, 29 Apr 2014 15:32:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 514528B76A; Tue, 29 Apr 2014 15:32:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 3358A1C27A2 for ; Tue, 29 Apr 2014 15:32:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 30083879AF; Tue, 29 Apr 2014 15:32:58 +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 RFjP9Px+q6qP; Tue, 29 Apr 2014 15:32:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by hemlock.osuosl.org (Postfix) with ESMTPS id C5FFD89722; Tue, 29 Apr 2014 15:32:56 +0000 (UTC) Received: by mail-pd0-f182.google.com with SMTP id v10so329098pde.13 for ; Tue, 29 Apr 2014 08:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=q79W+tg519NpIXXTVP7Q6B1RLgIwweOS9Op29AaoRKI=; b=umPIl1EG4/o9Pe/O5/MoBI8PyUKkLIYEdserkhHYp5i8WLTtCTkZ3Xnf7uRvLiZec5 Tc6hId+6BiZhweb8Irk1l3xNLTCnz7M2qV5Aips2YvCaHRWyEF0FT1796nE8sbQeCvQb Q5jsE7tYSP85KmNI4hHkqFUKYL6R17HGvwER0eLogZ2SKS09AUxTinASZo+tzoi7KdSk 7OXUZfhN8+9K3YJypeZ1Hx2LCSLjqpgamTaPAku7Mh2AVQsgv5S3RB48LHDCxShcHNby StoBDoazrz7fILeXtaLMHURvfO/WRCw96Roq9gKqJkx4Px8ap2PoRZcXc6x8fecmsAij IRCQ== X-Received: by 10.66.149.102 with SMTP id tz6mr162942pab.76.1398785571249; Tue, 29 Apr 2014 08:32:51 -0700 (PDT) Received: from ld2077.tmt.telital.com ([213.205.6.118]) by mx.google.com with ESMTPSA id g6sm113013082pat.2.2014.04.29.08.32.48 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Apr 2014 08:32:50 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Tue, 29 Apr 2014 17:32:34 +0200 Message-Id: <1398785554-6797-1-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 1.8.3.2 Cc: Thomas Petazzoni , Peter Korsgaard Subject: [Buildroot] [PATCH v2] Makefile: target-purgelocales: fix top-level parallel make support 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The "target-purgelocales" target must be executed after all the other targets and before the "target-finalize" target, so create a TARGET_PURGE_LOCALES variable containing the commands of the target "target-purgelocales" and add it at the beginning of the "target-finalize" target. Signed-off-by: Fabio Porcedda Cc: Arnout Vandecappelle Cc: Thomas De Schampheleire Cc: Thomas Petazzoni Cc: Peter Korsgaard Acked-by: Arnout Vandecappelle (Essensium/Mind) --- v2: - rewrite the patch following Arnout suggestion Makefile | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index eff408b..00e9798 100644 --- a/Makefile +++ b/Makefile @@ -391,10 +391,6 @@ include system/system.mk include $(BR2_EXTERNAL)/external.mk -ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) -TARGETS += target-purgelocales -endif - ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) ifneq ($(GENERATE_LOCALE),) TARGETS += target-generatelocales @@ -509,9 +505,28 @@ endif STRIP_FIND_CMD += -type f \( -perm /111 -o -name '*.so*' \) STRIP_FIND_CMD += -not \( $(call findfileclauses,libpthread*.so* $(call qstrip,$(BR2_STRIP_EXCLUDE_FILES))) \) -print +ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) +LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge +LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST)) + +define TARGET_PURGE_LOCALES + rm -f $(LOCALE_WHITELIST) + for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done + + for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man /usr/lib/locale)); \ + do \ + for lang in $$(cd $$dir; ls .|grep -v man); \ + do \ + grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \ + done; \ + done +endef +endif + $(TARGETS_ROOTFS): target-finalize target-finalize: $(TARGETS) + $(TARGET_PURGE_LOCALES) rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \ $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \ $(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake @@ -575,23 +590,6 @@ endif $(call MESSAGE,"Executing post-build script $(s)"); \ $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) -ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) -LOCALE_WHITELIST = $(BUILD_DIR)/locales.nopurge -LOCALE_NOPURGE = $(call qstrip,$(BR2_ENABLE_LOCALE_WHITELIST)) - -target-purgelocales: - rm -f $(LOCALE_WHITELIST) - for i in $(LOCALE_NOPURGE); do echo $$i >> $(LOCALE_WHITELIST); done - - for dir in $(wildcard $(addprefix $(TARGET_DIR),/usr/share/locale /usr/share/X11/locale /usr/man /usr/share/man /usr/lib/locale)); \ - do \ - for lang in $$(cd $$dir; ls .|grep -v man); \ - do \ - grep -qx $$lang $(LOCALE_WHITELIST) || rm -rf $$dir/$$lang; \ - done; \ - done -endif - ifneq ($(GENERATE_LOCALE),) # Generate locale data. Basically, we call the localedef program # (built by the host-localedef package) for each locale. The input