forked from facebook/watchman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
203 lines (175 loc) · 4.62 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
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) libwildmatch.a
watchman_SOURCES = \
argv.c \
envp.c \
spawn.c \
opt.c \
cfg.c \
checksock.c \
fstype.c \
log.c \
json.c \
bser.c \
expflags.c \
hash.c \
ht.c \
ioprio.c \
opendir.c \
pending.c \
stream.c \
stream_stdout.c \
stream_unix.c \
cmds/find.c \
cmds/info.c \
cmds/log.c \
cmds/query.c \
cmds/since.c \
cmds/reg.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/fsevents.c \
watcher/helper.c \
watcher/inotify.c \
watcher/kqueue.c \
watcher/portfs.c \
listener.c \
clientmode.c \
main.c \
root.c \
state.c \
string.c
noinst_HEADERS = \
watchman.h \
watchman_hash.h
noinst_LIBRARIES = libwmanjson.a libtap.a libwildmatch.a
# bundled json library
libwmanjson_a_CPPFLAGS = $(THIRDPARTY_CPPFLAGS)
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)
libtap_a_SOURCES = thirdparty/tap.c
TAP_LIB = libtap.a
# pattern matching library
libwildmatch_a_SOURCES = thirdparty/wildmatch/wildmatch.c
WILDMATCH_LIB = libwildmatch.a
# unit tests
TESTS = tests/argv.t tests/log.t tests/bser.t tests/wildmatch.t
noinst_PROGRAMS = tests/argv.t tests/log.t tests/bser.t tests/wildmatch.t
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
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_argv_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS)
tests_argv_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_argv_t_SOURCES = \
tests/argv.c \
argv.c
tests_log_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS)
tests_log_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_log_t_SOURCES = \
tests/log.c \
log.c
tests_bser_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS)
tests_bser_t_LDADD = $(JSON_LIB) $(TAP_LIB)
tests_bser_t_SOURCES = \
tests/bser.c \
bser.c
tests_wildmatch_t_CPPFLAGS = $(THIRDPARTY_CPPFLAGS)
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