forked from facebook/watchman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
263 lines (231 loc) · 5.78 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
bin_PROGRAMS = watchman
# ensure that we have a reasonable default for the python install
DESTDIR ?= /
doc_DATA = README.markdown
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) $(ART_LIB) libwildmatch.a
watchman_SOURCES = \
argv.c \
envp.c \
spawn.c \
opt.c \
cfg.c \
clockspec.c \
checksock.c \
fstype.c \
log.c \
ignore.c \
json.c \
bser.c \
expflags.c \
hash.c \
ht.c \
ioprio.c \
opendir.c \
pending.c \
perf.c \
stream.c \
stream_stdout.c \
stream_unix.c \
timedlock.c \
cmds/find.c \
cmds/info.c \
cmds/log.c \
cmds/query.c \
cmds/since.c \
cmds/reg.c \
cmds/state.c \
cmds/subscribe.c \
cmds/trigger.c \
cmds/watch.c \
cmds/debug.c \
query/base.c \
query/dirname.c \
query/parse.c \
query/eval.c \
query/intcompare.c \
query/type.c \
query/suffix.c \
query/match.c \
query/pcre.c \
query/name.c \
query/fieldlist.c \
query/since.c \
query/empty.c \
watcher/auto.c \
watcher/fsevents.c \
watcher/helper.c \
watcher/inotify.c \
watcher/kqueue.c \
watcher/portfs.c \
launchd.c \
listener.c \
listener-user.c \
clientmode.c \
main.c \
root.c \
state.c \
string.c \
time.c
noinst_HEADERS = \
watchman.h \
watchman_hash.h
noinst_LIBRARIES = \
libart.a \
libtap.a \
libwildmatch.a \
libwmanjson.a
# bundled json library
libwmanjson_a_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
libwmanjson_a_SOURCES = \
thirdparty/jansson/dump.c \
thirdparty/jansson/error.c \
thirdparty/jansson/hashtable.c \
thirdparty/jansson/hashtable.h \
thirdparty/jansson/jansson_private.h \
thirdparty/jansson/load.c \
thirdparty/jansson/memory.c \
thirdparty/jansson/pack_unpack.c \
thirdparty/jansson/strbuffer.c \
thirdparty/jansson/strbuffer.h \
thirdparty/jansson/strconv.c \
thirdparty/jansson/utf.c \
thirdparty/jansson/utf.h \
thirdparty/jansson/value.c
# bundled testing library
libtap_a_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
libtap_a_SOURCES = thirdparty/tap.c
TAP_LIB = libtap.a
# pattern matching library
libwildmatch_a_SOURCES = thirdparty/wildmatch/wildmatch.c
WILDMATCH_LIB = libwildmatch.a
# adaptive radix tree library
libart_a_SOURCES = thirdparty/libart/src/art.c
ART_LIB = libart.a
# unit tests
TESTS = \
tests/art.t \
tests/argv.t \
tests/bser.t \
tests/ignore.t \
tests/pending.t \
tests/log.t \
tests/wildmatch.t
noinst_PROGRAMS = $(TESTS)
if HAVE_ARC
# Run lint and output stuff suitable for feeding into ":make" in vim
# quickfix mode.
lint:
-arc lint --output compiler --lintall
else
lint:
endif
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)
# This is invoked via WatchmanIntegrationEngine
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 lint
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: lint build-tests integration py-tests
# run integration AND unit tests
integration: all py-integration
tests_art_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_art_t_LDADD = $(ART_LIB) $(TAP_LIB)
tests_art_t_SOURCES = \
tests/art_test.c \
tests/log_stub.c \
log.c
tests_argv_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_argv_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_argv_t_SOURCES = \
tests/argv.c \
argv.c
tests_ignore_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_ignore_t_LDADD = $(ART_LIB) $(TAP_LIB) $(JSON_LIB)
tests_ignore_t_SOURCES = \
tests/ignore_test.c \
tests/log_stub.c \
watcher/helper.c \
hash.c \
ht.c \
ignore.c \
string.c \
log.c
tests_pending_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_pending_t_LDADD = $(ART_LIB) $(TAP_LIB) $(JSON_LIB)
tests_pending_t_SOURCES = \
tests/pending_test.c \
tests/log_stub.c \
watcher/helper.c \
hash.c \
ht.c \
ignore.c \
pending.c \
expflags.c \
opendir.c \
cfg.c \
time.c \
string.c \
log.c
tests_log_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_log_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_log_t_SOURCES = \
tests/log.c \
log.c
tests_bser_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_bser_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_bser_t_SOURCES = \
tests/bser.c \
bser.c
tests_wildmatch_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS) @IRONMANCFLAGS@
tests_wildmatch_t_LDADD = $(JSON_LIB) $(TAP_LIB) $(WILDMATCH_LIB)
tests_wildmatch_t_SOURCES = \
tests/wildmatch_test.c
watch:
PYTHONPATH=python python/bin/watchman-make \
-p '**/*.[ch]' 'Makefile*' '**/*.py' '**/*.php' \
-t integration