1 ## Process this file with automake to create Makefile.in
3 AUTOMAKE_OPTIONS = 1.4 dist-bzip2
5 ## We need `.' in SUBDIRS because we want `check' to build `.' before
7 SUBDIRS = . m4 lib tests
9 bin_SCRIPTS = automake aclocal
10 info_TEXINFOS = automake.texi
13 TAGS_FILES = automake.in aclocal.in
15 # The following requires a fixed version of the Emacs 19.30 etags.
16 ETAGS_ARGS = --lang=none \
17 --regex='/^@node[ \t]+\([^,]+\)/\1/' $(srcdir)/automake.texi
18 TAGS_DEPENDENCIES = automake.texi
20 EXTRA_DIST = ChangeLog.1996 ChangeLog.1998 ChangeLog.2000
22 ################################################################
24 ## Everything past here is useful to the maintainer, but probably not
28 # Some simple checks, and then ordinary check. These are only really
29 # guaranteed to work on my machine.
30 maintainer-check: automake aclocal
31 ## This check avoids accidental configure substitutions in the source.
32 ## There are exactly 7 lines that should be modified. This works out
33 ## to 22 lines of diffs.
34 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
35 echo "found too many diffs between automake.in and automake"; 1>&2; \
36 diff -c $(srcdir)/automake.in automake; \
39 ## Syntax check with default Perl (on my machine, Perl 5).
40 perllibdir=$(srcdir)/lib $(PERL) -c -w automake
41 perllibdir=$(srcdir)/lib $(PERL) -c -w aclocal
42 ## expect no instances of '${...}'. However, $${...} is ok, since that
43 ## is a shell construct, not a Makefile construct.
44 ## The backslash in `$${' is needed for some versions of bash.
45 @if fgrep '\$${' $(srcdir)/lib/am/[a-z]*.am | \
46 fgrep -v '$$$$'; then \
47 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
50 ## Make sure `rm' is called with `-f'.
51 @if egrep '\<rm ([^-]|\-[^f ]*\>)' \
52 $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
54 echo "Suspicious 'rm' invocation." 1>&2; \
57 ## Make sure all invocations of mkinstalldirs are correct.
58 @if fgrep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
59 fgrep -v '$$(mkinstalldirs)'; then \
60 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
63 ## We never want to use "undef", only "delete", but for $/.
64 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
65 fgrep -v 'undef $$/'; then \
66 echo "Found undef in automake.in; use delete instead" 1>&2; \
69 ## We never want split (/ /,...), only split (' ', ...).
70 @if fgrep -n 'split (/ /' $(srcdir)/automake.in; then \
71 echo "Found bad split in the lines above." 1>&2; \
74 ## Look for cd within backquotes without CDPATH=:
75 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
76 $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
77 echo "Consider setting CDPATH in the lines above" 1>&2; \
80 ## Using @_ in a scalar context is most probably a programming error.
81 @if grep -Hn '[^) ] *= *@_' $(srcdir)/automake.in; then \
82 echo "Using @_ in a scalar context in the lines above." 1>&2; \
85 ## Forbid using parens with `local' to ease counting.
86 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
87 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
90 ## Up to now we manage to limit to 1 use of local.
91 @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \
94 echo "Wow, congrats! There are no \`local' now!." >&2; \
95 echo "Please update Makefile.am (maintainer-check)." >&2; \
100 echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \
101 echo "Up to now 1 was enough." >&2; \
105 ## Don't let AMDEP_TRUE substitution appear in automake.in.
106 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
107 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
111 # Tag before making distribution. Also, don't make a distribution if
112 # checks fail. Also, make sure the NEWS file is up-to-date.
113 cvs-dist: maintainer-check distcheck
114 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
115 echo "NEWS not updated; not releasing" 1>&2; \
118 cd $(srcdir) && cvs -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
122 thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \
123 if test -z "$$OLDVERSION"; then \
124 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
125 else prevno="$$OLDVERSION"; fi; \
126 prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \
127 cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
128 > $(PACKAGE)-$$prevno-$(VERSION).diff
130 ## Check our path lengths.
133 ## FIXME there's got to be a better way! pathchk should take the list
134 ## of files on stdin, at least.
135 find . -print | xargs pathchk -p); \
137 chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir); \
140 ## Program to use to fetch files.
143 ## Files that we fetch and which we compare against.
144 ## FIXME should be a lot more here
145 ## Sadly we can't fetch ansi2knr.1 from the same location :-(
146 FETCHFILES = config.guess config.sub ansi2knr.c
148 ## Fetch the latest versions of files we care about.
150 rm -rf Fetchdir > /dev/null 2>&1
152 ## If a get fails then that is a problem.
154 $(WGET) ftp://ftp.gnu.org/gnu/config/config.guess; \
155 $(WGET) ftp://ftp.gnu.org/gnu/config/config.sub; \
156 $(WGET) ftp://ftp.cs.wisc.edu/ghost/ansi2knr.c)
157 ## Don't exit after test because we want to give as many errors as
159 @stat=0; for file in $(FETCHFILES); do \
160 if diff $(srcdir)/lib/$$file Fetchdir/$$file > /dev/null 2>&1; then :; \
163 echo "install Fetchdir/$$file into srcdir and commit"; \