forked from Genivia/RE-flex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
183 lines (166 loc) · 6.52 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Copyright (c) 2018, Michael B Tegtmeyer
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the author nor the names of its contributors may
# be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ACLOCAL_AMFLAGS = --install -I m4
# Leave examples off of DIST_SUBDIRS on purpose
SUBDIRS = src include tests doc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = reflex.pc
# Make sure the top level files and the files necessary to build the
# documentation are included in the distribution. Generated man files are
# included in the documentation but the Doxygen content is not.
EXTRA_DIST= \
examples/Makefile.in.in \
examples/flexexample10.test.in \
examples/flexexample10a.test.in \
examples/ctokens.l.in \
examples/jtokens.l.in \
examples/ptokens.l.in \
INSTALL \
COPYING \
README.md
DISTCLEANFILES= \
examples/Makefile.in \
examples/Makefile \
examples/flexexample10.test \
examples/flexexample10a.test \
examples/ctokens.l \
examples/jtokens.l \
examples/ptokens.l
# examples are complicated. On one hand, the examples need to be
# installed into $(docdir) along with a makefile that builds the
# examples using the installed version of reflex. Ie so a user who just
# wants to get up and running quickly without having to mess around with
# automake can simply copy the installed examples directory, run make in
# it, and assuming the users build environment is sane, all the examples
# will build and link correctly. On the other hand, there needs to be be
# a way to build and link the examples against the version of reflex in
# this distribution to check for errors in the examples before they are
# installed. These two makefiles need to either be the same or as close
# to the same as possible. The nobase_dist_doc_DATA below simply
# installs the version of the examples that build against the installed
# version of reflex
if EXAMPLES
check-local:
cd examples && $(MAKE) $(AM_MAKEFLAGS) all
clean-local:
cd examples && $(MAKE) $(AM_MAKEFLAGS) clean
endif
nobase_dist_doc_DATA= \
examples/README.md \
examples/braille.l \
examples/calc.l \
examples/calc.y \
examples/cards.cpp \
examples/cdefs.l \
examples/cow.l \
examples/cows.l \
examples/csv.l \
examples/echo.l \
examples/flexexample1.l \
examples/flexexample2.l \
examples/flexexample3.lxx \
examples/flexexample3.test \
examples/flexexample3.yxx \
examples/flexexample3.l \
examples/flexexample3.y \
examples/flexexample4.l \
examples/flexexample4.lxx \
examples/flexexample4.test \
examples/flexexample4.y \
examples/flexexample4.yxx \
examples/flexexample5.l \
examples/flexexample5.lxx \
examples/flexexample5.test \
examples/flexexample5.y \
examples/flexexample5.yxx \
examples/flexexample6.l \
examples/flexexample7.l \
examples/flexexample7.lxx \
examples/flexexample7.test \
examples/flexexample7.y \
examples/flexexample7.yxx \
examples/flexexample8.l \
examples/flexexample8.lxx \
examples/flexexample8.test \
examples/flexexample8.y \
examples/flexexample8.yxx \
examples/flexexample9.lxx \
examples/flexexample9.test \
examples/flexexample9.yxx \
examples/flexexample10.l \
examples/flexexample10b.test \
examples/indent.l \
examples/jdefs.l \
examples/json.l \
examples/pdefs.l \
examples/readline.l \
examples/reflexexample3.l \
examples/reflexexample3.lxx \
examples/reflexexample3.y \
examples/reflexexample3.yxx \
examples/reflexexample4.l \
examples/reflexexample4.lxx \
examples/reflexexample5.l \
examples/reflexexample5.lxx \
examples/reflexexample6.l \
examples/reflexexample7.l \
examples/reflexexample7.lxx \
examples/reflexexample8.l \
examples/reflexexample8.lxx \
examples/reflexexample9.lxx \
examples/reflexexample10.l \
examples/tag.l \
examples/tag_lazy.l \
examples/tag_lazystates.l \
examples/tag_tidy.l \
examples/tag_unicode.l \
examples/unicode.l \
examples/url.cpp \
examples/wc.l \
examples/wcpp.l \
examples/wcu.l \
examples/wcwc.l
uninstall-hook:
rm -R -f $(DESTDIR)$(docdir)
makefile_subs = sed -e ' s/[@]REFLEX[@]/reflex/g' \
-e ' s/[@]LIBREFLEX[@]/-lreflex/g' \
-e ' s/[@]YACC[@]/bison -y/g' \
-e ' s/[@]BISON[@]/bison/g' \
-e ' s/[@]LIBREADLINE[@]/-lreadline/g' \
-e ' s/[@]CC[@]/cc/g' \
-e ' s/[@]CXX[@]/c++/g' \
-e ' s|[@]srcdir[@]/||g' \
-e ' s|[@]builddir[@]/||g' \
-e ' s/[@].*[@]//g'
example_subs = sed -e ' s|[@]builddir[@]/||g' \
-e ' s|[@]srcdir[@]/||g'
install-data-hook:
$(makefile_subs) $(top_srcdir)/examples/Makefile.in.in > $(DESTDIR)$(docdir)/examples/Makefile
$(example_subs) $(top_srcdir)/examples/flexexample10.test.in > $(DESTDIR)$(docdir)/examples/flexexample10.test
$(example_subs) $(top_srcdir)/examples/flexexample10a.test.in > $(DESTDIR)$(docdir)/examples/flexexample10a.test
$(example_subs) $(top_srcdir)/examples/ctokens.l.in > $(DESTDIR)$(docdir)/examples/ctokens.l
$(example_subs) $(top_srcdir)/examples/jtokens.l.in > $(DESTDIR)$(docdir)/examples/jtokens.l
$(example_subs) $(top_srcdir)/examples/ptokens.l.in > $(DESTDIR)$(docdir)/examples/ptokens.l