1 ACLOCAL_AMFLAGS = -I m4
2 AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
3 AM_CFLAGS = $(WARN_CFLAGS) $(GCC_ATOMICS_CFLAGS) $(PTHREAD_CFLAGS)
4 AM_LDFLAGS = $(LIBGNU_LIBDEPS)
8 # slow.mk is auto-generated by the maintainer (see GNUmakefile)
9 include $(top_srcdir)/test/slow.mk
13 mog_src += accept_loop.c
17 mog_src += bind_listen.c
18 mog_src += bsd/queue_safe.h
19 mog_src += bsd/simpleq.h
20 mog_src += canonpath.c
23 mog_src += cfg_validate.c
24 mog_src += cloexec_detect.c
25 mog_src += cloexec_from.c
27 mog_src += cmogstored.h
28 mog_src += compat_accept.h
29 mog_src += compat_epoll_pwait.h
30 mog_src += compat_memstream.h
31 mog_src += compat_sendfile.h
46 mog_src += http_date.c
50 mog_src += http_util.h
53 mog_src += ioprio_linux.h
57 mog_src += iostat_process.c
60 mog_src += listen_parser.h
61 mog_src += listen_parser_internal.c
66 mog_src += mkpath_for.c
69 mog_src += mnt_usable.c
71 mog_src += nostd/setproctitle.h
75 mog_src += path_parser.h
78 mog_src += queue_common.c
79 mog_src += queue_epoll.c
80 mog_src += queue_epoll.h
81 mog_src += queue_kqueue.c
82 mog_src += queue_kqueue.h
83 mog_src += queue_loop.c
84 mog_src += queue_step.c
97 LDADD = $(LIBINTL) $(top_builddir)/lib/libgnu.a libnostd.a $(LIB_CLOCK_GETTIME)
98 noinst_LIBRARIES = libnostd.a
99 nostd_include = -include $(top_builddir)/$(CONFIG_HEADER)
100 libnostd_a_SOURCES = nostd/setproctitle.c nostd/setproctitle_noop.c
101 libnostd_a_CFLAGS = $(AM_CFLAGS) $(nostd_include) $(NOSTD_CFLAGS)
105 RL_MAIN = cfg_parser.rl iostat_parser.rl listen_parser.rl mgmt_parser.rl \
106 valid_path.rl http_parser.rl chunk_parser.rl valid_put_path.rl
107 RL_CGEN = $(RL_MAIN:.rl=.c)
108 RL_ALL = listen_parser_common.rl http_common.rl path_parser.rl $(RL_MAIN)
110 cfg_parser.c: cfg_parser.rl listen_parser_common.rl
111 listen_parser.c: listen_parser.rl listen_parser_common.rl
112 http_parser.c: http_parser.rl http_common.rl path_parser.rl
113 mgmt_parser.c: path_parser.rl
114 chunk_parser.c: chunk_parser.rl http_common.rl
116 $(AM_V_GEN)$(RAGEL) $< -C $(RLFLAGS) -o $@
118 BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.gnulib-version
119 bin_PROGRAMS = cmogstored
120 cmogstored_SOURCES = $(mog_src) $(RL_CGEN) cmogstored.c probes.d
125 TEST_EXTENSIONS = .rb .slowrb .perl
126 RB_LOG_COMPILER = $(RUBY)
127 AM_RB_LOG_FLAGS = -I$(top_srcdir)
129 PERL_TESTS = test/mogilefs_integration.perl
130 PERL_LOG_COMPILER = $(PROVE)
132 SLOWRB_LOG_COMPILER = env RUBY=$(RUBY) top_srcdir=$(top_srcdir) $(SHELL)
133 AM_SLOWRB_LOG_FLAGS = -u -e
134 include $(top_srcdir)/test/ruby.mk
135 check_tests = test/valid-path-1 test/trywrite-1 \
136 test/cfg-parser-1 test/fdmap-1 test/thrpool-1 \
138 test/http-parser-1 test/chunk-parser-1 \
140 check_PROGRAMS = $(check_tests)
142 TESTS = $(SLOW_RB_FILES) $(RB_TESTS_FAST) $(check_tests) $(PERL_TESTS)
144 # we need TMPDIR to work in a place where iostat(1) gives stats
145 test_tmpdir = $(top_builddir)/tmp
147 $(RB_TESTS_FAST:.rb=.log): $(bin_PROGRAMS) $(test_tmpdir)/.stamp
148 $(RB_TESTS_SLOW:.slowrb=.log): $(bin_PROGRAMS) $(test_tmpdir)/.stamp
149 $(PERL_TESTS:.perl=.log): $(bin_PROGRAMS) $(test_tmpdir)/.stamp
151 $(test_tmpdir)/.stamp:
152 @mkdir -p $(test_tmpdir) && > $@
154 test_COMMON = $(mog_src) $(RL_CGEN) check.h probes.d
156 test_valid_path_1_SOURCES = test/valid-path-1.c $(test_COMMON)
157 test_trywrite_1_SOURCES = test/trywrite-1.c $(test_COMMON)
158 test_cfg_parser_1_SOURCES = test/cfg-parser-1.c $(test_COMMON)
159 test_fdmap_1_SOURCES = test/fdmap-1.c $(test_COMMON)
160 test_thrpool_1_SOURCES = test/thrpool-1.c $(test_COMMON)
161 test_queue_idle_1_SOURCES = test/queue-idle-1.c $(test_COMMON)
162 test_http_parser_1_SOURCES = test/http-parser-1.c $(test_COMMON)
163 test_chunk_parser_1_SOURCES = test/chunk-parser-1.c $(test_COMMON)
164 test_ioutil_1_SOURCES = test/ioutil-1.c $(test_COMMON)
168 check_PROGRAMS += test/epoll-wrap
169 test_epoll_wrap_SOURCES = $(cmogstored_SOURCES) test/epoll-wrap.c
170 test_epoll_wrap_LDFLAGS = $(cmogstored_LDFLAGS) $(AM_LDFLAGS) \
171 -Wl,--wrap=epoll_ctl -Wl,--wrap=epoll_create
174 check_PROGRAMS += test/pwrite-wrap
175 test_pwrite_wrap_SOURCES = $(cmogstored_SOURCES) test/pwrite-wrap.c
176 test_pwrite_wrap_LDFLAGS = $(cmogstored_LDFLAGS) $(AM_LDFLAGS) \
182 dist_man_MANS = cmogstored.1
184 cmogstored.1: cmogstored.x cmogstored.c
186 $(AM_V_GEN)if test -f $(top_builddir)/cmogstored; then \
187 $(HELP2MAN) -i $< -N $(top_builddir)/cmogstored > $@.$$$$ && \
190 vcs_doc := README INSTALL TODO doc/queues.txt doc/design.txt
191 extra_doc = HACKING NEWS ChangeLog TODO
193 $(top_srcdir)/NEWS: configure.ac
194 $(AM_V_GEN)$(RAKE) -sq news > $@.$$$$ && mv $@.$$$$ $@
195 $(top_srcdir)/ChangeLog: configure.ac
196 $(AM_V_GEN)$(RAKE) -sq changelog > $@.$$$$ && mv $@.$$$$ $@
197 $(top_srcdir)/cmogstored.1.txt: $(top_srcdir)/cmogstored.1
198 $(AM_V_GEN)man --nh $(top_srcdir)/$< > $@.$$$$ && mv $@.$$$$ $@
202 RSYNC_DEST = yhbt.net:/srv/yhbt/cmogstored/
203 HTML_DOC = $(vcs_doc) HACKING NEWS ChangeLog cmogstored.1.txt
204 WWW_DOC = $(HTML_DOC) NEWS.atom.xml
205 NEWS.atom.xml: configure.ac
206 $(AM_V_GEN)$(RAKE) -sq news_atom > $@.$$$$ && mv $@.$$$$ $@
208 html = $${i%.txt}.html
209 publish: NEWS.atom.xml NEWS ChangeLog cmogstored.1.txt
210 mkdir -p www/examples/
211 # n.b. git set-file-times is non-standard, but distributed with rsync
212 -cd $(top_srcdir) && git set-file-times $(vcs_doc)
213 $(INSTALL_DATA) -p $(addprefix $(top_srcdir)/,$(WWW_DOC)) www/
214 $(INSTALL_DATA) -p $(addprefix $(top_srcdir)/,$(examples)) \
216 set -e && cd www && \
217 for i in $(notdir $(WWW_DOC)) $(examples); do \
218 $(GZIP) < $$i > $$i.gz; \
220 touch -r $$i $$i.gz; \
222 for i in $(notdir $(HTML_DOC)); do \
223 i=$$(basename $$i); \
224 ../build-aux/txt2pre $$i > $(html); \
226 $(GZIP) < $(html) > $(html).gz; \
227 touch -r $(html) $(html).gz; \
229 $(RSYNC) -av www/ $(RSYNC_DEST)
233 tap_support = tapset/all.stp tapset/http_access_log.gawk tapset/ioq_wait.awk
234 examples := examples/cmogstored.socket examples/cmogstored@.service
236 EXTRA_DIST = $(RB_TESTS) $(RL_CGEN) $(RL_ALL) $(PERL_TESTS) $(extra_doc) \
237 .gitignore .gitattributes \
238 Rakefile autogen.sh GNUmakefile bsd/README doc m4 \
239 test/test_helper.rb test/iostat-mock.rb \
240 test/.gitignore test/gen-slow.sh test/slow.mk \
241 cmogstored.x .ctags $(SLOW_RB_FILES) \
242 build-aux/.gitignore build-aux/snippet/.gitignore build-aux/txt2pre \
244 $(top_srcdir)/.version $(top_srcdir)/.gnulib-version \
245 test/valgrind.supp nostd/README \
249 TESTS_ENVIRONMENT = PATH=$(top_builddir):$$PATH TMPDIR=$(test_tmpdir)
251 VALGRIND = valgrind -v --show-reachable=yes --leak-check=yes \
252 --track-origins=yes --error-exitcode=126 \
253 --suppressions=$(top_srcdir)/test/valgrind.supp
254 VALGRIND_CHECK = check
256 VALGRIND="$(VALGRIND)" $(MAKE) $(VALGRIND_CHECK)
258 CLEANFILES = -r $(test_tmpdir) $(top_srcdir)/tmp
259 MAINTAINERCLEANFILES = $(dist_man_MANS)
260 include $(top_srcdir)/build-aux/coverage.mk
261 include $(top_srcdir)/build-aux/release.mk
262 include $(top_srcdir)/build-aux/sparse.mk
263 include $(top_srcdir)/build-aux/pgo.mk
265 $(top_srcdir)/.version:
266 echo $(VERSION) > $@-t && mv $@-t $@
267 $(top_srcdir)/.gnulib-version:
268 cd $(top_srcdir) && ./autogen.sh
270 echo $(VERSION) > $(distdir)/.tarball-version
274 $(DTRACE) -C -h -s $< -o $@
277 $(DTRACE) -C -G -s $< -o $@
280 EXTRA_DIST += probes.h
281 BUILT_SOURCES += probes.h