forked from facebook/watchman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
374 lines (333 loc) · 8.59 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
ACLOCAL_AMFLAGS=-I m4
bin_PROGRAMS = watchman
# ensure that we have a reasonable default for the python install
DESTDIR ?= /
doc_DATA = README.markdown LICENSE
docdir = ${prefix}/share/doc/watchman-$(VERSION)
THIRDPARTY_CPPFLAGS = -I$(top_srcdir)/thirdparty/jansson -I$(top_builddir)/thirdparty/jansson
JSON_LIB = -L. libwmanjson.a
watchman_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
watchman_LDADD = $(JSON_LIB) libwildmatch.a
watchman_SOURCES = \
ChildProcess.cpp \
ContentHash.cpp \
CookieSync.cpp \
FileDescriptor.cpp \
FileInformation.cpp \
InMemoryView.cpp \
Pipe.cpp \
PubSub.cpp \
ThreadPool.cpp \
QueryableView.cpp \
spawn.cpp \
opt.cpp \
cfg.cpp \
clockspec.cpp \
checksock.cpp \
error_category.cpp \
fstype.cpp \
log.cpp \
ignore.cpp \
json.cpp \
bser.cpp \
expflags.cpp \
hash.cpp \
ioprio.cpp \
opendir.cpp \
pending.cpp \
perf.cpp \
stream.cpp \
stream_stdout.cpp \
stream_unix.cpp \
timedlock.cpp \
cmds/find.cpp \
cmds/info.cpp \
cmds/log.cpp \
cmds/query.cpp \
cmds/since.cpp \
cmds/reg.cpp \
cmds/state.cpp \
cmds/subscribe.cpp \
cmds/trigger.cpp \
cmds/watch.cpp \
cmds/debug.cpp \
query/base.cpp \
query/dirname.cpp \
query/parse.cpp \
query/eval.cpp \
query/glob.cpp \
query/intcompare.cpp \
query/type.cpp \
query/suffix.cpp \
query/match.cpp \
query/pcre.cpp \
query/name.cpp \
query/fieldlist.cpp \
query/since.cpp \
query/empty.cpp \
watcher/auto.cpp \
watcher/fsevents.cpp \
watcher/inotify.cpp \
watcher/kqueue.cpp \
launchd.cpp \
listener.cpp \
listener-user.cpp \
clientmode.cpp \
main.cpp \
root/ageout.cpp \
root/crawler.cpp \
root/dir.cpp \
root/file.cpp \
root/init.cpp \
root/iothread.cpp \
root/notifythread.cpp \
root/poison.cpp \
root/reap.cpp \
root/resolve.cpp \
root/stat.cpp \
root/symlink.cpp \
root/sync.cpp \
root/threading.cpp \
root/vcs.cpp \
root/warnerr.cpp \
root/watchlist.cpp \
scm/Mercurial.cpp \
scm/SCM.cpp \
state.cpp \
string.cpp \
time.cpp
noinst_HEADERS = \
watchman.h \
watchman_hash.h
noinst_LIBRARIES = \
libtap.a \
libwildmatch.a \
libwmanjson.a
# bundled json library
libwmanjson_a_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
libwmanjson_a_SOURCES = \
thirdparty/jansson/dump.cpp \
thirdparty/jansson/error.cpp \
thirdparty/jansson/jansson_private.h \
thirdparty/jansson/load.cpp \
thirdparty/jansson/memory.cpp \
thirdparty/jansson/pack_unpack.cpp \
thirdparty/jansson/strbuffer.cpp \
thirdparty/jansson/strbuffer.h \
thirdparty/jansson/strconv.cpp \
thirdparty/jansson/utf.cpp \
thirdparty/jansson/utf.h \
thirdparty/jansson/value.cpp
# bundled testing library
libtap_a_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
libtap_a_SOURCES = thirdparty/tap.cpp
TAP_LIB = libtap.a
# pattern matching library
libwildmatch_a_SOURCES = thirdparty/wildmatch/wildmatch.c
WILDMATCH_LIB = libwildmatch.a
# unit tests
TESTS = \
tests/art.t \
tests/bser.t \
tests/cache.t \
tests/childproc.t \
tests/future.t \
tests/ignore.t \
tests/pending.t \
tests/result.t \
tests/string.t \
tests/log.t \
tests/wildmatch.t
if ENABLE_CPPCLIENT
lib_LTLIBRARIES = libwatchmanclient.la
libwatchmanclient_ladir = $(includedir)/watchman/
libwatchmanclient_la_HEADERS = \
cppclient/WatchmanClient.h \
cppclient/WatchmanConnection.h
TESTS += tests/integration/cppclient.t
# No IRONMANCFLAGS as this is incompatible with Folly
libwatchmanclient_la_SOURCES = \
cppclient/WatchmanClient.cpp \
cppclient/WatchmanConnection.cpp \
cppclient/WatchmanResponseError.cpp
libwatchmanclient_la_CPPFLAGS = $(FOLLY_CFLAGS)
libwatchmanclient_la_LDFLAGS = -version-info 0:0:0 $(FOLLY_LDFLAGS)
CPPCLIENT_LIB=libwatchmanclient.la
# No IRONMANCFLAGS as this is incompatible with Folly
tests_integration_cppclient_t_CPPFLAGS = $(FOLLY_CFLAGS) -I cppclient/
tests_integration_cppclient_t_LDADD = $(CPPCLIENT_LIB) $(FOLLY_LIBS)
tests_integration_cppclient_t_LDFLAGS = $(FOLLY_LDFLAGS)
tests_integration_cppclient_t_SOURCES = \
tests/integration/cppclient.cpp
# install pkg-config metadata file
pkgconfigdir = $(libdir)/pkgconfig
nodist_pkgconfig_DATA = cppclient/watchmanclient.pc
endif
noinst_PROGRAMS = $(TESTS)
export ARCHFLAGS=@ARCHFLAGS@
if HAVE_PYTHON
py-build:
cd python && $(PYTHON) ./setup.py clean build_py -c -d . build_ext -i
py-install:
cd python && $(PYTHON) ./setup.py install --prefix ${prefix} --root $(DESTDIR)
py-tests:
$(PYTHON) $(TESTNAME)
py-integration:
$(PYTHON) runtests.py --keep-if-fail
py-clean:
-cd python && $(PYTHON) ./setup.py clean --all
else
py-build:
py-tests:
py-clean:
py-install:
py-integration:
@echo You need python to run the tests
false
endif
if HAVE_RUBY
rb-build:
cd ruby/ruby-watchman && bundle && bundle exec rake make
rb-tests:
cd ruby/ruby-watchman && bundle && bundle exec rake spec
rb-clean:
cd ruby/ruby-watchman && bundle && bundle exec rake clean
else
rb-build:
rb-tests:
rb-clean:
endif
all-local: py-build rb-build
install-exec-local: py-install
if WATCHMAN_STATE_DIR
${INSTALL} -d -m 777 ${DESTDIR}${WATCHMAN_STATE_DIR}
chmod g+s ${DESTDIR}${WATCHMAN_STATE_DIR}
touch ${DESTDIR}${WATCHMAN_STATE_DIR}/.not-empty
endif
clean-local: py-clean rb-clean
-find python \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
-rm -rf python/build
# generate a rule that we can use to ensure that
# the test programs are built
build-tests: $(TESTS)
.PHONY: build-tests integration py-tests
# run integration AND unit tests
integration: all py-integration check
tests_art_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_art_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_art_t_SOURCES = \
tests/art_test.cpp \
tests/log_stub.cpp \
PubSub.cpp \
string.cpp \
hash.cpp \
log.cpp
tests_childproc_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_childproc_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_childproc_t_SOURCES = \
tests/childproc.cpp \
tests/log_stub.cpp \
ChildProcess.cpp \
Pipe.cpp \
FileDescriptor.cpp \
FileInformation.cpp \
PubSub.cpp \
string.cpp \
hash.cpp \
log.cpp
tests_cache_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_cache_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_cache_t_SOURCES = \
tests/CacheTest.cpp \
tests/log_stub.cpp \
PubSub.cpp \
ThreadPool.cpp \
string.cpp \
hash.cpp \
log.cpp
tests_future_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_future_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_future_t_SOURCES = \
tests/FutureTest.cpp \
tests/log_stub.cpp \
PubSub.cpp \
ThreadPool.cpp \
string.cpp \
hash.cpp \
log.cpp
tests_result_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_result_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_result_t_SOURCES = \
tests/ResultTest.cpp \
tests/log_stub.cpp \
PubSub.cpp \
string.cpp \
hash.cpp \
log.cpp
tests_ignore_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_ignore_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_ignore_t_SOURCES = \
tests/ignore_test.cpp \
tests/log_stub.cpp \
hash.cpp \
ignore.cpp \
string.cpp \
PubSub.cpp \
log.cpp
tests_string_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_string_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_string_t_SOURCES = \
tests/string_test.cpp \
tests/log_stub.cpp \
PubSub.cpp \
hash.cpp \
log.cpp \
string.cpp
tests_pending_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_pending_t_LDADD = $(TAP_LIB) $(JSON_LIB)
tests_pending_t_SOURCES = \
tests/pending_test.cpp \
tests/log_stub.cpp \
FileDescriptor.cpp \
FileInformation.cpp \
PubSub.cpp \
hash.cpp \
ignore.cpp \
pending.cpp \
expflags.cpp \
opendir.cpp \
cfg.cpp \
time.cpp \
string.cpp \
log.cpp
tests_log_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_log_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_log_t_SOURCES = \
tests/log.cpp \
PubSub.cpp \
string.cpp \
hash.cpp \
log.cpp
tests_bser_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_bser_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_bser_t_SOURCES = \
tests/bser.cpp \
tests/log_stub.cpp \
PubSub.cpp \
bser.cpp \
string.cpp \
hash.cpp \
log.cpp
tests_wildmatch_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_wildmatch_t_LDADD = $(JSON_LIB) $(TAP_LIB) $(WILDMATCH_LIB)
tests_wildmatch_t_SOURCES = \
tests/wildmatch_test.cpp \
tests/log_stub.cpp \
PubSub.cpp \
string.cpp \
hash.cpp \
log.cpp
watch:
PYTHONPATH=python python/bin/watchman-make \
-p '**/*.[ch]' 'Makefile*' '**/*.py' '**/*.php' \
-t integration