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