maint: summarize highlights of 1.4.18 release
[m4/ericb.git] / Makefile.am
blob1f3859528e95a5189e51d83a8093cde74cef4998
1 ## Makefile.am - template for generating Makefile via Automake
2 ##
3 ## Copyright (C) 2000-2001, 2003-2010, 2013-2014, 2017 Free Software
4 ## Foundation, Inc.
5 ##
6 ## This file is part of GNU M4.
7 ##
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= $(config_aux_dir)/m4
26 SUBDIRS         = po m4/gnu . doc tests/gnu
28 ACLOCAL_AMFLAGS = -I build-aux/m4
29 AUTOMAKE_OPTIONS = nostdinc
31 gitlog_to_changelog     = $(srcdir)/$(config_aux_dir)/gitlog-to-changelog
32 git_log_fix             = $(srcdir)/$(config_aux_dir)/git-log-fix
33 thanks_gen              = $(srcdir)/$(config_aux_dir)/thanks-gen
35 changelog               = $(distdir)/ChangeLog
36 changelog_old           = $(srcdir)/ChangeLog.old
37 thanks                  = $(distdir)/THANKS
38 no_thanks               = $(srcdir)/NO-THANKS
40 # Prime the variables that will be augmented by libtool.
41 # FIXME - the -export-symbols-regex ".*" is a hack to work around the
42 # fact that on cygwin, the convenience library libltdl exports symbols,
43 # which effectively disables the auto-exporting of all other symbols.
44 # Revisit this if libtool on cygwin improves.
45 # See http://lists.gnu.org/archive/html/libtool-patches/2007-02/msg00062.html
46 AM_CPPFLAGS     = -I$(srcdir) -I.
47 AM_CFLAGS       = $(WARN_CFLAGS) $(WERROR_CFLAGS)
48 AM_LDFLAGS      = -no-undefined -export-dynamic -export-symbols-regex ".*"
49 EXTRA_DIST      =
50 BUILT_SOURCES   =
51 CLEANFILES      =
52 DISTCLEANFILES  =
53 MOSTLYCLEANFILES=
54 MAINTAINERCLEANFILES =
56 include_HEADERS =
57 noinst_LTLIBRARIES=
58 lib_LTLIBRARIES =
59 check_LTLIBRARIES =
60 EXTRA_LTLIBRARIES=
62 # Additional configuration.  Version management comes from suggestions
63 # given in build-aux/git-version-gen.
64 AM_CPPFLAGS    += -Im4/gnu -I$(srcdir)/m4/gnu \
65                   -Im4 -I$(srcdir)/m4
66 AM_LDFLAGS     += $(OS2_LDFLAGS)
67 EXTRA_DIST     += bootstrap cfg.mk maint.mk .version .prev-version \
68                   $(config_macro_dir)/gnulib-cache.m4 $(gitlog_to_changelog)
69 BUILT_SOURCES  += .version
70 .version:
71         echo $(VERSION) > $@-t && mv $@-t $@
72 dist-hook: dist-tarball-version
73 dist-tarball-version:
74         echo $(VERSION) > $(distdir)/.tarball-version
76 dist-hook: $(changelog)
77 changelog_start_date = 2011-01-01
78 $(changelog): FORCE
79         $(AM_V_GEN)if test -d '$(srcdir)/.git'; then    \
80           $(gitlog_to_changelog)                        \
81             --since=$(changelog_start_date) > '$@T';    \
82           rm -f '$@'; mv '$@T' '$@';                    \
83           cat '$(changelog_old)' >> '$@';               \
84         fi
86 # Sort in traditional ASCII order, regardless of the current locale;
87 # otherwise we may get into trouble with distinct strings that the
88 # current locale considers to be equal.
89 ASSORT = LC_ALL=C sort
91 # Extract all lines up to the first one starting with "##".
92 prologue = perl -ne '/^\#\#/ and exit; print' $(no_thanks)
94 # Generate THANKS using git log entries as far as possible, fixing
95 # up ommisions and errors from NO-THANKS configuration.
96 $(thanks): FORCE
97         $(AM_V_GEN)if test -d '$(srcdir)/.git'; then \
98           { \
99             $(prologue); echo; \
100             { perl -ne '/^$$/.../^$$/ and print' $(no_thanks) \
101               | grep -v '^$$' | perl -pe 's/  +/\0/'; \
102               {  sed -e '1,/\#\# /d' -e '/^\#\# /d' \
103                     -e 's|[     ][       ]*|    |' < $(no_thanks) \
104                   | tr '\t' '\0'; \
105                 git log --pretty=format:'%aN%x00%aE'; \
106               } | $(ASSORT) -u; \
107             } | $(thanks_gen) \
108               | LC_ALL=en_US.UTF-8 sort -f; \
109             echo; \
110             printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \
111           } > '$@'; \
112         fi
114 MAINTAINERCLEANFILES += \
115                   ABOUT-NLS INSTALL Makefile.in aclocal.m4 \
116                   config-h.in configure stamp-h.in \
117                   po/cat-id-tbl.c po/m4.pot po/stamp-cat-id
120 ## ------- ##
121 ## GNU M4. ##
122 ## ------- ##
124 bin_PROGRAMS    = src/m4
125 src_m4_SOURCES  = \
126                   src/xstrtoul.c \
127                   src/xstrtol-error.c \
128                   src/xstrtol.c \
129                   src/xstrtol.h \
130                   src/version-etc-fsf.c \
131                   src/version-etc.c \
132                   src/version-etc.h \
133                   src/main.c \
134                   src/m4.h \
135                   src/freeze.c
136 if GETOPT
137 src_m4_SOURCES += \
138                   src/getopt.c \
139                   src/getopt1.c
140 endif
141 if STACKOVF
142 src_m4_SOURCES += src/stackovf.c
143 endif
144 src_m4_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -I$(srcdir)/src
145 src_m4_LDADD    = m4/libm4.la $(LTLIBICONV) $(LTLIBTHREAD)
146 src_m4_DEPENDENCIES = m4/libm4.la
148 ##                                                                      ##
149 ##                 --- PASTED MANUALLY FROM GNULIB ---                  ##
150 ##     To avoid adding unnecessary objects to libm4.la these gnulib     ##
151 ##     modules are not imported by gnulib-tool, but added manually.     ##
152 ##     (from: gnulib-tool --extract-automake-snippet getopt-posix)      ##
153 ##                                                                      ##
154 if GETOPT
155 BUILT_SOURCES  += src/$(GETOPT_H)
156 endif
157 EXTRA_DIST     += src/getopt.c src/getopt1.c src/getopt.in.h src/getopt_int.h
159 ARG_NONNULL_H = $(srcdir)/$(config_aux_dir)/arg-nonnull.h
161 # We need the following in order to create an <getopt.h> when the
162 # system doesn't have one that works with the given compiler.
163 src/getopt.h: src/getopt.in.h $(ARG_NONNULL_H)
164         $(AM_V_GEN)rm -f $@-t $@ && \
165         { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
166           sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
167               -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
168               -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
169               -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
170               -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
171               < $(srcdir)/src/getopt.in.h; \
172         } > $@-t && \
173         mv -f $@-t $@
174 MOSTLYCLEANFILES += src/getopt.h src/getopt.h-t
175 ##                                                                      ##
176 ##                     --- END OF PASTED GNULIB ---                     ##
177 ##                                                                      ##
179 ## -------- ##
180 ## Modules. ##
181 ## -------- ##
183 module_ldflags  = -avoid-version -module $(AM_LDFLAGS)
184 module_libadd   = m4/libm4.la
186 noinst_HEADERS  = modules/m4.h
188 pkglib_LTLIBRARIES =
190 pkglib_LTLIBRARIES             += modules/gnu.la
191 EXTRA_modules_gnu_la_SOURCES    = modules/format.c
192 modules_gnu_la_LDFLAGS          = $(module_ldflags)
193 modules_gnu_la_LIBADD           = $(module_libadd)
194 EXTRA_DIST                     += $(EXTRA_modules_gnu_la_SOURCES)
196 pkglib_LTLIBRARIES             += modules/m4.la
197 EXTRA_modules_m4_la_SOURCES     = modules/evalparse.c
198 modules_m4_la_LDFLAGS           = $(module_ldflags)
199 modules_m4_la_LIBADD            = $(module_libadd)
200 EXTRA_DIST                     += $(EXTRA_modules_m4_la_SOURCES)
202 if USE_GMP
203 pkglib_LTLIBRARIES             += modules/mpeval.la
204 EXTRA_modules_mpeval_la_SOURCES = modules/evalparse.c
205 modules_mpeval_la_LDFLAGS       = $(module_ldflags)
206 modules_mpeval_la_LIBADD        = $(module_libadd) $(LIBADD_GMP)
207 endif
209 pkglib_LTLIBRARIES             += modules/stdlib.la
210 modules_stdlib_la_LDFLAGS       = $(module_ldflags)
211 modules_stdlib_la_LIBADD        = $(module_libadd)
213 pkglib_LTLIBRARIES             += modules/time.la
214 modules_time_la_LDFLAGS         = $(module_ldflags)
215 modules_time_la_LIBADD          = $(module_libadd)
217 pkglib_LTLIBRARIES             += modules/traditional.la
218 modules_traditional_la_LDFLAGS  = $(module_ldflags)
219 modules_traditional_la_LIBADD   = $(module_libadd)
222 ## ----- ##
223 ## libm4 ##
224 ## ----- ##
226 lib_LTLIBRARIES += m4/libm4.la
228 nobase_include_HEADERS = \
229                   m4/m4module.h \
230                   m4/hash.h \
231                   m4/system.h
232 m4_libm4_la_SOURCES     = \
233                   m4/builtin.c \
234                   m4/debug.c \
235                   m4/hash.c \
236                   m4/input.c \
237                   m4/m4.c \
238                   m4/m4private.h \
239                   m4/macro.c \
240                   m4/module.c \
241                   m4/output.c \
242                   m4/path.c \
243                   m4/resyntax.c \
244                   m4/symtab.c \
245                   m4/syntax.c \
246                   m4/utility.c
247 m4_libm4_la_LIBADD = m4/gnu/libgnu.la \
248                   $(LTLIBINTL) $(LIBADD_DLOPEN)
249 m4_libm4_la_DEPENDENCIES = m4/gnu/libgnu.la
251 # This file needs to be regenerated at configure time.
252 dist-hook:
253         rm -f $(distdir)/m4/system.h
254 EXTRA_DIST     += m4/system_.h
257 ## -------------- ##
258 ## Documentation. ##
259 ## -------------- ##
261 TAGS_FILES      = $(infos_TEXINFOS)
262 TAGS_DEPENDENCIES = $(TAGS_FILES)
263 ETAGS_ARGS      = --language=none --regex='/@node \([^,]*\)/\1/' $(TAGS_FILES)
265 MAINTAINERCLEANFILES += $(dist_man_MANS)
267 ## --------- ##
268 ## Examples. ##
269 ## --------- ##
271 EXTRA_DIST     += \
272                   doc/examples/WWW/Makefile \
273                   doc/examples/WWW/_footer.htm \
274                   doc/examples/WWW/_header.htm \
275                   doc/examples/WWW/m4lib/bugs.m4 \
276                   doc/examples/WWW/m4lib/changelog.m4 \
277                   doc/examples/WWW/m4lib/download.m4 \
278                   doc/examples/WWW/m4lib/features.m4 \
279                   doc/examples/WWW/m4lib/feedback.m4 \
280                   doc/examples/WWW/m4lib/html.m4 \
281                   doc/examples/WWW/m4lib/index.m4 \
282                   doc/examples/WWW/m4lib/layout.m4 \
283                   doc/examples/WWW/m4lib/lists.m4 \
284                   doc/examples/WWW/m4lib/menu.m4 \
285                   doc/examples/WWW/m4lib/modules.m4 \
286                   doc/examples/WWW/m4lib/news.m4 \
287                   doc/examples/WWW/m4lib/readme.m4 \
288                   doc/examples/WWW/m4lib/setup.m4 \
289                   doc/examples/WWW/m4lib/test.m4 \
290                   doc/examples/WWW/m4lib/thanks.m4 \
291                   doc/examples/WWW/m4lib/thissite.m4 \
292                   doc/examples/WWW/m4lib/tmpl.m4 \
293                   doc/examples/WWW/m4lib/todo.m4 \
294                   doc/examples/WWW/m4lib/uses.m4 \
295                   doc/examples/WWW/m4lib/visions.m4 \
296                   doc/examples/WWW/m4lib/whatis.m4
298 dist_pkgdata_DATA = \
299                   doc/examples/capitalize.m4 \
300                   doc/examples/capitalize2.m4 \
301                   doc/examples/comments.m4 \
302                   doc/examples/curry.m4 \
303                   doc/examples/ddivert.m4 \
304                   doc/examples/debug.m4 \
305                   doc/examples/esyscmd.m4 \
306                   doc/examples/exp.m4 \
307                   doc/examples/foreach.m4 \
308                   doc/examples/foreach2.m4 \
309                   doc/examples/foreachq.m4 \
310                   doc/examples/foreachq2.m4 \
311                   doc/examples/foreachq3.m4 \
312                   doc/examples/foreachq4.m4 \
313                   doc/examples/forloop.m4 \
314                   doc/examples/forloop2.m4 \
315                   doc/examples/forloop3.m4 \
316                   doc/examples/fstab.m4 \
317                   doc/examples/hanoi.m4 \
318                   doc/examples/incl-test.m4 \
319                   doc/examples/incl.m4 \
320                   doc/examples/include.m4 \
321                   doc/examples/indir.m4 \
322                   doc/examples/join.m4 \
323                   doc/examples/loop.m4 \
324                   doc/examples/misc.m4 \
325                   doc/examples/multiquotes.m4 \
326                   doc/examples/patsubst.m4 \
327                   doc/examples/pushpop.m4 \
328                   doc/examples/quote.m4 \
329                   doc/examples/regexp.m4 \
330                   doc/examples/reverse.m4 \
331                   doc/examples/stack.m4 \
332                   doc/examples/stack_sep.m4 \
333                   doc/examples/sysv-args.m4 \
334                   doc/examples/trace.m4 \
335                   doc/examples/translit.m4 \
336                   doc/examples/undivert.incl \
337                   doc/examples/undivert.m4 \
338                   doc/examples/wrap.m4 \
339                   doc/examples/wrapfifo.m4 \
340                   doc/examples/wraplifo.m4 \
341                   doc/examples/wraplifo2.m4
343 EXTRA_DIST     += \
344                   doc/examples/modtest.m4 \
345                   doc/examples/shadow.m4 \
346                   doc/examples/time.m4 \
347                   doc/examples/time2.m4 \
348                   doc/examples/stdlib.m4
350 ## ----------- ##
351 ## Test suite. ##
352 ## ----------- ##
354 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
355 # how `testsuite' appears in our dependencies.
356 TESTSUITE = $(srcdir)/tests/testsuite
357 TESTSUITE_AT    = \
358                   tests/builtins.at \
359                   tests/freeze.at \
360                   $(srcdir)/tests/generated.at \
361                   tests/macros.at \
362                   tests/modules.at \
363                   tests/options.at \
364                   tests/others.at \
365                   tests/testsuite.at
367 EXTRA_DIST     += $(TESTSUITE) $(TESTSUITE_AT) $(OTHER_FILES) \
368                   tests/atlocal.in \
369                   tests/generate.awk \
370                   $(srcdir)/tests/package.m4
372 module_check    = -rpath /dev/null
374 check_LTLIBRARIES              += tests/import.la
375 tests_import_la_LDFLAGS         = $(module_ldflags) $(module_check)
376 tests_import_la_LIBADD          = $(module_libadd)
378 check_LTLIBRARIES              += tests/modtest.la
379 tests_modtest_la_LDFLAGS        = $(module_ldflags) $(module_check)
380 tests_modtest_la_LIBADD         = $(module_libadd)
382 check_LTLIBRARIES              += tests/shadow.la
383 tests_shadow_la_LDFLAGS         = $(module_ldflags) $(module_check)
384 tests_shadow_la_LIBADD          = $(module_libadd)
386 # Using variables so that this snippet is not too wide and can
387 # be used as is in Texinfo @example/@end example.
388 m4_texi     = $(srcdir)/doc/m4.texi
390 generate    = $(AWK) -f $(srcdir)/tests/generate.awk
391 $(srcdir)/tests/generated.at: tests/generate.awk $(m4_texi)
392         $(generate) $(m4_texi) >$@t
393         mv $@t $@
395 AUTOM4TE = $(SHELL) $(srcdir)/$(config_aux_dir)/missing --run autom4te
396 AUTOTEST = $(AUTOM4TE) --language=autotest
397 $(TESTSUITE): $(srcdir)/tests/package.m4 $(TESTSUITE_AT)
398         $(AUTOTEST) -I '$(srcdir)/tests' -o $@.tmp $@.at
399         mv $@.tmp $@
401 # The leading :; works around a bug in {}>f in some bash versions.
402 $(srcdir)/tests/package.m4: .version
403         :; \
404         { \
405           echo '# Signature of the current package.'; \
406           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])'; \
407           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])'; \
408           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'; \
409           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])'; \
410           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
411         } > $(srcdir)/tests/package.m4
413 tests/atconfig: config.status
414         $(SHELL) ./config.status tests/atconfig
415 DISTCLEANFILES += tests/atconfig
417 # Hook the test suite into the check rule
418 check-local: tests/atconfig tests/atlocal tests/m4 $(TESTSUITE) \
419                 $(check_LTLIBRARIES)
420         $(SHELL) '$(srcdir)/tests/testsuite' -C tests $(TESTSUITEFLAGS)
422 # Run the test suite on the *installed* tree, including any renames
423 # the user requested.
424 installcheck-local: tests/atconfig tests/atlocal $(TESTSUITE) \
425                 $(check_LTLIBRARIES)
426         $(SHELL) '$(srcdir)/tests/testsuite' -C tests \
427           AUTOTEST_PATH="$(bindir)" \
428           M4="`echo m4 | sed '$(program_transform_name)'`" $(TESTSUITEFLAGS)
430 # Enough users install GNU M4 as gm4 that we make sure 'make installcheck'
431 # will handle that, as part of making a release.
432 DISTCHECK_CONFIGURE_FLAGS = \
433         --disable-assert \
434         --program-prefix=g \
435         --enable-cxx
437 # We need to remove any file droppings left behind by testsuite.
438 clean-local-tests:
439         test ! -f '$(srcdir)/tests/testsuite' || \
440           $(SHELL) '$(srcdir)/tests/testsuite' -C tests --clean
442 OTHER_FILES     = tests/iso8859.m4 tests/stackovf.test \
443                 tests/null.m4 tests/null.out tests/null.err
445 DISTCLEANFILES += tests/atconfig tests/atlocal tests/m4
446 MAINTAINERCLEANFILES += $(srcdir)/tests/generated.at '$(TESTSUITE)'
448 clean-local: clean-local-tests
450 FORCE: