1 ## This file is part of GNU M4.
3 ## Copyright (C) 2000, 2001, 2003, 2004, 2005 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 of the License, or
8 ## (at your option) any later version.
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; see the file COPYING. If not, write to
17 ## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 ## Boston, MA 02110-1301, USA.
20 ## Written by Gary V. Vaughan <gary@gnu.org>
22 config_aux_dir = ltdl/config
23 config_macro_dir= ltdl/m4
25 SUBDIRS = ltdl po gnu .
27 ACLOCAL_AMFLAGS = -I ltdl/m4
28 AM_CPPFLAGS = -I. -I$(srcdir) \
29 -Ignu -I$(srcdir)/gnu \
32 AM_LDFLAGS = -no-undefined -export-dynamic
34 EXTRA_DIST = bootstrap $(config_aux_dir)/mkstamp
38 MAINTAINERCLEANFILES = \
39 ABOUT-NLS COPYING INSTALL Makefile.in aclocal.m4 \
40 config-h.in configure stamp-h.in \
41 po/cat-id-tbl.c po/m4.pot po/stamp-cat-id
45 # Using `cd' in backquotes may print the directory name, use this instead:
46 m4__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
48 # Make sure config.status is regenerated when the version timestamp changes
49 MKSTAMP = $(SHELL) $(srcdir)/$(config_aux_dir)/mkstamp
50 CONFIG_STATUS_DEPENDENCIES = stamp-vcl
51 stamp-vcl: vcl.tmp $(srcdir)/ChangeLog
53 @dir=.; test -f $$dir/stamp-vcl || dir=$(srcdir); \
54 set `$(MKSTAMP) < $(srcdir)/ChangeLog`; \
55 echo "$$1" > vcl.tmp; \
56 cmp -s vcl.tmp $$dir/stamp-vcl \
57 ## If mkstamp does not match $(srcdir)/stamp-vcl, we still put the new one
58 ## in the current dir, incase $(srcdir) is not writable. The dir selection
59 ## at the top of this rule takes care of prefering the right one on
61 || (echo "Updating stamp-vcl"; cp vcl.tmp ./stamp-vcl)
74 src/version-etc-fsf.c \
81 src_m4_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -I$(srcdir)/src $(LTDLINCL)
82 src_m4_LDFLAGS = $(AM_LDFLAGS) $(DLPREOPEN)
83 src_m4_LDADD = m4/libm4.la
84 src_m4_DEPENDENCIES = $(PREOPEN_DEPENDENCIES)
87 ## --- PASTED MANUALLY FROM GNULIB --- ##
88 ## To avoid adding unnecessary objects to libm4.la these gnulib ##
89 ## modules are not imported by gnulib-tool, but added manually. ##
90 ## (from: gnulib-tool --extract-automake-snippet getopt version-etc) ##
92 BUILT_SOURCES += src/$(GETOPT_H)
93 EXTRA_DIST += src/getopt_.h src/getopt_int.h
95 # We need the following in order to create an <getopt.h> when the
96 # system doesn't have one that works with the given compiler.
97 all-local: src/$(GETOPT_H)
98 src/getopt.h: src/getopt_.h
99 cp $(srcdir)/src/getopt_.h $@-t
101 MOSTLYCLEANFILES += src/getopt.h src/getopt.h-t
103 ## --- END OF PASTED GNULIB --- ##
110 pkgmodincludedir= $(includedir)/$(PACKAGE)/modules
111 pkglibexecdir = $(libexecdir)/$(PACKAGE)
113 ETAGS_ARGS = --regex='/M4BUILTIN_HANDLER[ \t]*)\([^)]*\)/\1/'
115 module_ldflags = -module
116 module_libadd = m4/libm4.la
118 pkgmodinclude_HEADERS = modules/m4.h
120 pkglibexec_LTLIBRARIES = \
124 modules/traditional.la
126 EXTRA_modules_gnu_la_SOURCES = modules/format.c
127 modules_gnu_la_LDFLAGS = $(module_ldflags)
128 modules_gnu_la_LIBADD = $(module_libadd)
129 EXTRA_DIST += $(EXTRA_modules_gnu_la_SOURCES)
131 modules_load_la_LDFLAGS = $(module_ldflags)
132 modules_load_la_LIBADD = $(module_libadd)
134 EXTRA_modules_m4_la_SOURCES = modules/evalparse.c
135 modules_m4_la_LDFLAGS = $(module_ldflags)
136 modules_m4_la_LIBADD = $(module_libadd)
137 EXTRA_DIST += $(EXTRA_modules_m4_la_SOURCES)
139 modules_traditional_la_LDFLAGS = $(module_ldflags)
140 modules_traditional_la_LIBADD = $(module_libadd)
143 pkglibexec_LTLIBRARIES += modules/mpeval.la
144 EXTRA_modules_mpeval_la_SOURCES = modules/evalparse.c
145 modules_mpeval_la_LDFLAGS = $(module_ldflags)
146 modules_mpeval_la_LIBADD = $(module_libadd)
149 ## Disabled for now. It is too fragile to be useful.
150 ## pkglibexec_LTLIBRARIES += modules/perl.la
151 ## modules_perl_la_CPPFLAGS = `$(PERL) -MExtUtils::Embed -e ccopts`
152 ## modules_perl_la_LDFLAGS = \
153 ## $(module_ldflags) `$(PERL) -MExtUtils::Embed -e ldopts`
154 ## modules_perl_la_LIBADD = $(module_libadd)
155 ## BUILT_SOURCES = perlxsi.c
156 ## DISTCLEANFILES += $(BUILT_SOURCES)
159 ## $(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c
161 module_check = -rpath /dev/null
162 check_LTLIBRARIES = \
169 modules_import_la_LDFLAGS = $(module_ldflags) $(module_check)
170 modules_import_la_LIBADD = $(module_libadd)
172 modules_modtest_la_LDFLAGS = $(module_ldflags) $(module_check)
173 modules_modtest_la_LIBADD = $(module_libadd)
175 modules_shadow_la_LDFLAGS = $(module_ldflags) $(module_check)
176 modules_shadow_la_LIBADD = $(module_libadd)
178 modules_stdlib_la_LDFLAGS = $(module_ldflags) $(module_check)
179 modules_stdlib_la_LIBADD = $(module_libadd)
181 modules_time_la_LDFLAGS = $(module_ldflags) $(module_check)
182 modules_time_la_LIBADD = $(module_libadd)
195 lib_LTLIBRARIES = m4/libm4.la
197 nobase_include_HEADERS = \
199 nobase_pkginclude_HEADERS = \
202 m4_libm4_la_SOURCES = \
217 m4_libm4_la_LIBADD = gnu/libgnu.la \
218 $(LIBLTDL) $(LTLIBINTL) $(LIBADD_DL)
219 m4_libm4_la_DEPENDENCIES = $(LIBLTDL)
222 echo "#define MODULE_PATH \"$(pkglibexecdir)\"" > m4/pathconf.h
224 MOSTLYCLEANFILES += m4/pathconf.h
225 BUILT_SOURCES += m4/pathconf.h
227 # This file needs to be regenerated at configure time.
229 rm -f $(distdir)/m4/system.h
230 EXTRA_DIST += m4/system_.h
238 cd ltdl && $(MAKE) $(MAKEFLAGS) libltdlc.la
244 info_TEXINFOS = doc/m4.texinfo
245 dist_man_MANS = $(srcdir)/doc/m4.1
247 $(srcdir)/doc/m4.1: doc/helptoman.pl src/m4
248 @if test -f src/m4; then \
249 echo "Updating the \`man' page \`$@'"; \
250 $(PERL) $(srcdir)/doc/helptoman.pl src/m4 > $@-tmp; \
251 cmp -s $@-tmp $(srcdir)/doc/$@ || cp $@-tmp $(srcdir)/doc/$@; \
254 echo "WARNING: The \`man' page \`$@' cannot be updated yet."; \
255 echo " Retry once the program executable will be ready."; \
258 ## Disabled for now. Clashes with earlier definition.
259 ## TAGS_FILES = $(infos_TEXINFOS)
260 ## TAGS_DEPENDENCIES = $(TAGS_FILES)
261 ## ETAGS_ARGS = --language=none --regex='/@node \([^,]*\)/\1/' $(TAGS_FILES)
263 EXTRA_DIST += doc/helptoman.pl
265 MAINTAINERCLEANFILES += $(dist_man_MANS)
273 examples/WWW/Makefile \
274 examples/WWW/_footer.htm \
275 examples/WWW/_header.htm \
276 examples/WWW/man/Makefile \
277 examples/WWW/m4lib/bugs.m4 \
278 examples/WWW/m4lib/changelog.m4 \
279 examples/WWW/m4lib/download.m4 \
280 examples/WWW/m4lib/features.m4 \
281 examples/WWW/m4lib/feedback.m4 \
282 examples/WWW/m4lib/html.m4 \
283 examples/WWW/m4lib/index.m4 \
284 examples/WWW/m4lib/layout.m4 \
285 examples/WWW/m4lib/lists.m4 \
286 examples/WWW/m4lib/menu.m4 \
287 examples/WWW/m4lib/modules.m4 \
288 examples/WWW/m4lib/news.m4 \
289 examples/WWW/m4lib/readme.m4 \
290 examples/WWW/m4lib/setup.m4 \
291 examples/WWW/m4lib/test.m4 \
292 examples/WWW/m4lib/thanks.m4 \
293 examples/WWW/m4lib/thissite.m4 \
294 examples/WWW/m4lib/tmpl.m4 \
295 examples/WWW/m4lib/todo.m4 \
296 examples/WWW/m4lib/uses.m4 \
297 examples/WWW/m4lib/visions.m4 \
298 examples/WWW/m4lib/whatis.m4
300 dist_pkgdata_DATA = \
301 examples/capitalize.m4 \
302 examples/comments.m4 \
303 examples/ddivert.m4 \
305 examples/esyscmd.m4 \
307 examples/foreach.m4 \
308 examples/forloop.m4 \
311 examples/incl-test.m4 \
312 examples/include.m4 \
315 examples/multiquotes.m4 \
316 examples/patsubst.m4 \
317 examples/pushpop.m4 \
319 examples/reverse.m4 \
320 examples/sysv-args.m4 \
322 examples/translit.m4 \
323 examples/undivert.incl \
324 examples/undivert.m4 \
331 TESTSUITE = tests/testsuite
341 EXTRA_DIST += $(TESTSUITE) $(TESTSUITE_AT) $(OTHER_FILES) \
346 # Be sure to reexport important environment variables:
347 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
348 CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
349 LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
350 OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" CONFIG_SHELL="$(SHELL)" \
351 CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
352 F77="$(F77)" FFLAGS="$(FFLAGS)" \
353 GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)"
355 # Using variables so that this snippet is not too wide and can
356 # be used as is in Texinfo @example/@end example.
357 m4_texinfo = $(srcdir)/doc/m4.texinfo
358 generate = $(AWK) -f $(srcdir)/tests/generate.awk
359 $(srcdir)/tests/generated.at: tests/generate.awk $(m4_texinfo)
360 $(generate) $(m4_texinfo) >$@t
363 check-recursive: $(srcdir)/$(TESTSUITE)
365 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
366 # how `testsuite' appears in our dependencies.
368 AUTOTEST = $(AUTOM4TE) --language=autotest
369 $(srcdir)/$(TESTSUITE): tests/package.m4 $(TESTSUITE_AT)
370 cd $(srcdir)/tests; \
371 $(AUTOTEST) -I $(srcdir)/tests testsuite.at -o testsuite
373 $(srcdir)/tests/package.m4: configure.ac
375 echo '# Signature of the current package.'; \
376 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
377 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
378 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
379 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
380 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
381 } > $(srcdir)/tests/package.m4
383 tests/atconfig: config.status
384 $(SHELL) ./config.status tests/atconfig
385 DISTCLEANFILES += tests/atconfig
387 CD_TESTDIR = abs_srcdir=`$(m4__cd) $(srcdir) && pwd`; cd tests
389 # Hook the test suite into the check rule
390 check-local: tests/atconfig $(srcdir)/$(TESTSUITE)
392 $(TESTS_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) $(TESTSUITE_FLAGS)
394 # Run the test suite on the *installed* tree.
397 $(TESTS_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) $(TESTSUITE_FLAGS) AUTOTEST_PATH=$(exec_prefix)/bin
399 # We need to remove any file droppings left behind by testsuite.
402 test -f $$abs_srcdir/$(TESTSUITE) && \
403 $(SHELL) $$abs_srcdir/$(TESTSUITE) --clean
405 OTHER_FILES = tests/iso8859.m4 tests/stackovf.test
407 DISTCLEANFILES += atconfig atlocal m4
408 MAINTAINERCLEANFILES += generated.at $(TESTSUITE)
411 ## --- RULES FOR THE MAINTAINER --- ##
412 ## You shouldn't need to touch anything below here. ##
413 ## (mostly copied from automake/Makefile.am) ##
416 CVS = cvs # set it to `:' to avoid CVS operations at dist time
418 # Tag before making distribution. Also, don't make a distribution if
419 # checks fail. Also, make sure the NEWS file is up-to-date.
420 cvs-dist: distcheck # maintainer-check
421 @if sed '1,2d;3q' $(srcdir)/NEWS | grep -e $(VERSION)" > dev/null; \
422 echo "NEWS not updated not releasing" 1>&2; \
426 $(CVS) -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
430 thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \
431 if test -z "$$OLDVERSION"; then \
432 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
433 else prevno="$$OLDVERSION"; fi; \
434 prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \
435 cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
436 > $(PACKAGE)-$$prevno-$(VERSION).diff