Makefile.yp aka /var/yp/Makefile.dist
Dan Nelson
dnelson at allantgroup.com
Thu Jun 12 19:48:40 PDT 2003
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 at allantgroup.com
More information about the freebsd-current
mailing list