forked from google/xpaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
202 lines (159 loc) · 4.94 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Process this file with automake to produce Makefile.in.
# Note: You should probably just run ./autogen.sh, as per README file.
# TODO(sadovsky): For some reason "make install" puts headers in
# /usr/local/include/xpaf/src and /usr/local/include/xpaf/base/src/base, which
# seems inconsistent.
ACLOCAL_AMFLAGS = -I m4
# Note: We need /opt/local/include and /opt/local/lib for MacPorts.
AM_CXXFLAGS = -DNDEBUG -I$(top_srcdir)/src -I/opt/local/include
AM_CXXFLAGS += @LIBXML2_CFLAGS@
if GCC
# Enable some warnings.
AM_CXXFLAGS += -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
endif
# Note: We try to only link what we need for each target.
# For example, libxpaf.la doesn't include gflags or gtest.
AM_LDFLAGS = -no-undefined -L/opt/local/lib -version-info @SO_VERSION@
AM_LDFLAGS += @LIBXML2_LIBS@ @LIBRE2_LIBS@ @LIBPROTOBUF_LIBS@
lib_LTLIBRARIES = libxpaf.la
# Note: We use "nodist" to strip the src/ dir, and define pkgincludebasedir so
# that relative dirs are maintained.
nobase_pkginclude_HEADERS =\
src/document.h\
src/xpaf_parser.h\
src/xpaf_parser_master.h\
src/xpath_wrapper.h
pkgincludebasedir = $(pkgincludedir)/base
nobase_pkgincludebase_HEADERS =\
src/base/macros.h\
src/base/scoped_ptr.h\
src/base/stl_decl.h\
src/base/stringpiece.h
# Install public proto files alongside headers.
nobase_pkginclude_HEADERS += $(protoc_inputs)
noinst_HEADERS =\
src/base/callback.h\
src/base/commandlineflags.h\
src/base/file.h\
src/base/integral_types.h\
src/base/logging.h\
src/base/stl_util.h\
src/base/strutil.h\
src/base/url.h\
src/base/webutil.h\
src/document.h\
src/query_runner.h\
src/util.h\
src/xpaf_parser.h\
src/xpaf_parser_master.h\
src/xpath_wrapper.h
nodist_noinst_HEADERS =\
src/parsed_document.pb.h\
src/post_processing_ops.pb.h\
src/xpaf_parser_def.pb.h
libxpaf_la_SOURCES =\
src/base/file.cc\
src/base/stringpiece.cc\
src/base/strutil.cc\
src/base/webutil.cc\
src/query_runner.cc\
src/util.cc\
src/xpaf_parser.cc\
src/xpaf_parser_master.cc\
src/xpath_wrapper.cc
nodist_libxpaf_la_SOURCES =\
src/parsed_document.pb.cc\
src/post_processing_ops.pb.cc\
src/xpaf_parser_def.pb.cc
protoc_inputs =\
src/parsed_document.proto\
src/post_processing_ops.proto\
src/xpaf_parser_def.proto
protoc_outputs =\
src/parsed_document.pb.cc\
src/parsed_document.pb.h\
src/post_processing_ops.pb.cc\
src/post_processing_ops.pb.h\
src/xpaf_parser_def.pb.cc\
src/xpaf_parser_def.pb.h
# Ensure proto headers are built before we attempt to build other targets.
BUILT_SOURCES = $(protoc_outputs)
protoc_helper: $(protoc_inputs)
protoc -I$(srcdir) --cpp_out=. $^
touch protoc_helper
$(protoc_outputs): protoc_helper
bin_PROGRAMS = parse_tool
parse_tool_LDADD = libxpaf.la @LIBGFLAGS_LIBS@
parse_tool_SOURCES = src/parse_tool.cc
##############
# Benchmarks
noinst_PROGRAMS = re2_strstr_bm
re2_strstr_bm_LDADD = @LIBGFLAGS_LIBS@
re2_strstr_bm_SOURCES =\
src/base/benchmark.h\
src/base/benchmark.cc\
src/testing/re2_strstr_bm.cc
noinst_PROGRAMS += xpaf_bm
xpaf_bm_LDADD = libxpaf.la @LIBGFLAGS_LIBS@
xpaf_bm_SOURCES =\
src/base/benchmark.h\
src/base/benchmark.cc\
src/testing/xpaf_bm.cc
##################
# Tests and lint
TESTS =
TESTS += init_test
init_test_LDADD = libxpaf.la @LIBGFLAGS_LIBS@ @LIBGTEST_LIBS@
init_test_SOURCES =\
src/testing/gtest_main.cc\
src/testing/init_test.cc
TESTS += parse_test
parse_test_LDADD = libxpaf.la @LIBGFLAGS_LIBS@ @LIBGTEST_LIBS@
parse_test_SOURCES =\
src/testing/gtest_main.cc\
src/testing/parse_test.cc
noinst_PROGRAMS += $(TESTS)
lint:
gjslint --nojsdoc --nobeep chrome/*.js doc/*.js
#########
# Clean
maintainer-clean-local:
rm -rf m4
rm -rf build-aux
# Note: Assertions inside EXPECT_DEATH tests trigger core dumps, so we delete
# the core file (if it exists) on 'make clean'.
CLEANFILES = $(pkgconfig_DATA) protoc_helper core
MAINTAINERCLEANFILES =\
Makefile.in\
aclocal.m4\
configure
################
# Distribution
EXTRA_DIST =\
autogen.sh\
libtool\
AUTHORS\
CONTRIBUTORS\
README\
LICENSE\
$(protoc_inputs)\
src/testing/*.sh\
src/testing/init_test_data\
src/testing/parse_test_data\
src/testing/xpaf_bm_data\
chrome
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck