3 ## Copyright (C) 2002 Free Software Foundation, Inc.
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 ## ----------------- ##
22 ## Freeze M4 files. ##
23 ## ----------------- ##
27 # Do not use AUTOM4TE here, since Makefile.maint (my-distcheck)
28 # checks if we are independent of Autoconf by defining AUTOM4TE (and
29 # others) to `false'. But we _ship_ tests/autom4te, so it doesn't
31 MY_AUTOM4TE
= $(top_builddir
)/tests
/autom4te
32 $(MY_AUTOM4TE
): $(top_srcdir
)/tests
/wrapper.in
33 cd
$(top_builddir
)/tests
&& $(MAKE
) $(AM_MAKEFLAGS
) autom4te
35 AUTOM4TE_CFG
= $(top_builddir
)/lib
/autom4te.cfg
36 $(AUTOM4TE_CFG
): $(top_srcdir
)/lib
/autom4te.in
37 cd
$(top_builddir
)/lib
&& $(MAKE
) $(AM_MAKEFLAGS
) autom4te.cfg
39 # When processing the file with diversion disabled, there must be no
40 # output but comments and empty lines.
41 # If freezing produces output, something went wrong: a bad `divert',
42 # or an improper paren etc.
43 # It may happen that the output does not end with a end of line, hence
44 # force an end of line when reporting errors.
51 # Factor the dependencies between all the frozen files.
52 # Some day we should explain to Automake how to use autom4te to compute
54 src_libdir
= $(top_srcdir
)/lib
55 build_libdir
= $(top_builddir
)/lib
57 m4f_dependencies
= $(MY_AUTOM4TE
) $(AUTOM4TE_CFG
)
59 # For parallel builds.
60 $(build_libdir
)/m4sugar
/version.m4
:
61 cd
$(build_libdir
)/m4sugar
&& $(MAKE
) $(AM_MAKEFLAGS
) version.m4
63 m4sugar_m4f_dependencies
= \
65 $(src_libdir
)/m4sugar
/m4sugar.m4 \
66 $(build_libdir
)/m4sugar
/version.m4
68 m4sh_m4f_dependencies
= \
69 $(m4sugar_m4f_dependencies
) \
70 $(src_libdir
)/m4sugar
/m4sh.m4
72 autotest_m4f_dependencies
= \
73 $(m4sh_m4f_dependencies
) \
74 $(src_libdir
)/autotest
/autotest.m4 \
75 $(src_libdir
)/autotest
/general.m4
77 autoconf_m4f_dependencies
= \
78 $(m4sh_m4f_dependencies
) \
79 $(src_libdir
)/autoconf
/autoscan.m4 \
80 $(src_libdir
)/autoconf
/general.m4 \
81 $(src_libdir
)/autoconf
/autoheader.m4 \
82 $(src_libdir
)/autoconf
/autoupdate.m4 \
83 $(src_libdir
)/autoconf
/autotest.m4 \
84 $(src_libdir
)/autoconf
/status.m4 \
85 $(src_libdir
)/autoconf
/oldnames.m4 \
86 $(src_libdir
)/autoconf
/specific.m4 \
87 $(src_libdir
)/autoconf
/lang.m4 \
88 $(src_libdir
)/autoconf
/c.m4 \
89 $(src_libdir
)/autoconf
/fortran.m4 \
90 $(src_libdir
)/autoconf
/functions.m4 \
91 $(src_libdir
)/autoconf
/headers.m4 \
92 $(src_libdir
)/autoconf
/types.m4 \
93 $(src_libdir
)/autoconf
/libs.m4 \
94 $(src_libdir
)/autoconf
/programs.m4 \
95 $(src_libdir
)/autoconf
/autoconf.m4
98 ## --------------------------- ##
99 ## Run ETAGS on some M4 code. ##
100 ## --------------------------- ##
104 --regex
='/\(m4_define\|define\)(\[\([^]]*\)\]/\2/'
106 ETAGS_FOR_M4SUGAR
= \
108 --regex
='/m4_defun(\[\([^]]*\)\]/\1/'
110 ETAGS_FOR_AUTOCONF
= \
111 $(ETAGS_FOR_M4SUGAR
) \
112 --regex
='/\(A[CU]_DEFUN\|AU_ALIAS\)(\[\([^]]*\)\]/\2/' \
113 --regex
='/AN_\(FUNCTION\|HEADER\|IDENTIFIER\|LIBRARY\|MAKEVAR\|PROGRAM\)(\[\([^]]*\)\]/\2/'
116 ## -------------------------------- ##
117 ## Looking for forbidden patterns. ##
118 ## -------------------------------- ##
120 check-forbidden-patterns
:
121 if
(cd
$(srcdir) && \
122 grep
$(forbidden_patterns
) $(forbidden_patterns_files
)) \
123 >forbidden.log
; then \
124 echo
"ERROR: forbidden patterns were found:" >&2; \
125 sed
"s,^,$*.m4: ," <forbidden.log
>&2; \
129 rm -f forbidden.log
; \