summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-02-04 23:04:18 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-02-13 17:46:26 +0100
commit283ded7f5b9b7ad97300293cd65f3f1b48c21115 (patch)
treea6602008cf901a41d6e153219724a48784e2c9ac /Makefile.am
parent6d9e9dd453944cd86ddc530a131bd338f4734638 (diff)
downloadautomake-283ded7f5b9b7ad97300293cd65f3f1b48c21115.tar.gz
build: auto-generate perl subroutines prototypes for automake and aclocal
This will allow us to avoid either using the '&foo' invocation form when invoking a subroutine before its definition, or having to maintain the list of prototypes by hand (with the risk of having it become incomplete or fall out-of-sync when future edits to the automake and aclocal scripts are done). * Makefile.am (automake, aclocal): Automatically generate a list of prototypes by looking at the subroutines definitions. * bootstrap.sh: Likewise, when generating the temporary automake and aclocal scripts used for bootstrapping. * automake.in: Add a placeholder that will be tracked by the new recipes and substituted with the computed prototypes. Remove existing prototypes, that are now superfluous. Some adjustments required by the new, more comprehensive prototypes declarations. * aclocal.in: Likewise. * maintainer/syntax-checks.mk (sc_diff_automake, sc_diff_aclocal): Adjust. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am13
1 files changed, 9 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index c245369ba..2e055612b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,13 +96,18 @@ uninstall-hook:
# $(datadir) or other do_subst'ituted variables change.
automake: automake.in
aclocal: aclocal.in
-automake aclocal: Makefile
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN)in=$@.in; $(do_subst) <$(srcdir)/$@.in >$@-t
+automake aclocal: Makefile lib/gen-perl-protos
+ $(AM_V_GEN)rm -f $@ $@-t $@-t2 \
+## Common substitutions.
+ && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
+## Auto-compute prototypes of perl subroutines.
+ && $(PERL) -w $(srcdir)/lib/gen-perl-protos $@-t > $@-t2 \
+ && mv -f $@-t2 $@-t \
## We can't use '$(generated_file_finalize)' here, because currently
## Automake contains occurrences of unexpanded @substitutions@ in
## comments, and that is perfectly legit.
- $(AM_V_at)chmod a+x,a-w $@-t && mv -f $@-t $@
+ && chmod a+x,a-w $@-t && mv -f $@-t $@
+EXTRA_DIST += lib/gen-perl-protos
# The master location for INSTALL is lib/INSTALL.
# This is where "make fetch" will install new versions.