Hi Aubrey,
Cc-ing the mailing list for the coding standards, and including your
msg below, so others can comment. Especially Ralf. Are you there, Ralf?
The "$(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@;" should not be in the
$(POST_INSTALL) section; only the "install-info" part should be.
That sounds right to me also.
Also, the target is "$(DESTDIR)$(infodir)/foo.info", but the line
"INSTALL_DATA" line calls out "$(DESTDIR)$@". How does `make' remove
the "DESTDIR" prefix but not the "infodir" prefix?
I believe the $(DESTDIR) in the INSTALL_DATA line:
$(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@; \
is a mistake and should be removed.
How should `$@' be prefixed in Makefiles?
As far as I know, it shouldn't be (as a matter of course). It just
expands to the target, whatever the target is.
Thanks,
Karl
Date: Mon, 08 Feb 2010 22:51:19 -0500 (EST)
From: Aubrey Jaffer <[email protected]>
To: [email protected] (Karl Berry)
Subject: standards.info
"standards.info" "7.2.6 Standard Targets for Users" clearly contains
errors:
Here is a sample rule to install an Info file:
$(DESTDIR)$(infodir)/foo.info: foo.info
$(POST_INSTALL)
# There may be a newer info file in . than in srcdir.
-if test -f foo.info; then d=.; \
else d=$(srcdir); fi; \
$(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@; \
# Run install-info only if it exists.
# Use `if' instead of just prepending `-' to the
# line so we notice real errors from install-info.
# We use `$(SHELL) -c' because some shells do not
# fail gracefully when there is an unknown command.
if $(SHELL) -c 'install-info --version' \
>/dev/null 2>&1; then \
install-info --dir-file=$(DESTDIR)$(infodir)/dir \
$(DESTDIR)$(infodir)/foo.info; \
else true; fi
The "$(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@;" should not be in the
$(POST_INSTALL) section; only the "install-info" part should be.
Also, the target is "$(DESTDIR)$(infodir)/foo.info", but the line
"INSTALL_DATA" line calls out "$(DESTDIR)$@". How does `make' remove
the "DESTDIR" prefix but not the "infodir" prefix?
How should `$@' be prefixed in Makefiles?