Debian Codegraph @

examples/c++/calc++/local.mk

raw
1 ## Copyright (C) 2005-2006, 2008-2015, 2018-2021 Free Software
2 ## Foundation, Inc.
3 ##
4 ## This program is free software: you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation, either version 3 of the License, or
7 ## (at your option) any later version.
8 ##
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
13 ##
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17 ## ------------------- ##
18 ## Parser generation. ##
19 ## ------------------- ##
20
21 SUFFIXES += .yy .stamp
22 .yy.stamp:
23 $(AM_V_YACC)rm -f $@
24 $(AM_V_at)touch [email protected]
25 $(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
26 $(AM_V_at)mv -f [email protected] $@
27
28 %D%/parser.stamp: $(dependencies)
29 $(calcxx_sources_generated): %D%/parser.stamp
30 @test -f $@ || rm -f %D%/parser.stamp
31 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) %D%/parser.stamp
32 CLEANFILES += \
33 $(calcxx_sources_generated) \
34 %D%/parser.gv \
35 %D%/parser.output \
36 %D%/parser.stamp \
37 %D%/scanner.cc
38 CLEANDIRS += %D%/*.dSYM
39
40 ## -------------------- ##
41 ## Building & testing. ##
42 ## -------------------- ##
43
44 # Avoid using BUILT_SOURCES which is too global.
45 $(%C%_calc___OBJECTS): $(calcxx_sources_generated)
46
47 calcxx_sources_extracted = \
48 %D%/driver.cc \
49 %D%/driver.hh \
50 %D%/scanner.ll \
51 %D%/calc++.cc
52 calcxx_extracted = \
53 $(calcxx_sources_extracted) \
54 %D%/parser.yy
55 extracted += $(calcxx_extracted)
56 calcxx_sources_generated = \
57 %D%/parser.cc \
58 %D%/parser.hh \
59 %D%/location.hh
60 calcxx_sources = \
61 $(calcxx_sources_extracted) \
62 $(calcxx_sources_generated)
63
64 if FLEX_CXX_WORKS
65 if ENABLE_CXX
66 check_PROGRAMS += %D%/calc++
67 nodist_%C%_calc___SOURCES = $(calcxx_sources)
68 # Don't use gnulib's system headers.
69 %C%_calc___CPPFLAGS = -I$(top_srcdir)/%D% -I$(top_builddir)/%D%
70 %C%_calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
71 TESTS += %D%/calc++.test
72 endif ENABLE_CXX
73 endif FLEX_CXX_WORKS
74 EXTRA_DIST += %D%/calc++.test
75
76
77 ## ------------ ##
78 ## Installing. ##
79 ## ------------ ##
80
81 calcxxdir = $(docdir)/%D%
82 calcxx_DATA = $(calcxx_extracted)
83 dist_calcxx_DATA = %D%/README.md %D%/Makefile