From owner-freebsd-current@FreeBSD.ORG Sat Jan 31 16:59:47 2015 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3402E2AB; Sat, 31 Jan 2015 16:59:47 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0145.outbound.protection.outlook.com [157.56.110.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0125A1BD; Sat, 31 Jan 2015 16:59:45 +0000 (UTC) Received: from BY2PR05CA060.namprd05.prod.outlook.com (10.141.250.50) by DM2PR05MB448.namprd05.prod.outlook.com (10.141.104.152) with Microsoft SMTP Server (TLS) id 15.1.75.20; Sat, 31 Jan 2015 16:59:42 +0000 Received: from BL2FFO11FD048.protection.gbl (2a01:111:f400:7c09::179) by BY2PR05CA060.outlook.office365.com (2a01:111:e400:2c5f::50) with Microsoft SMTP Server (TLS) id 15.1.75.20 via Frontend Transport; Sat, 31 Jan 2015 16:59:42 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BL2FFO11FD048.mail.protection.outlook.com (10.173.161.210) with Microsoft SMTP Server (TLS) id 15.1.75.11 via Frontend Transport; Sat, 31 Jan 2015 16:59:41 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Sat, 31 Jan 2015 08:59:40 -0800 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id t0VGxeW30009; Sat, 31 Jan 2015 08:59:40 -0800 (PST) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id C3BD0580A3; Sat, 31 Jan 2015 08:59:39 -0800 (PST) To: Julian Elischer Subject: Re: bmake and .USEBEFORE In-Reply-To: <54C878BD.1090805@freebsd.org> References: <54C876A1.20105@freebsd.org> <54C878BD.1090805@freebsd.org> Comments: In-reply-to: Julian Elischer message dated "Wed, 28 Jan 2015 13:50:53 +0800." From: "Simon J. Gerraty" X-Mailer: MH-E 8.0.3; nmh 1.3; GNU Emacs 22.3.1 Date: Sat, 31 Jan 2015 08:59:39 -0800 Message-ID: <20656.1422723579@chaos> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.16 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.16) smtp.mailfrom=sjg@juniper.net; freebsd.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(51704005)(24454002)(377454003)(479174004)(52314003)(47776003)(57986006)(76506005)(33716001)(19580395003)(46102003)(6806004)(50226001)(19580405001)(86362001)(117636001)(110136001)(106466001)(92566002)(450100001)(77156002)(62966003)(76176999)(50986999)(105596002)(87936001)(77096005)(2950100001)(50466002)(48376002)(142923001)(42262002)(62816006); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR05MB448; H:P-EMF02-SAC.jnpr.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB448; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:DM2PR05MB448; X-Forefront-PRVS: 0473A03F3F X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:DM2PR05MB448; X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2015 16:59:41.7004 (UTC) X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.16] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR05MB448 X-Mailman-Approved-At: Sat, 31 Jan 2015 18:06:32 +0000 Cc: "current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 16:59:47 -0000 Julian Elischer wrote: > On 1/28/15 1:41 PM, Julian Elischer wrote: > > If I try the following: > > > > bar: .USE > > @echo @ = $(@) > > all: bar > > @echo here is all > oops > the failing example should be .USEBEFORE.. I pasted the wrong clip. > > > > I always get "bar is up to date" If you put all: as the first target or add .MAIN: all or explicitly do make all you will get the output you expect. As is; 'bar' is the default target but it's .USEBEFORE which doesn't make a lot of sense (sort of being applied to itself ;-) It would probably make sense for .USE* to imply .NOTMAIN. Anyway, to illustrate the purpose of .USEBEFORE consider: --------------------8<-------------------- .MAIN: all u1: .USE @echo u1 $@ u2: .USE @echo u2 $@ ub: .USEBEFORE @echo; echo ub $@ all: foo1 foo2 foo3 foo1: u1 u2 ub foo2: u2 ub u1 foo3: u2 u1 ub --------------------8<-------------------- when this makefile is run the output is ub foo1 u1 foo1 u2 foo1 ub foo2 u2 foo2 u1 foo2 ub foo3 u2 foo3 u1 foo3 note that u1 and u2 are applied in the order given, but ub is always done first.