* tests/Makefile.am (TESTS): Removed dup.test.
[automake.git] / Makefile.am
blobca90339688664dab43482f3f96ea8c8b9b8758fb
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
6 ## tests.
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
25 ## to anybody else
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; \
37           exit 1; \
38         fi
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; \
48           exit 1;                               \
49         else :; fi
50 ## Make sure `rm' is called with `-f'.
51         @if egrep '\<rm ([^-]|\-[^f ]*\>)' \
52                   $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
53               fgrep -v '##'; then \
54           echo "Suspicious 'rm' invocation." 1>&2; \
55           exit 1;                               \
56         else :; fi
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; \
61           exit 1; \
62         else :; fi
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; \
67           exit 1; \
68         fi
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; \
72           exit 1; \
73         fi
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; \
78           exit 1; \
79         fi
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; \
83           exit 1; \
84         fi
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; \
88           exit 1; \
89         fi
90 ## Up to now we manage to limit to 1 use of local.
91         @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \
92         case $$locals in \
93           [0] ) \
94             echo "Wow, congrats!  There are no \`local' now!." >&2; \
95             echo "Please update Makefile.am (maintainer-check)." >&2; \
96             exit 1; \
97           ;; \
98           1 ) ;; \
99           * ) \
100             echo "Too many \`local'!  Are you sure you need $$locals of them?" >&2; \
101             echo "Up to now 1 was enough." >&2; \
102             exit 1; \
103           ;; \
104         esac
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; \
108           exit 1; \
109         fi
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; \
116           exit 1;                               \
117         fi
118         cd $(srcdir) && cvs -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
119         $(MAKE) dist
121 cvs-diff:
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.
131 path-check: distdir
132         (cd $(distdir) && \
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); \
136           status=$$?; \
137           chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir); \
138           exit $$status
140 ## Program to use to fetch files.
141 WGET = wget
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.
149 fetch:
150         rm -rf Fetchdir > /dev/null 2>&1
151         mkdir Fetchdir
152 ## If a get fails then that is a problem.
153         (cd Fetchdir && \
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
158 ## possible.
159         @stat=0; for file in $(FETCHFILES); do \
160           if diff $(srcdir)/lib/$$file Fetchdir/$$file > /dev/null 2>&1; then :; \
161           else \
162             stat=1; \
163             echo "install Fetchdir/$$file into srcdir and commit"; \
164           fi; \
165         done; exit $$stat