From d735cb6fbb5c87ce5cf125d21f87a99f85babb88 Mon Sep 17 00:00:00 2001 From: Jed Brown Date: Mon, 4 Nov 2013 08:35:03 +1700 Subject: [PATCH] Re: [PATCH 1/1] build: remove trailing '/.' when doing mkdir -p .deps/. --- ce/9c0f5e58409d0d30d1d0bd76a6bb18edaa401b | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 ce/9c0f5e58409d0d30d1d0bd76a6bb18edaa401b diff --git a/ce/9c0f5e58409d0d30d1d0bd76a6bb18edaa401b b/ce/9c0f5e58409d0d30d1d0bd76a6bb18edaa401b new file mode 100644 index 000000000..9ac5bf91d --- /dev/null +++ b/ce/9c0f5e58409d0d30d1d0bd76a6bb18edaa401b @@ -0,0 +1,105 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 37AF1431E82 + for ; Sun, 3 Nov 2013 07:40:25 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id h78PVTNB2ag2 for ; + Sun, 3 Nov 2013 07:40:17 -0800 (PST) +X-Greylist: delayed 305 seconds by postgrey-1.32 at olra; + Sun, 03 Nov 2013 07:40:16 PST +Received: from jedbrown.org (jedbrown.org [198.199.121.66]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id ECE3F431E62 + for ; Sun, 3 Nov 2013 07:40:16 -0800 (PST) +Received: from localhost (unknown [65.127.208.182]) + by jedbrown.org (Postfix) with ESMTPSA id 1F72380E87; + Sun, 3 Nov 2013 15:35:07 +0000 (UTC) +From: Jed Brown +To: Tomi Ollila , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/1] build: remove trailing '/.' when doing mkdir -p + .deps/. +In-Reply-To: <1383487535-21597-1-git-send-email-tomi.ollila@iki.fi> +References: <1383487535-21597-1-git-send-email-tomi.ollila@iki.fi> +User-Agent: Notmuch/0.16+100~g18ee1e2 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +Date: Sun, 03 Nov 2013 08:35:03 -0700 +Message-ID: <87fvrd8pnc.fsf@mcs.anl.gov> +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 03 Nov 2013 15:40:25 -0000 + +--=-=-= +Content-Type: text/plain + +Tomi Ollila writes: + +> %.o: %.cc $(global_deps) +> - @mkdir -p .deps/$(@D) +> + @mkdir -p $(patsubst %/.,%,.deps/$(@D)) +> $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d + +An alternative approach is to use directory marker files [1] to clean up +the recipes that need output directories and to satisfy Paul's second +rule of makefiles [2]. + +.SECONDEXPANSION: + +%.o: %.cc $(global_deps) | .deps/$$(@D)/.DIR + $(call quiet,CXX $(CPPFLAGS) $(CXXFLAGS)) -c $(FINAL_CXXFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d + +%/.DIR: + @mkdir -p $(patsubst %/.,%,$(@D)) + @touch $@ + +.PRECIOUS: %.DIR + + + +[1] http://www.cmcrossroads.com/article/making-directories-gnu-make +[2] http://make.paulandlesley.org/rules.html + +--=-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.22 (GNU/Linux) + +iQIcBAEBAgAGBQJSdm0rAAoJEM+2iNHeMalNl+IP/2ixMG6Zt8JkNf6qdwLLqGkz +jofays2bHr8uO0zzibU+IOb2TcWlCh81cUGOHdy7PLZjeVkG7cqH8g//RF5OUslD +f6wZ3oy64jKxp8E02mQm1mmNgiVXAB7jGfaMDOdJnFkK3y3rW1O2Sl4UUYPBKwMs +RnsjbahB7z4RQlLfTtFazRQ/PHq7C5NXcJ9KWng3wfiL/GrYDyixDd83quBQHJ+f +nANlemiIC6NPr/Ikc0CO+s7J0/xKKNAQTjnWFj7NbwlAE4tEHh4ekq5YBRuV5oI7 +nKiQsrorizosGmgir0WBdC3jMrK+8savkxZq/yTQFJV4JQTITKEoObC1l7Aekgny +vB/ogiJ4NoHUCoacP0UfU1TAMacZ3RfowWCrBll+LS0xCEDrKZ4J3Vylg9S3tPW3 +bcXM99fGHX8lJSJCp3mbomnGACLZ/Pw3HJdc+2bfdpzB7uEb/FBrOBPJqWTT/0ZV +dM8xk78CA2pkZ0LWvlZc0b2ToT06WQsR3Cppkms26fL1sutshBQTs08GHcw3yICP +CxKJ/yEsP0x6whMtt7X7y/QfW0FLAgeQQad/UAuVfqcX1aqoscxFOPYpVDx8jk9x +lrBiJi37HLKN4OyUE0R4ueKO+5TGQVZQh+1lnq61IseUp9rDklesLUecGB7tkgIz +6MVxyYiPspDqu7ndnBZB +=Zyax +-----END PGP SIGNATURE----- +--=-=-=-- -- 2.26.2