Skip to content

Commit

Permalink
build: no more make recursion for 'bin' subdir
Browse files Browse the repository at this point in the history
* Makefile.am (MOSTLYCLEANFILES): New, to be extended later by
included files.
($(srcdir)/doc/local.mk): New include.
(SUBDIRS): Drop 'bin'.  Adjust comments.
* bin/Makefile.am: Rename ...
* bin/local.mk: ... like this, and adjust.
* configure.ac (AC_CONFIG_FILES): Drop 'bin/Makefile'.

Signed-off-by: Stefano Lattarini <[email protected]>
  • Loading branch information
slattarini committed May 6, 2013
1 parent ac62b53 commit 097b14e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 26 deletions.
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# bin/ must be run first, as it builds executables needed for tests.
# autom4te uses autotest.m4f to generate 'testsuite', so build tests last.
# Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
SUBDIRS = bin . lib tests man
SUBDIRS = . lib tests man

ACLOCAL_AMFLAGS = -I m4

MOSTLYCLEANFILES =

EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
BUGS COPYINGv3 COPYING.EXCEPTION \
GNUmakefile maint.mk cfg.mk \
Expand Down Expand Up @@ -102,6 +103,7 @@ dist-hook: gen-ChangeLog
distclean-local:
if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
include $(srcdir)/bin/local.mk
include $(srcdir)/doc/local.mk
# Perl coverage statistics.
Expand Down
62 changes: 39 additions & 23 deletions bin/Makefile.am → bin/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,30 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

include ../lib/freeze.mk

bin_SCRIPTS = autom4te \
autoconf autoheader autoreconf ifnames autoscan autoupdate

EXTRA_DIST = autoconf.as autoheader.in autoreconf.in autoupdate.in ifnames.in \
autoscan.in autom4te.in
include $(srcdir)/lib/freeze.mk

bin_SCRIPTS = \
bin/autoconf \
bin/autoheader \
bin/autom4te \
bin/autoreconf \
bin/autoscan \
bin/autoupdate \
bin/ifnames

EXTRA_DIST += \
bin/autoconf.as \
bin/autoheader.in \
bin/autom4te.in \
bin/autoreconf.in \
bin/autoscan.in \
bin/autoupdate.in \
bin/ifnames.in

# Files that should be removed, but which Automake does not know.
MOSTLYCLEANFILES = $(bin_SCRIPTS) autoconf.in *.tmp
MOSTLYCLEANFILES += $(bin_SCRIPTS) bin/autoconf.in bin/*.tmp

# Get the release year from ../ChangeLog.
# Get the release year from ChangeLog.
RELEASE_YEAR = \
`sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`

Expand All @@ -53,35 +65,35 @@ edit = sed \
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'

$(top_builddir)/bin/autom4te: autom4te

# autoconf is written in M4sh.
# FIXME: this target should depend on the frozen files below lib/m4sugar,
# otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
# installation below the same $(prefix); work around this with --melt.
autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
$(MY_AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/autoconf.as -o $@
bin/autoconf.in: $(srcdir)/bin/autoconf.as $(m4sh_m4f_dependencies)
$(MY_AUTOM4TE) --language M4sh --cache '' \
--melt $(srcdir)/bin/autoconf.as -o $@

## All the scripts depend on Makefile so that they are rebuilt when the
## prefix etc. changes. It took quite a while to have the rule correct,
## don't break it!
## Use chmod -w to prevent people from editing the wrong file by accident.
$(bin_SCRIPTS): Makefile
rm -f $@ $@.tmp
$(MKDIR_P) $(@D)
srcdir=''; \
test -f ./$@.in || srcdir=$(srcdir)/; \
$(edit) $${srcdir}$@.in >$@.tmp
chmod +x $@.tmp
chmod a-w $@.tmp
mv $@.tmp $@

autoconf: autoconf.in
autoheader: $(srcdir)/autoheader.in
autom4te: $(srcdir)/autom4te.in
autoreconf: $(srcdir)/autoreconf.in
autoscan: $(srcdir)/autoscan.in
autoupdate: $(srcdir)/autoupdate.in
ifnames: $(srcdir)/ifnames.in
bin/autoconf: bin/autoconf.in
bin/autoheader: $(srcdir)/bin/autoheader.in
bin/autom4te: $(srcdir)/bin/autom4te.in
bin/autoreconf: $(srcdir)/bin/autoreconf.in
bin/autoscan: $(srcdir)/bin/autoscan.in
bin/autoupdate: $(srcdir)/bin/autoupdate.in
bin/ifnames: $(srcdir)/bin/ifnames.in


## --------------- ##
Expand All @@ -95,9 +107,13 @@ LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
DIGITS = 0123456789
WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
ETAGS_PERL = --lang=perl \
autoheader.in autoreconf.in autoupdate.in autoscan.in autom4te.in \
ifnames.in
bin/autoheader.in \
bin/autoreconf.in \
bin/autoupdate.in \
bin/autoscan.in \
bin/autom4te.in \
bin/ifnames.in
ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
autoconf.in
bin/autoconf.in

ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ AC_CONFIG_FILES([Makefile
lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
lib/m4sugar/Makefile
lib/autoconf/Makefile lib/autotest/Makefile
bin/Makefile])
])

AC_OUTPUT
# Report the state of this version of Autoconf if this is a beta.
Expand Down

0 comments on commit 097b14e

Please sign in to comment.