+2002-09-05 Akim Demaille <akim@epita.fr>
+
+ * bin/Makefile.am (autoconf, autoheader, autoreconf, autoupdate)
+ (ifnames, autoscan, autom4te): Since we don't only depend on
+ configure.ac variables (such as VERSION etc.), but also on prefix
+ and so forth, depend on Makefile, not configure.ac.
+ Reported by Alexandre Duret-Lutz.
+ * doc/autoconf.texi (Installation Directory Variables): Adjust.
+
2002-09-05 Kevin Ryde <user42@zip.com.au>
- * hpmake/autoconf.texi (Limitations of Make): HP-UX trailing
- backslashes doesn't seem to be confined to ia64, just say "some
- versions".
+ * autoconf.texi (Limitations of Make): HP-UX trailing backslashes
+ doesn't seem to be confined to ia64, just say "some versions".
2002-09-04 Akim Demaille <akim@epita.fr>
$(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
$(AUTOM4SH) $(srcdir)/autoconf.as -o $@
-## All the files below depend on configure.ac so that they are rebuilt
-## when the Autoconf version changes. Unfortunately, suffix rules cannot
-## have additional dependencies, so we have to use explicit rules.
-
-
-autoconf: $(srcdir)/autoconf.in $(top_srcdir)/configure.ac
- rm -f autoconf autoconf.tmp
- $(edit) $(srcdir)/autoconf.in >autoconf.tmp
- chmod +x autoconf.tmp
- mv autoconf.tmp autoconf
-
-autoheader: $(srcdir)/autoheader.in $(top_srcdir)/configure.ac
- rm -f autoheader autoheader.tmp
- $(edit) $(srcdir)/autoheader.in >autoheader.tmp
- chmod +x autoheader.tmp
- mv autoheader.tmp autoheader
-
-autoreconf: $(srcdir)/autoreconf.in $(top_srcdir)/configure.ac
- rm -f autoreconf autoreconf.tmp
- $(edit) $(srcdir)/autoreconf.in >autoreconf.tmp
- chmod +x autoreconf.tmp
- mv autoreconf.tmp autoreconf
-
-autoupdate: $(srcdir)/autoupdate.in $(top_srcdir)/configure.ac
- rm -f autoupdate autoupdate.tmp
- $(edit) $(srcdir)/autoupdate.in >autoupdate.tmp
- chmod +x autoupdate.tmp
- mv autoupdate.tmp autoupdate
-
-ifnames: $(srcdir)/ifnames.in $(top_srcdir)/configure.ac
- rm -f ifnames ifnames.tmp
- $(edit) $(srcdir)/ifnames.in >ifnames.tmp
- chmod +x ifnames.tmp
- mv ifnames.tmp ifnames
-
-autoscan: $(srcdir)/autoscan.in $(top_srcdir)/configure.ac
- rm -f autoscan autoscan.tmp
- $(edit) $(srcdir)/autoscan.in >autoscan.tmp
- chmod +x autoscan.tmp
- mv autoscan.tmp autoscan
-
-autom4te: $(srcdir)/autom4te.in $(top_srcdir)/configure.ac
- rm -f autom4te autom4te.tmp
- $(edit) $(srcdir)/autom4te.in >autom4te.tmp
- chmod +x autom4te.tmp
- mv autom4te.tmp autom4te
+## All the files below depend on Makefile so that they are rebuilt
+## when the prefix etc. changes.
+SUFFIXES = .in
+autoconf autoheader autoreconf autoupdate ifnames autoscan autom4te: Makefile
+.in:
+ rm -f $@ $@.tmp
+ $(edit) $< >$@.tmp
+ chmod +x $@.tmp
+ mv $@.tmp $@
+
## --------------- ##
# autoconf is written in M4sh.
AUTOM4SH = $(top_builddir)/tests/autom4te --language M4sh
+SUFFIXES = .in
+
TAGS_DEPENDENCIES = $(EXTRA_DIST)
letters = abcdefghijklmnopqrstuvwxyz
all: all-am
.SUFFIXES:
+.SUFFIXES: .in
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu bin/Makefile
$(srcdir)/autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
$(AUTOM4SH) $(srcdir)/autoconf.as -o $@
-
-autoconf: $(srcdir)/autoconf.in $(top_srcdir)/configure.ac
- rm -f autoconf autoconf.tmp
- $(edit) $(srcdir)/autoconf.in >autoconf.tmp
- chmod +x autoconf.tmp
- mv autoconf.tmp autoconf
-
-autoheader: $(srcdir)/autoheader.in $(top_srcdir)/configure.ac
- rm -f autoheader autoheader.tmp
- $(edit) $(srcdir)/autoheader.in >autoheader.tmp
- chmod +x autoheader.tmp
- mv autoheader.tmp autoheader
-
-autoreconf: $(srcdir)/autoreconf.in $(top_srcdir)/configure.ac
- rm -f autoreconf autoreconf.tmp
- $(edit) $(srcdir)/autoreconf.in >autoreconf.tmp
- chmod +x autoreconf.tmp
- mv autoreconf.tmp autoreconf
-
-autoupdate: $(srcdir)/autoupdate.in $(top_srcdir)/configure.ac
- rm -f autoupdate autoupdate.tmp
- $(edit) $(srcdir)/autoupdate.in >autoupdate.tmp
- chmod +x autoupdate.tmp
- mv autoupdate.tmp autoupdate
-
-ifnames: $(srcdir)/ifnames.in $(top_srcdir)/configure.ac
- rm -f ifnames ifnames.tmp
- $(edit) $(srcdir)/ifnames.in >ifnames.tmp
- chmod +x ifnames.tmp
- mv ifnames.tmp ifnames
-
-autoscan: $(srcdir)/autoscan.in $(top_srcdir)/configure.ac
- rm -f autoscan autoscan.tmp
- $(edit) $(srcdir)/autoscan.in >autoscan.tmp
- chmod +x autoscan.tmp
- mv autoscan.tmp autoscan
-
-autom4te: $(srcdir)/autom4te.in $(top_srcdir)/configure.ac
- rm -f autom4te autom4te.tmp
- $(edit) $(srcdir)/autom4te.in >autom4te.tmp
- chmod +x autom4te.tmp
- mv autom4te.tmp autom4te
+autoconf autoheader autoreconf autoupdate ifnames autoscan autom4te: Makefile
+.in:
+ rm -f $@ $@.tmp
+ $(edit) $< >$@.tmp
+ chmod +x $@.tmp
+ mv $@.tmp $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Similarly you should not rely on @code{AC_OUTPUT_FILES} to replace
@code{datadir} and friends in your shell scripts and other files, rather
let @command{make} manage their replacement. For instance Autoconf
-ships templates of its shell scripts ending with @samp{.sh}, and uses
-this Makefile snippet:
+ships templates of its shell scripts ending with @samp{.in}, and uses a
+Makefile snippet similar to:
@example
-.sh:
+@group
+edit = sed \
+ -e 's,@@datadir\@@,$(pkgdatadir),g' \
+ -e 's,@@prefix\@@,$(prefix),g'
+@end group
+
+autoconf autoheader: Makefile
+@group
+.in:
rm -f $@@ $@@.tmp
- sed 's,@@datadir\@@,$(pkgdatadir),g' $< >$@@.tmp
+ $(edit) $< >$@@.tmp
chmod +x $@@.tmp
mv $@@.tmp $@@
+@end group
@end example
-Three things are noteworthy:
+Five details are noteworthy:
@table @samp
@item @@datadir\@@
Don't use @samp{/} in the sed expression(s) since most probably the
variables you use, such as @samp{$(pkgdatadir)}, will contain
some.
+
+@item Dependency on @file{Makefile}
+Since @code{edit} uses values that depend on the configuration specific
+values (@code{prefix} etc.) and not only on @code{VERSION} and so forth,
+the output depends on @file{Makefile}, not @file{configure.ac}.
+
+@item Separated dependency
+Don't write
+
+@example
+.in: Makefile
+ @dots{}
+@end example
+
+@noindent
+unless you really mean to create the file @file{.in} from @file{Makefile}.
@end table