forked from facebook/watchman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
170 lines (145 loc) · 3.77 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
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@ -DWATCHMAN_STATE_DIR='"@WATCHMAN_STATE_DIR@"'
watchman_LDADD = $(JSON_LIB)
watchman_SOURCES = \
argv.c \
envp.c \
spawn.c \
opt.c \
cfg.c \
fstype.c \
log.c \
json.c \
bser.c \
hash.c \
ht.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/parse.c \
query/eval.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/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
# 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
# unit tests
TESTS = tests/argv.t tests/log.t tests/bser.t
noinst_PROGRAMS = tests/argv.t tests/log.t tests/bser.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:
time $(PYTHON) $(TESTNAME)
py-clean:
-cd python && $(PYTHON) ./setup.py clean --all
else
py-build:
py-tests:
py-clean:
py-install:
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
${INSTALL} -d -m 777 ${WATCHMAN_STATE_DIR}
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:
arc unit --everything
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