1 ## Makefile.am - template for generating Makefile via Automake
3 ## Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008 Free
4 ## Software Foundation, Inc.
6 ## This file is part of GNU M4.
8 ## GNU M4 is free software: you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation, either version 3 of the License, or
11 ## (at your option) any later version.
13 ## GNU M4 is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU General Public License for more details.
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
21 ## Written by Gary V. Vaughan <gary@gnu.org>
23 config_aux_dir = build-aux
24 config_macro_dir= ltdl/m4
26 SUBDIRS = po gnu tests/gnu .
28 ACLOCAL_AMFLAGS = -I ltdl/m4
29 AUTOMAKE_OPTIONS = nostdinc
31 # Prime the variables that will be augmented by libtool.
32 # FIXME - the -export-symbols-regex ".*" is a hack to work around the
33 # fact that on cygwin, the convenience library libltdl exports symbols,
34 # which effectively disables the auto-exporting of all other symbols.
35 # Revisit this if libtool on cygwin improves.
36 # See http://lists.gnu.org/archive/html/libtool-patches/2007-02/msg00062.html
38 AM_LDFLAGS = -export-dynamic -export-symbols-regex ".*"
50 # Include Libtool's rules.
51 include ltdl/Makefile.inc
53 # Additional configuration.
54 AM_CPPFLAGS += -Ignu -I$(srcdir)/gnu \
56 EXTRA_DIST += bootstrap \
57 $(config_aux_dir)/mkstamp \
58 $(config_macro_dir)/gnulib-cache.m4
59 MAINTAINERCLEANFILES = \
60 ABOUT-NLS COPYING INSTALL Makefile.in aclocal.m4 \
61 config-h.in configure stamp-h.in \
62 po/cat-id-tbl.c po/m4.pot po/stamp-cat-id
64 MKSTAMP = $(SHELL) $(srcdir)/$(config_aux_dir)/mkstamp
66 # Make sure config.status is regenerated when the version timestamp changes
67 CONFIG_STATUS_DEPENDENCIES = ChangeLog
80 src/version-etc-fsf.c \
92 src_m4_SOURCES += src/stackovf.c
94 src_m4_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -I$(srcdir)/src
95 src_m4_LDFLAGS = $(AM_LDFLAGS) $(DLPREOPEN)
96 src_m4_LDADD = m4/libm4.la
97 src_m4_DEPENDENCIES = $(PREOPEN_DEPENDENCIES) m4/libm4.la
100 ## --- PASTED MANUALLY FROM GNULIB --- ##
101 ## To avoid adding unnecessary objects to libm4.la these gnulib ##
102 ## modules are not imported by gnulib-tool, but added manually. ##
103 ## (from: gnulib-tool --extract-automake-snippet getopt version-etc) ##
105 BUILT_SOURCES += src/$(GETOPT_H)
106 EXTRA_DIST += src/getopt.in.h src/getopt_int.h
108 # We need the following in order to create an <getopt.h> when the
109 # system doesn't have one that works with the given compiler.
110 all-local: src/$(GETOPT_H)
111 src/getopt.h: src/getopt.in.h
112 cp $(srcdir)/src/getopt.in.h $@-t
114 MOSTLYCLEANFILES += src/getopt.h src/getopt.h-t
116 ## --- END OF PASTED GNULIB --- ##
123 pkgmodincludedir= $(pkgincludedir)/modules
125 ETAGS_ARGS = --regex='/M4BUILTIN_HANDLER[ \t]*)\([^)]*\)/\1/'
127 module_ldflags = -module $(AM_LDFLAGS)
128 module_libadd = m4/libm4.la
130 pkgmodinclude_HEADERS = modules/m4.h
132 pkglibexec_LTLIBRARIES = \
136 modules/traditional.la
138 EXTRA_modules_gnu_la_SOURCES = modules/format.c
139 modules_gnu_la_LDFLAGS = $(module_ldflags)
140 modules_gnu_la_LIBADD = $(module_libadd)
141 EXTRA_DIST += $(EXTRA_modules_gnu_la_SOURCES)
143 modules_load_la_LDFLAGS = $(module_ldflags)
144 modules_load_la_LIBADD = $(module_libadd)
146 EXTRA_modules_m4_la_SOURCES = modules/evalparse.c
147 modules_m4_la_LDFLAGS = $(module_ldflags)
148 modules_m4_la_LIBADD = $(module_libadd)
149 EXTRA_DIST += $(EXTRA_modules_m4_la_SOURCES)
151 modules_traditional_la_LDFLAGS = $(module_ldflags)
152 modules_traditional_la_LIBADD = $(module_libadd)
155 pkglibexec_LTLIBRARIES += modules/mpeval.la
156 EXTRA_modules_mpeval_la_SOURCES = modules/evalparse.c
157 modules_mpeval_la_LDFLAGS = $(module_ldflags)
158 modules_mpeval_la_LIBADD = $(module_libadd) $(LIBADD_GMP)
161 ## Disabled for now. It is too fragile to be useful.
162 ## pkglibexec_LTLIBRARIES += modules/perl.la
163 ## modules_perl_la_CPPFLAGS = `$(PERL) -MExtUtils::Embed -e ccopts`
164 ## modules_perl_la_LDFLAGS = \
165 ## $(module_ldflags) `$(PERL) -MExtUtils::Embed -e ldopts`
166 ## modules_perl_la_LIBADD = $(module_libadd)
167 ## BUILT_SOURCES = perlxsi.c
168 ## DISTCLEANFILES += $(BUILT_SOURCES)
171 ## $(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c
173 ## but we should still distribute it, because it is listed in POTFILES.in:
174 EXTRA_DIST += modules/perl.c
176 module_check = -rpath /dev/null
177 check_LTLIBRARIES = \
184 tests_import_la_LDFLAGS = $(module_ldflags) $(module_check)
185 tests_import_la_LIBADD = $(module_libadd)
186 tests_import_la_SOURCES = modules/import.c
188 tests_modtest_la_LDFLAGS = $(module_ldflags) $(module_check)
189 tests_modtest_la_LIBADD = $(module_libadd)
190 tests_modtest_la_SOURCES = modules/modtest.c
192 tests_shadow_la_LDFLAGS = $(module_ldflags) $(module_check)
193 tests_shadow_la_LIBADD = $(module_libadd)
194 tests_shadow_la_SOURCES = modules/shadow.c
196 tests_stdlib_la_LDFLAGS = $(module_ldflags) $(module_check)
197 tests_stdlib_la_LIBADD = $(module_libadd)
198 tests_stdlib_la_SOURCES = modules/stdlib.c
200 tests_time_la_LDFLAGS = $(module_ldflags) $(module_check)
201 tests_time_la_LIBADD = $(module_libadd)
202 tests_time_la_SOURCES = modules/time.c
215 lib_LTLIBRARIES += m4/libm4.la
217 nobase_include_HEADERS = \
219 nobase_pkginclude_HEADERS = \
222 m4_libm4_la_SOURCES = \
237 m4_libm4_la_LIBADD = gnu/libgnu.la \
238 $(LIBLTDL) $(LTLIBINTL) $(LIBADD_DL)
239 m4_libm4_la_DEPENDENCIES = $(LTDLDEPS) gnu/libgnu.la
241 # This file needs to be regenerated at configure time.
243 rm -f $(distdir)/m4/system.h
244 EXTRA_DIST += m4/system_.h
251 info_TEXINFOS = doc/m4.texinfo
252 doc_m4_TEXINFOS = doc/regexprops-generic.texi doc/fdl.texi doc/gpl-3.0.texi
253 dist_man_MANS = $(srcdir)/doc/m4.1
254 EXTRA_DIST += $(config_aux_dir)/gendocs.sh doc/gendocs_template
255 MAINTAINERCLEANFILES += $(config_aux_dir)/gendocs.sh doc/gendocs_template \
257 HELP2MAN = $(SHELL) $(srcdir)/$(config_aux_dir)/missing --run help2man
259 # Build the man page once in the srcdir, rather than in every VPATH build
260 # dir, to match how automake builds info pages. This is safe for 'make
261 # distcheck' since it is distributed pre-built.
262 $(srcdir)/doc/m4.1: configure.ac src/main.c
263 @if test -f src/m4$(EXEEXT); then \
264 echo "Updating the \`man' page \`$@'"; \
265 $(HELP2MAN) --name="macro processor" --source=FSF \
266 --info-page=m4 --output=$@ src/m4$(EXEEXT); \
268 echo "WARNING: The \`man' page \`$@' cannot be updated yet."; \
269 echo " Retry once the program executable is ready."; \
272 ## Disabled for now. Clashes with earlier definition.
273 ## TAGS_FILES = $(infos_TEXINFOS)
274 ## TAGS_DEPENDENCIES = $(TAGS_FILES)
275 ## ETAGS_ARGS = --language=none --regex='/@node \([^,]*\)/\1/' $(TAGS_FILES)
277 MAINTAINERCLEANFILES += $(dist_man_MANS)
285 examples/WWW/Makefile \
286 examples/WWW/_footer.htm \
287 examples/WWW/_header.htm \
288 examples/WWW/m4lib/bugs.m4 \
289 examples/WWW/m4lib/changelog.m4 \
290 examples/WWW/m4lib/download.m4 \
291 examples/WWW/m4lib/features.m4 \
292 examples/WWW/m4lib/feedback.m4 \
293 examples/WWW/m4lib/html.m4 \
294 examples/WWW/m4lib/index.m4 \
295 examples/WWW/m4lib/layout.m4 \
296 examples/WWW/m4lib/lists.m4 \
297 examples/WWW/m4lib/menu.m4 \
298 examples/WWW/m4lib/modules.m4 \
299 examples/WWW/m4lib/news.m4 \
300 examples/WWW/m4lib/readme.m4 \
301 examples/WWW/m4lib/setup.m4 \
302 examples/WWW/m4lib/test.m4 \
303 examples/WWW/m4lib/thanks.m4 \
304 examples/WWW/m4lib/thissite.m4 \
305 examples/WWW/m4lib/tmpl.m4 \
306 examples/WWW/m4lib/todo.m4 \
307 examples/WWW/m4lib/uses.m4 \
308 examples/WWW/m4lib/visions.m4 \
309 examples/WWW/m4lib/whatis.m4
311 dist_pkgdata_DATA = \
312 examples/capitalize.m4 \
313 examples/capitalize2.m4 \
314 examples/comments.m4 \
315 examples/ddivert.m4 \
317 examples/esyscmd.m4 \
319 examples/foreach.m4 \
320 examples/foreach2.m4 \
321 examples/foreachq.m4 \
322 examples/foreachq2.m4 \
323 examples/foreachq3.m4 \
324 examples/forloop.m4 \
325 examples/forloop2.m4 \
328 examples/incl-test.m4 \
330 examples/include.m4 \
334 examples/multiquotes.m4 \
335 examples/patsubst.m4 \
336 examples/pushpop.m4 \
339 examples/reverse.m4 \
340 examples/sysv-args.m4 \
342 examples/translit.m4 \
343 examples/undivert.incl \
344 examples/undivert.m4 \
351 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
352 # how `testsuite' appears in our dependencies.
353 TESTSUITE = $(srcdir)/tests/testsuite
364 EXTRA_DIST += $(TESTSUITE) $(TESTSUITE_AT) $(OTHER_FILES) \
369 # Be sure to reexport important environment variables:
370 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
371 CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
372 LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
373 OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" CONFIG_SHELL="$(SHELL)" \
374 abs_top_builddir="$(abs_top_builddir)" \
375 CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
376 F77="$(F77)" FFLAGS="$(FFLAGS)" \
377 GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)"
379 # Using variables so that this snippet is not too wide and can
380 # be used as is in Texinfo @example/@end example.
381 m4_texinfo = $(srcdir)/doc/m4.texinfo
382 generate = $(AWK) -f $(srcdir)/tests/generate.awk
383 $(srcdir)/tests/generated.at: tests/generate.awk $(m4_texinfo)
384 $(generate) $(m4_texinfo) >$@t
388 AUTOTEST = $(AUTOM4TE) --language=autotest
389 $(TESTSUITE): tests/package.m4 $(TESTSUITE_AT)
390 $(AUTOTEST) -I '$(srcdir)/tests' -o $@.tmp $@.at
393 # The leading :; works around a bug in {}>f in some bash versions.
394 $(srcdir)/tests/package.m4: configure.ac
397 echo '# Signature of the current package.'; \
398 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
399 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
400 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
401 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
402 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
403 } > $(srcdir)/tests/package.m4
405 tests/atconfig: config.status
406 $(SHELL) ./config.status tests/atconfig
407 DISTCLEANFILES += tests/atconfig
409 # Hook the test suite into the check rule
410 check-local: tests/atconfig tests/m4 $(TESTSUITE) $(check_LTLIBRARIES)
411 $(SHELL) '$(srcdir)/tests/testsuite' -C tests \
412 $(TESTS_ENVIRONMENT) $(TESTSUITEFLAGS)
414 # Run the test suite on the *installed* tree.
415 installcheck-local: tests/atconfig $(TESTSUITE) $(check_LTLIBRARIES)
416 $(SHELL) '$(srcdir)/tests/testsuite' -C tests \
417 $(TESTS_ENVIRONMENT) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
419 # We need to remove any file droppings left behind by testsuite.
421 test ! -f '$(srcdir)/tests/testsuite' || \
422 $(SHELL) '$(srcdir)/tests/testsuite' -C tests --clean
424 OTHER_FILES = tests/iso8859.m4 tests/stackovf.test \
425 tests/null.m4 tests/null.out tests/null.err
427 DISTCLEANFILES += tests/atconfig tests/atlocal tests/m4
428 MAINTAINERCLEANFILES += tests/generated.at '$(TESTSUITE)'
430 clean-local: clean-local-tests
433 ## --- RULES FOR THE MAINTAINER --- ##
434 ## You shouldn't need to touch anything below here. ##
435 ## (mostly copied from automake/Makefile.am) ##
438 CVS = cvs # set it to `:' to avoid CVS operations at dist time
440 # Tag before making distribution. Also, don't make a distribution if
441 # checks fail. Also, make sure the NEWS file is up-to-date.
442 cvs-dist: distcheck # maintainer-check
443 @if sed '1,2d;3q' $(srcdir)/NEWS | grep -e "$(VERSION)" > dev/null; \
444 echo "NEWS not updated; not releasing" 1>&2; \
448 $(CVS) -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
452 thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \
453 if test -z "$$OLDVERSION"; then \
454 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
455 else prevno="$$OLDVERSION"; fi; \
456 prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \
457 cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
458 > $(PACKAGE)-$$prevno-$(VERSION).diff
463 $(SHELL) "$(abs_srcdir)/$(config_aux_dir)/gendocs.sh" $(PACKAGE) \
464 "GNU $(PACKAGE)- GNU macro processor"
465 @echo " *** Upload the doc/manual directory to web-cvs."