Date: Thu, 12 Jun 2003 21:48:38 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Ruslan Ermilov <ru@freebsd.org> Cc: current@freebsd.org Subject: Re: Makefile.yp aka /var/yp/Makefile.dist Message-ID: <20030613024838.GI53468@dan.emsphone.com> In-Reply-To: <20030611174551.GA14100@sunbay.com> References: <20030611174551.GA14100@sunbay.com>
index | next in thread | previous in thread | raw e-mail
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030613024838.GI53468>
