From owner-freebsd-current@FreeBSD.ORG Thu Jun 12 19:48:40 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DFA837B401; Thu, 12 Jun 2003 19:48:40 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D77D43FD7; Thu, 12 Jun 2003 19:48:39 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h5D2mcth062722; Thu, 12 Jun 2003 21:48:38 -0500 (CDT) (envelope-from dan) Date: Thu, 12 Jun 2003 21:48:38 -0500 From: Dan Nelson To: Ruslan Ermilov Message-ID: <20030613024838.GI53468@dan.emsphone.com> References: <20030611174551.GA14100@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030611174551.GA14100@sunbay.com> X-OS: FreeBSD 5.1-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: Bill Paul cc: current@freebsd.org Subject: Re: Makefile.yp aka /var/yp/Makefile.dist X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.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: Fri, 13 Jun 2003 02:48:40 -0000 In the last episode (Jun 11), Ruslan Ermilov said: > Just as a precaution, does anyone have any objections to my removing > of these funny $^ sequences from Makefile.yp? They were apparently > used to insert something into the map generation pipeline just before > the yp_mkdb(8) invokation, but recent additions to this file did not > follow this "rule". > > ypservers: $(YPSERVERS) > @echo "Updating $@..." > $(CAT) $(YPSERVERS) | \ > - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' $^ \ > + $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \ > | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \ > $(RMV) $(TMP) $@ > @$(DBLOAD) -c $^ is gmake syntax for "all prerequisites", but bsd make has never recognized that particular variable, so afaik it has always been ignored (rev 1.1 even has them). There's also a useless use of cat in there. If you wanted, you could do something like this (for all targets except netgroup, which calls revnetgroup inbetween cat and awk): ypservers: $(YPSERVERS) @echo "Updating $@..." - $(CAT) $(YPSERVERS) | \ - $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' $^ \ + $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' $(YPSERVERS) \ | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \ $(RMV) $(TMP) $@ @$(DBLOAD) -c -- Dan Nelson dnelson@allantgroup.com