1 ## Process this file with automake to produce Makefile.in.
3 # Copyright (C) 2001-2015, 2018-2020 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 3 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. If not, see <http://www.gnu.org/licenses/>.
18 AUTOMAKE_OPTIONS = subdir-objects
19 ACLOCAL_AMFLAGS = -I m4
21 SUBDIRS = po runtime-po gnulib-po .
23 # Files installed for use by Automake.
24 aclocaldir = @aclocaldir@
25 aclocal_DATA = m4/bison-i18n.m4
27 EXTRA_DIST = .prev-version .version cfg.mk PACKAGING \
28 ChangeLog-1998 ChangeLog-2012 ChangeLog
30 dist_doc_DATA = AUTHORS COPYING NEWS README THANKS TODO
32 # Let generated files (e.g., from examples/) depend on this variable,
33 # to make sure they are regenerated when there are changes in Bison.
35 # Don't depend on $(BISON) otherwise we would rebuild these files
36 # in srcdir, including during distcheck, which is forbidden.
37 dependencies = $(BISON_IN) $(src_bison_SOURCES) $(dist_skeletons_DATA)
39 ## Running the bison from this tarball. To generate our own parser,
40 ## but also to run the tests. Of course, you ought to keep a sane
41 ## version of Bison nearby...
42 BISON = $(top_builddir)/tests/bison
43 BISON_IN = $(top_srcdir)/tests/bison.in
44 YACC = $(BISON) -o y.tab.c
45 AM_YFLAGS_WITH_LINES = --defines -Werror -Wall,dangling-alias --report=all
46 AM_YFLAGS = $(AM_YFLAGS_WITH_LINES) --no-lines
48 # Initialization before completion by local.mk's.
49 AM_CFLAGS = $(WARN_CFLAGS)
50 # Find builddir/src/scan-code.c etc. For some reason "-I./lib"
51 # instead of "-Ilib" avoids infinite recursions on #include_next.
52 AM_CPPFLAGS = -I. -I./lib -I$(top_srcdir) -I$(top_srcdir)/lib
57 EXTRA_DIST += $(dist_TESTS)
67 include build-aux/local.mk
71 include examples/local.mk
74 include tests/local.mk
79 # See comments in build-aux/git-version-gen. However, we make .version depend
80 # on configure so that .version and VERSION/PACKAGE_VERSION stay in sync in the
81 # working copy (for example, when you run autoreconf && make). Allowing these
82 # to fall out of sync appears to have little potential to improve Bison build
83 # efficiency (even if we were to replace VERSION/PACKAGE_VERSION with .version
84 # everywhere possible). On the other hand, it could be harmful. For example,
85 # a developer might naively reference .version in a test case while the bison
86 # executable still compiles with VERSION, and so the test case might fail or
88 BUILT_SOURCES += $(top_srcdir)/.version
89 $(top_srcdir)/.version: configure
90 echo $(VERSION) > $@-t && mv $@-t $@
91 dist-hook: gen-ChangeLog gen-synclines
92 echo $(VERSION) > $(distdir)/.tarball-version
94 # When generating a release, include the #lines in Bison's parser. Do it
95 # only if needed. In particular, distcheck runs dist with read-only
96 # sources, so don't try to update src/parse-gram.c: we don't have the
101 if ! grep '#line' src/parse-gram.c >/dev/null 2>&1; then \
102 $(abs_top_builddir)/tests/bison \
103 $(AM_YFLAGS_WITH_LINES) src/parse-gram.y \
104 -o src/parse-gram.c; \
107 .PHONY: update-b4-copyright update-package-copyright-year
109 $(AM_V_GEN)find $(srcdir)/data -type f \
110 | xargs $(srcdir)/build-aux/$@
111 @echo 'warning: src/parse-gram.[hc] may need to be regenerated.'
112 update-package-copyright-year:
113 $(AM_V_GEN)$(srcdir)/build-aux/$@ $(srcdir)/configure.ac
115 gen_start_date = 2012-01-16
116 .PHONY: gen-ChangeLog
118 $(AM_V_GEN)if test -d $(srcdir)/.git; then \
119 cl=$(distdir)/ChangeLog && \
121 $(top_srcdir)/build-aux/gitlog-to-changelog \
123 --strip-cherry-pick \
125 --amend=$(srcdir)/build-aux/git-log-fix \
127 --since=$(gen_start_date) > $$cl.tmp && \
128 mv -f $$cl.tmp $$cl; \
133 $(CC) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -o $@ -E $<
136 CODESPELL = codespell
138 $(AM_V_GEN) cd $(srcdir) \
140 --regex "[\\w\\-'’\`]+\+*" \
141 --ignore-words-list "ba,circularly,cloneable,copyable,define'd,dout,froms,iff,ifset,od,ois" \
142 $$(git ls-files data doc lib src tests)