build: fix a concurrent build issue in examples
[bison.git] / examples / c / lexcalc / local.mk
blob636275c89a0b76d690f42503b99f1e61c7cc02dc
1 ## Copyright (C) 2018-2020 Free Software Foundation, Inc.
2 ##
3 ## This program is free software: you can redistribute it and/or modify
4 ## it under the terms of the GNU General Public License as published by
5 ## the Free Software Foundation, either version 3 of the License, or
6 ## (at your option) any later version.
7 ##
8 ## This program is distributed in the hope that it will be useful,
9 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ## GNU General Public License for more details.
13 ## You should have received a copy of the GNU General Public License
14 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
16 lexcalcdir = $(docdir)/%D%
18 ## --------- ##
19 ## LexCalc. ##
20 ## --------- ##
22 if FLEX_WORKS
23 check_PROGRAMS += %D%/lexcalc
24 TESTS += %D%/lexcalc.test
25 nodist_%C%_lexcalc_SOURCES = %D%/parse.y %D%/parse.h %D%/scan.l
26 # Don't use gnulib's system headers.
27 %C%_lexcalc_CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
28 # Fighting warnings triggered by Flex is just too painful.
29 # %C%_lexcalc_CFLAGS = $(TEST_CFLAGS)
30 endif FLEX_WORKS
32 %D%/parse.c: $(dependencies)
34 # Tell Make scan.o depends on parse.h, except that Make sees only
35 # parse.c, not parse.h. We can't use BUILT_SOURCES to this end, since
36 # we use the built bison.
37 %D%/lexcalc$(DASH)scan.o: %D%/parse.c
38 # Likewise, but for Automake before 1.16.
39 %D%/examples_c_lexcalc_lexcalc$(DASH)scan.o: %D%/parse.c
41 EXTRA_DIST += %D%/lexcalc.test
42 dist_lexcalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md
43 CLEANFILES += %D%/parse.[ch] %D%/scan.c %D%/parse.output
44 CLEANDIRS += %D%/*.dSYM