* Automake/: New directory.
[platform/upstream/automake.git] / lib / am / Makefile.am
1 ## Process this file with automake to create Makefile.in
2
3 AUTOMAKE_OPTIONS = gnits 1.4
4 MAINT_CHARSET = latin1
5
6 ## We need `.' in SUBDIRS because we want `check' to build `.' before
7 ## tests.
8 SUBDIRS = . m4 Automake tests
9
10 bin_SCRIPTS = automake aclocal
11 info_TEXINFOS = automake.texi
12
13
14 amdir = $(pkgdatadir)/am
15
16 dist_am_DATA = ansi2knr.am check.am clean-hdr.am clean.am compile.am \
17 configure.am data.am dejagnu.am depend.am depend2.am distdir.am \
18 ext-compile.am footer.am header-vars.am header.am install.am java.am \
19 lex.am library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \
20 mans-vars.am mans.am multilib.am program.am progs.am python.am \
21 remake-hdr.am scripts.am subdirs.am tags.am texi-vers.am texibuild.am \
22 texinfos.am yacc.am
23
24
25 dist_pkgdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1
26
27 ## These must all be executable when installed.  However, if we use
28 ## _SCRIPTS, then the program transform will be applied, which is not
29 ## what we want.  So we make them executable by hand.
30 scriptdir = $(pkgdatadir)
31 dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \
32 mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile
33
34 install-data-hook:
35         @$(POST_INSTALL)
36         @for prog in $(dist_script_DATA); do \
37           echo " chmod +x $(DESTDIR)$(scriptdir)/$$prog"; \
38           chmod +x $(DESTDIR)$(scriptdir)/$$prog; \
39         done
40
41 TAGS_FILES = automake.in aclocal.in $(amfiles)
42
43 # The following requires a fixed version of the Emacs 19.30 etags.
44 ETAGS_ARGS = --lang=none \
45  --regex='/^@node[ \t]+\([^,]+\)/\1/' $(srcdir)/automake.texi
46 TAGS_DEPENDENCIES = automake.texi
47
48 ## `test -x' is not portable.  So we use Perl instead.  If Perl
49 ## doesn't exist, then this test is meaningless anyway.
50 installcheck-local:
51         for file in $(dist_script_DATA); do \
52           $(PERL) -e "exit ! -x '$(pkgdatadir)/$$file';" || exit 1; \
53         done
54
55 EXTRA_DIST = ChangeLog.1996 ChangeLog.1998
56
57 ################################################################
58 ##
59 ## Everything past here is useful to the maintainer, but probably not
60 ## to anybody else
61 ##
62
63 # Some simple checks, and then ordinary check.  These are only really
64 # guaranteed to work on my machine.
65 maintainer-check: automake aclocal
66 ## This check avoids accidental configure substitutions in the source.
67 ## There are exactly 7 lines that should be modified.  This works out
68 ## to 22 lines of diffs.
69         @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 22; then \
70           echo "found too many diffs between automake.in and automake"; 1>&2; \
71           diff -c $(srcdir)/automake.in automake; \
72           exit 1; \
73         fi
74 ## Syntax check with default Perl (on my machine, Perl 5).
75         $(PERL) -c -w automake
76         $(PERL) -c -w aclocal
77 ## expect no instances of '${...}'.  However, $${...} is ok, since that
78 ## is a shell construct, not a Makefile construct.
79 ## The backslash in `$${' is needed for some versions of bash.
80         @if fgrep '\$${' $(srcdir)/[a-z]*.am | \
81                fgrep -v '$$$$'; then \
82           echo "Found too many uses of '\$${' in the lines above." 1>&2; \
83           exit 1;                               \
84         else :; fi
85 ## Make sure `rm' is called with `-f'.
86         @if egrep '\<rm ([^-]|\-[^f ]*\>)' \
87                   $(srcdir)/[a-z]*.am $(srcdir)/tests/*.test | \
88               fgrep -v '##'; then \
89           echo "Suspicious 'rm' invocation." 1>&2; \
90           exit 1;                               \
91         else :; fi
92 ## Make sure all invocations of mkinstalldirs are correct.
93         @if fgrep -n 'mkinstalldirs' $(srcdir)/[a-z]*.am | \
94               fgrep -v '$$(mkinstalldirs)'; then \
95           echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
96           exit 1; \
97         else :; fi
98 ## We never want to use "undef", only "delete", but for $/.
99         @if grep -n -w undef $(srcdir)/automake.in | \
100               fgrep -v 'undef $$/'; then \
101           echo "Found undef in automake.in; use delete instead" 1>&2; \
102           exit 1; \
103         fi
104 ## We never want split (/ /,...), only split (' ', ...).
105         @if fgrep -n 'split (/ /' $(srcdir)/automake.in; then \
106           echo "Found bad split in the lines above." 1>&2; \
107           exit 1; \
108         fi
109 ## Look for cd within backquotes without CDPATH=:
110         @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in $(srcdir)/*.am \
111               $(srcdir)/m4/*.m4; then \
112           echo "Consider setting CDPATH in the lines above" 1>&2; \
113           exit 1; \
114         fi
115 ## Using @_ in a scalar context is most probably a programming error.
116         @if grep -Hn '[^) ] *= *@_' $(srcdir)/automake.in; then \
117           echo "Using @_ in a scalar context in the lines above." 1>&2; \
118           exit 1; \
119         fi
120 ## Forbid using parens with `local' to ease counting.
121         @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
122           echo "Don't use \`local' with parens: use several \`local' above." >&2; \
123           exit 1; \
124         fi
125 ## Up to now we manage to limit to 1 use of local.
126         @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \
127         case $$locals in \
128           [0] ) \
129             echo "Wow, congrats!  There are no \`local' now!." >&2; \
130             echo "Please update Makefile.am (maintainer-check)." >&2; \
131             exit 1; \
132           ;; \
133           1 ) ;; \
134           * ) \
135             echo "Too many \`local'!  Are you sure you need $$locals of them?" >&2; \
136             echo "Up to now 1 was enough." >&2; \
137             exit 1; \
138           ;; \
139         esac
140
141 # Tag before making distribution.  Also, don't make a distribution if
142 # checks fail.  Also, make sure the NEWS file is up-to-date.
143 cvs-dist: maintainer-check distcheck
144         @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
145           echo "NEWS not updated; not releasing" 1>&2; \
146           exit 1;                               \
147         fi
148         cd $(srcdir) && cvs -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
149         $(MAKE) dist
150
151 cvs-diff:
152         thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \
153         if test -z "$$OLDVERSION"; then \
154           prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
155         else prevno="$$OLDVERSION"; fi; \
156         prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \
157         cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
158             > $(PACKAGE)-$$prevno-$(VERSION).diff
159
160 ## Check our path lengths.
161 path-check: distdir
162         (cd $(distdir) && \
163 ## FIXME there's got to be a better way!  pathchk should take the list
164 ## of files on stdin, at least.
165           find . -print | xargs pathchk -p); \
166           status=$$?; \
167           chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir); \
168           exit $$status
169
170 ## Program to use to fetch files.
171 WGET = wget
172
173 ## Files that we fetch and which we compare against.
174 ## FIXME should be a lot more here
175 FETCHFILES = config.guess config.sub
176
177 ## Fetch the latest versions of files we care about.
178 fetch:
179         rm -rf Fetchdir > /dev/null 2>&1
180         mkdir Fetchdir
181 ## If a get fails then that is a problem.
182         (cd Fetchdir && \
183         $(WGET) ftp://ftp.gnu.org/gnu/config/config.guess; \
184         $(WGET) ftp://ftp.gnu.org/gnu/config/config.sub)
185 ## Don't exit after test because we want to give as many errors as
186 ## possible.
187         @stat=0; for file in $(FETCHFILES); do \
188           if diff $(srcdir)/$$file Fetchdir/$$file > /dev/null 2>&1; then :; \
189           else \
190             stat=1; \
191             echo "install Fetchdir/$$file into srcdir and commit"; \
192           fi; \
193         done; exit $$stat