1 ## Process this file with automake to create Makefile.in
3 ## Makefile for Automake.
5 ## Copyright 1995, 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2, or (at your option)
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 ## We need `.' in SUBDIRS because we want `check' to build `.' before
24 SUBDIRS = . m4 lib tests
26 bin_SCRIPTS = automake aclocal
27 info_TEXINFOS = automake.texi
30 TAGS_FILES = automake.in aclocal.in
32 # The following requires a fixed version of the Emacs 19.30 etags.
33 ETAGS_ARGS = --lang=none \
34 --regex='/^@node[ \t]+\([^,]+\)/\1/' $(srcdir)/automake.texi
35 TAGS_DEPENDENCIES = automake.texi
37 EXTRA_DIST = ChangeLog.1996 ChangeLog.1998 ChangeLog.2000
39 ## Make versioned links. We only run the transform on the root name;
40 ## then we make a versioned link with the transformed base name. This
41 ## seemed like the most reasonable approach.
44 @for p in $(bin_SCRIPTS); do \
45 f="`echo $$p|sed '$(transform)'`"; \
46 fv="$$f-$(APIVERSION)"; \
47 rm -f $(DESTDIR)$(bindir)/$$fv; \
48 echo " ln $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \
49 ln $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \
53 @for p in $(bin_SCRIPTS); do \
54 f="`echo $$p|sed '$(transform)'`"; \
55 fv="$$f-$(APIVERSION)"; \
56 rm -f $(DESTDIR)$(bindir)/$$fv; \
59 ################################################################
61 ## Everything past here is useful to the maintainer, but probably not
65 # Some simple checks, and then ordinary check. These are only really
66 # guaranteed to work on my machine.
67 maintainer-check: automake aclocal
68 ## This check avoids accidental configure substitutions in the source.
69 ## There are exactly 7 lines that should be modified. This works out
70 ## to 22 lines of diffs.
71 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
72 echo "found too many diffs between automake.in and automake"; 1>&2; \
73 diff -c $(srcdir)/automake.in automake; \
76 ## Syntax check with default Perl (on my machine, Perl 5).
77 perllibdir=$(srcdir)/lib $(PERL) -c -w automake
78 perllibdir=$(srcdir)/lib $(PERL) -c -w aclocal
79 ## expect no instances of '${...}'. However, $${...} is ok, since that
80 ## is a shell construct, not a Makefile construct.
81 ## The backslash in `$${' is needed for some versions of bash.
82 @if fgrep '\$${' $(srcdir)/lib/am/[a-z]*.am | \
83 fgrep -v '$$$$'; then \
84 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
87 ## Make sure `rm' is called with `-f'.
88 @if egrep '\<rm ([^-]|\-[^f ]*\>)' \
89 $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
91 echo "Suspicious 'rm' invocation." 1>&2; \
94 ## Make sure all invocations of mkinstalldirs are correct.
95 @if fgrep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
96 fgrep -v '$$(mkinstalldirs)'; then \
97 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
100 ## We never want to use "undef", only "delete", but for $/.
101 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
102 fgrep -v 'undef $$/'; then \
103 echo "Found undef in automake.in; use delete instead" 1>&2; \
106 ## We never want split (/ /,...), only split (' ', ...).
107 @if fgrep -n 'split (/ /' $(srcdir)/automake.in; then \
108 echo "Found bad split in the lines above." 1>&2; \
111 ## Look for cd within backquotes
112 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
113 $(srcdir)/lib/am/*.am; then \
114 echo "Consider using $$$$(am__cd) in the line above." 1>&2; \
117 ## Using @_ in a scalar context is most probably a programming error.
118 @if grep -Hn '[^) ] *= *@_' $(srcdir)/automake.in; then \
119 echo "Using @_ in a scalar context in the lines above." 1>&2; \
122 ## Forbid using parens with `local' to ease counting.
123 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
124 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
127 ## Up to now we manage to limit to 1 use of local, but for `local $_;'.
128 @locals=`grep -v '^[ \t]*local \$$_;' $(srcdir)/automake.in | \
129 grep -c '^[ \t]*local [^*]'`; \
132 echo "Wow, congrats! There are no \`local' now!." >&2; \
133 echo "Please update Makefile.am (maintainer-check)." >&2; \
138 echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \
139 echo "Up to now 1 was enough." >&2; \
143 ## Don't let AMDEP_TRUE substitution appear in automake.in.
144 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
145 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
149 # Tag before making distribution. Also, don't make a distribution if
150 # checks fail. Also, make sure the NEWS file is up-to-date.
151 cvs-dist: maintainer-check distcheck
152 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
153 echo "NEWS not updated; not releasing" 1>&2; \
156 cd $(srcdir) && cvs -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
160 thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \
161 if test -z "$$OLDVERSION"; then \
162 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
163 else prevno="$$OLDVERSION"; fi; \
164 prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \
165 cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
166 > $(PACKAGE)-$$prevno-$(VERSION).diff
168 ## Check our path lengths.
171 ## FIXME there's got to be a better way! pathchk should take the list
172 ## of files on stdin, at least.
173 find . -print | xargs pathchk -p); \
175 chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir); \
178 ## Program to use to fetch files.
181 ## Files that we fetch and which we compare against.
182 ## FIXME should be a lot more here
183 FETCHFILES = config.guess config.sub texinfo.tex
185 ## Fetch the latest versions of files we care about.
187 rm -rf Fetchdir > /dev/null 2>&1
189 ## If a get fails then that is a problem.
191 $(WGET) ftp://ftp.gnu.org/gnu/config/config.guess; \
192 $(WGET) ftp://ftp.gnu.org/gnu/config/config.sub; \
193 $(WGET) ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex)
194 ## Don't exit after test because we want to give as many errors as
196 @stat=0; for file in $(FETCHFILES); do \
197 if diff $(srcdir)/lib/$$file Fetchdir/$$file > /dev/null 2>&1; then :; \
200 echo "install Fetchdir/$$file into srcdir and commit"; \