Blame bin/Makefile.am

Packit 47b4ca
# Make Autoconf commands.
Packit 47b4ca
Packit 47b4ca
# Copyright (C) 1999-2007, 2009-2012 Free Software Foundation, Inc.
Packit 47b4ca
Packit 47b4ca
# This program is free software: you can redistribute it and/or modify
Packit 47b4ca
# it under the terms of the GNU General Public License as published by
Packit 47b4ca
# the Free Software Foundation, either version 3 of the License, or
Packit 47b4ca
# (at your option) any later version.
Packit 47b4ca
Packit 47b4ca
# This program is distributed in the hope that it will be useful,
Packit 47b4ca
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 47b4ca
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 47b4ca
# GNU General Public License for more details.
Packit 47b4ca
Packit 47b4ca
# You should have received a copy of the GNU General Public License
Packit 47b4ca
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 47b4ca
Packit 47b4ca
include ../lib/freeze.mk
Packit 47b4ca
Packit 47b4ca
bin_SCRIPTS = autom4te \
Packit 47b4ca
	      autoconf autoheader autoreconf ifnames autoscan autoupdate
Packit 47b4ca
Packit 47b4ca
EXTRA_DIST = autoconf.as autoheader.in autoreconf.in autoupdate.in ifnames.in \
Packit 47b4ca
	     autoscan.in autom4te.in
Packit 47b4ca
Packit 47b4ca
# Files that should be removed, but which Automake does not know.
Packit 47b4ca
MOSTLYCLEANFILES = $(bin_SCRIPTS) autoconf.in *.tmp
Packit 47b4ca
Packit 47b4ca
# Get the release year from ../ChangeLog.
Packit 47b4ca
RELEASE_YEAR = \
Packit 47b4ca
  `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
Packit 47b4ca
Packit 47b4ca
## ------------- ##
Packit 47b4ca
## The scripts.  ##
Packit 47b4ca
## ------------- ##
Packit 47b4ca
Packit 47b4ca
edit = sed \
Packit 47b4ca
	-e 's|@SHELL[@]|$(SHELL)|g' \
Packit 47b4ca
	-e 's|@PERL[@]|$(PERL)|g' \
Packit 47b4ca
	-e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
Packit 47b4ca
	-e 's|@bindir[@]|$(bindir)|g' \
Packit 47b4ca
	-e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
Packit 47b4ca
	-e 's|@prefix[@]|$(prefix)|g' \
Packit 47b4ca
	-e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
Packit 47b4ca
	-e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
Packit 47b4ca
	-e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
Packit 47b4ca
	-e 's|@M4[@]|$(M4)|g' \
Packit 47b4ca
	-e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
Packit 47b4ca
	-e 's|@M4_GNU[@]|$(M4_GNU)|g' \
Packit 47b4ca
	-e 's|@AWK[@]|$(AWK)|g' \
Packit 47b4ca
	-e 's|@RELEASE_YEAR[@]|'$(RELEASE_YEAR)'|g' \
Packit 47b4ca
	-e 's|@VERSION[@]|$(VERSION)|g' \
Packit 47b4ca
	-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
Packit 47b4ca
	-e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
Packit 47b4ca
Packit 47b4ca
$(top_builddir)/bin/autom4te: autom4te
Packit 47b4ca
Packit 47b4ca
# autoconf is written in M4sh.
Packit 47b4ca
# FIXME: this target should depend on the frozen files below lib/m4sugar,
Packit 47b4ca
# otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
Packit 47b4ca
# installation below the same $(prefix); work around this with --melt.
Packit 47b4ca
autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
Packit 47b4ca
	$(MY_AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/autoconf.as -o $@
Packit 47b4ca
Packit 47b4ca
## All the scripts depend on Makefile so that they are rebuilt when the
Packit 47b4ca
## prefix etc. changes.  It took quite a while to have the rule correct,
Packit 47b4ca
## don't break it!
Packit 47b4ca
## Use chmod -w to prevent people from editing the wrong file by accident.
Packit 47b4ca
$(bin_SCRIPTS): Makefile
Packit 47b4ca
	rm -f $@ $@.tmp
Packit 47b4ca
	srcdir=''; \
Packit 47b4ca
	  test -f ./$@.in || srcdir=$(srcdir)/; \
Packit 47b4ca
	  $(edit) $${srcdir}$@.in >$@.tmp
Packit 47b4ca
	chmod +x $@.tmp
Packit 47b4ca
	chmod a-w $@.tmp
Packit 47b4ca
	mv $@.tmp $@
Packit 47b4ca
Packit 47b4ca
autoconf: autoconf.in
Packit 47b4ca
autoheader: $(srcdir)/autoheader.in
Packit 47b4ca
autom4te: $(srcdir)/autom4te.in
Packit 47b4ca
autoreconf: $(srcdir)/autoreconf.in
Packit 47b4ca
autoscan: $(srcdir)/autoscan.in
Packit 47b4ca
autoupdate: $(srcdir)/autoupdate.in
Packit 47b4ca
ifnames: $(srcdir)/ifnames.in
Packit 47b4ca
Packit 47b4ca
Packit 47b4ca
## --------------- ##
Packit 47b4ca
## Building TAGS.  ##
Packit 47b4ca
## --------------- ##
Packit 47b4ca
Packit 47b4ca
TAGS_DEPENDENCIES = $(EXTRA_DIST)
Packit 47b4ca
Packit 47b4ca
letters = abcdefghijklmnopqrstuvwxyz
Packit 47b4ca
LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
Packit 47b4ca
DIGITS = 0123456789
Packit 47b4ca
WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
Packit 47b4ca
ETAGS_PERL = --lang=perl \
Packit 47b4ca
  autoheader.in autoreconf.in autoupdate.in autoscan.in autom4te.in \
Packit 47b4ca
  ifnames.in
Packit 47b4ca
ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
Packit 47b4ca
  autoconf.in
Packit 47b4ca
Packit 47b4ca
ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)