]>
Commit | Line | Data |
---|---|---|
1 | # Makefile.am --- automake input file for systemtap | |
2 | ## process this file with automake to produce Makefile.in | |
3 | ||
4 | # we don't maintain a ChangeLog, which makes us non-GNU -> foreign | |
5 | AUTOMAKE_OPTIONS = no-dist foreign subdir-objects | |
6 | ||
7 | pkglibexecdir = ${libexecdir}/${PACKAGE} | |
8 | oldincludedir = ${includedir}/sys | |
9 | ||
10 | AM_CPPFLAGS = -DBINDIR='"$(bindir)"' \ | |
11 | -DSYSCONFDIR='"$(sysconfdir)"' \ | |
12 | -DPKGDATADIR='"$(pkgdatadir)"' \ | |
13 | -DPKGLIBDIR='"$(pkglibexecdir)"' \ | |
14 | -DLOCALEDIR='"$(localedir)"' \ | |
15 | -DDOCDIR='"$(docdir)"' \ | |
16 | -DPYEXECDIR='"$(pyexecdir)"' \ | |
17 | -DPY3EXECDIR='"$(py3execdir)"' \ | |
18 | -I$(srcdir)/includes -I$(builddir)/includes/sys | |
19 | ||
20 | AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Wextra -Wunused -Wformat=2 -W | |
21 | AM_CXXFLAGS = -Wall -Wextra | |
22 | if Werror | |
23 | AM_CFLAGS += -Werror | |
24 | AM_CXXFLAGS += -Werror | |
25 | endif | |
26 | ||
27 | bin_SCRIPTS = stap-report stap-profile-annotate stap-prep | |
28 | pkglibexec_SCRIPTS = stap-env | |
29 | oldinclude_HEADERS = includes/sys/sdt.h includes/sys/sdt-config.h | |
30 | ||
31 | bin_PROGRAMS = | |
32 | ||
33 | if BUILD_TRANSLATOR | |
34 | bin_PROGRAMS += stap | |
35 | bin_SCRIPTS += dtrace | |
36 | ||
37 | pkglibexec_PROGRAMS = | |
38 | ||
39 | if HAVE_NSS | |
40 | pkglibexec_PROGRAMS += stap-sign-module stap-authorize-cert | |
41 | ||
42 | if BUILD_SERVER | |
43 | pkglibexec_PROGRAMS += stap-serverd stap-gen-cert | |
44 | bin_SCRIPTS += stap-server | |
45 | pkglibexec_SCRIPTS += stap-start-server stap-stop-server | |
46 | endif | |
47 | endif | |
48 | ||
49 | stap_SOURCES = main.cxx session.cxx \ | |
50 | parse.cxx staptree.cxx elaborate.cxx translate.cxx \ | |
51 | tapsets.cxx buildrun.cxx loc2stap.cxx hash.cxx mdfour.c \ | |
52 | cache.cxx util.cxx coveragedb.cxx dwarf_wrappers.cxx \ | |
53 | tapset-been.cxx tapset-procfs.cxx tapset-timers.cxx tapset-netfilter.cxx \ | |
54 | tapset-perfmon.cxx tapset-mark.cxx \ | |
55 | tapset-utrace.cxx task_finder.cxx dwflpp.cxx rpm_finder.cxx \ | |
56 | setupdwfl.cxx remote.cxx privilege.cxx cmdline.cxx \ | |
57 | tapset-dynprobe.cxx tapset-method.cxx translator-output.cxx \ | |
58 | stapregex.cxx stapregex-tree.cxx stapregex-parse.cxx \ | |
59 | stapregex-dfa.cxx stringtable.cxx tapset-python.cxx \ | |
60 | tapset-debuginfod.cxx analysis.cxx | |
61 | noinst_HEADERS = sdt_types.h | |
62 | stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @LIBINTL@ -lpthread @debuginfod_LDFLAGS@ @debuginfod_LIBS@ @DYNINST_LDFLAGS@ @DYNINST_LIBS@ | |
63 | stap_DEPENDENCIES = | |
64 | ||
65 | if HAVE_LANGUAGE_SERVER_SUPPORT | |
66 | stap_SOURCES += language-server/stap-language-server.cxx \ | |
67 | language-server/stap-code-completion.cxx language-server/jsonrpc.cxx | |
68 | endif | |
69 | ||
70 | if HAVE_LIBREADLINE | |
71 | stap_SOURCES += interactive.cxx | |
72 | stap_LDADD += @READLINE_LIBS@ | |
73 | endif | |
74 | ||
75 | if HAVE_JSON_C | |
76 | stap_LDADD += $(jsonc_LIBS) | |
77 | endif | |
78 | ||
79 | if HAVE_BPF_DECLS | |
80 | stap_SOURCES += bpf-base.cxx bpf-bitset.cxx bpf-translate.cxx bpf-opt.cxx | |
81 | endif | |
82 | ||
83 | if BUILD_VIRT | |
84 | bin_PROGRAMS += stapvirt | |
85 | stapvirt_SOURCES = stapvirt.c | |
86 | stapvirt_CFLAGS = $(AM_CFLAGS) | |
87 | stapvirt_CFLAGS += $(libvirt_CFLAGS) $(libxml2_CFLAGS) | |
88 | stapvirt_LDFLAGS = $(AM_LDFLAGS) | |
89 | stapvirt_LDADD = $(libvirt_LIBS) $(libxml2_LIBS) | |
90 | endif | |
91 | ||
92 | endif | |
93 | ||
94 | all: macros.systemtap | |
95 | ||
96 | macros.systemtap: $(srcdir)/macros.systemtap.in | |
97 | sed -e "s#@pkgdatadir@#$(pkgdatadir)#g" < $< > $@ | |
98 | ||
99 | install: all | |
100 | $(MAKE) $(AM_MAKEFLAGS) install-recursive | |
101 | ||
102 | BUILT_SOURCES = | |
103 | CLEANFILES = | |
104 | ||
105 | # Arrange for git_version.h to be regenerated at every "make". | |
106 | # Code fragment is based upon RadeonHD.am. | |
107 | ||
108 | # The stamp file which is never created ensures that git_version.h is updated | |
109 | # before every build. Having git_version.h in foo_SOURCES ensures a recompile | |
110 | # of foo-bar.c if it is newer than the foo-bar.o file. Using noinst_foo_SOURCES | |
111 | # instead of foo_SOURCES prevents shipping git_version.h in dist tarballs, | |
112 | # which may cause false GIT_FOO readings. | |
113 | BUILT_SOURCES += git_version.stamp | |
114 | CLEANFILES += git_version.h | |
115 | GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh | |
116 | git_version.stamp: | |
117 | @if test -f "$(srcdir)/git_version.h"; then \ | |
118 | if test -f "git_version.h"; then :; \ | |
119 | else \ | |
120 | cp "$(srcdir)/git_version.h" "git_version.h"; \ | |
121 | fi; \ | |
122 | fi | |
123 | $(GIT_VERSION_CMD) -k -s $(top_srcdir) -o git_version.h | |
124 | @if test -s "$(srcdir)/git_version.h"; then \ | |
125 | if cmp "$(srcdir)/git_version.h" "git_version.h"; then :; \ | |
126 | else \ | |
127 | echo "Error: $(srcdir)/git_version.h and git_version.h differ."; \ | |
128 | echo " You probably want to remove the former."; \ | |
129 | exit 1; \ | |
130 | fi; \ | |
131 | fi | |
132 | ||
133 | git_version.h: | |
134 | $(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h | |
135 | ||
136 | cscope: | |
137 | cd $(srcdir) && \ | |
138 | (echo -q ; git ls-files '*.cxx' '*.c' '*.h' | grep -v '^testsuite' ) > cscope.files && \ | |
139 | cscope -b -q @DYNINST_CXXFLAGS@ | |
140 | ||
141 | PHONIES = | |
142 | if BUILD_TRANSLATOR | |
143 | stap_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ | |
144 | stap_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ @ALIGNEDNEW@ @debuginfod_CFLAGS@ | |
145 | stap_CPPFLAGS = $(AM_CPPFLAGS) -DSTAP_SDT_V2 | |
146 | stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ @BOOST_SYSTEM_LIB@ | |
147 | ||
148 | if HAVE_DYNINST | |
149 | stap_CXXFLAGS += $(DYNINST_CXXFLAGS) | |
150 | endif | |
151 | ||
152 | if HAVE_AVAHI | |
153 | stap_CXXFLAGS += $(avahi_CFLAGS) | |
154 | stap_CPPFLAGS += $(avahi_CFLAGS) | |
155 | stap_LDADD += $(avahi_LIBS) | |
156 | endif | |
157 | ||
158 | if NEED_BASE_CLIENT_CODE | |
159 | stap_SOURCES += csclient.cxx | |
160 | endif | |
161 | ||
162 | if HAVE_NSS | |
163 | stap_SOURCES += nsscommon.cxx client-nss.cxx cscommon.cxx nss-server-info.cxx | |
164 | stap_CFLAGS += $(nss_CFLAGS) -DSTAP | |
165 | stap_CXXFLAGS += $(nss_CFLAGS) | |
166 | stap_CPPFLAGS += $(nss_CFLAGS) | |
167 | stap_LDADD += $(nss_LIBS) | |
168 | ||
169 | install-exec-local: install-scripts | |
170 | ||
171 | PHONIES += install-scripts | |
172 | # scripts must be installed before this rule is run | |
173 | install-scripts: install-binSCRIPTS install-pkglibexecSCRIPTS | |
174 | for f in $(bin_SCRIPTS); do \ | |
175 | sed -i -e "s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(bindir)/$$f; \ | |
176 | done | |
177 | for f in $(pkglibexec_SCRIPTS); do \ | |
178 | sed -i -e "/INSTALL-HOOK/d;s,sysconfdir=.*,sysconfdir=$(sysconfdir),;s,pkglibexecdir=.*,pkglibexecdir=$(pkglibexecdir)/,;s,localstatedir=.*,localstatedir=$(localstatedir),;s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(pkglibexecdir)/$$f; \ | |
179 | done | |
180 | endif | |
181 | ||
182 | if HAVE_HTTP_SUPPORT | |
183 | stap_SOURCES += client-http.cxx | |
184 | stap_LDADD += $(libcurl_LIBS) $(jsonc_LIBS) $(openssl_LIBS) | |
185 | endif | |
186 | ||
187 | endif | |
188 | ||
189 | CLEANFILES += $(pkglibexec_PROGRAMS) | |
190 | ||
191 | if BUILD_TRANSLATOR | |
192 | if HAVE_NSS | |
193 | stap_sign_module_SOURCES = stap-sign-module.cxx nsscommon.cxx util.cxx | |
194 | stap_sign_module_CPPFLAGS = $(AM_CPPFLAGS) | |
195 | stap_sign_module_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
196 | stap_sign_module_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
197 | stap_sign_module_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS) | |
198 | stap_sign_module_LDADD = $(nss_LIBS) $(debuginfod_LIBS) | |
199 | if HAVE_HTTP_SUPPORT | |
200 | stap_sign_module_LDADD += $(openssl_LIBS) | |
201 | endif | |
202 | ||
203 | stap_authorize_cert_SOURCES = stap-authorize-cert.cxx nsscommon.cxx util.cxx | |
204 | stap_authorize_cert_CPPFLAGS = $(AM_CPPFLAGS) | |
205 | stap_authorize_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
206 | stap_authorize_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
207 | stap_authorize_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS) | |
208 | stap_authorize_cert_LDADD = $(nss_LIBS) $(debuginfod_LIBS) | |
209 | if HAVE_HTTP_SUPPORT | |
210 | stap_authorize_cert_LDADD += $(openssl_LIBS) | |
211 | endif | |
212 | ||
213 | if BUILD_SERVER | |
214 | stap_serverd_SOURCES = stap-serverd.cxx cscommon.cxx util.cxx privilege.cxx nsscommon.cxx cmdline.cxx | |
215 | stap_serverd_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
216 | stap_serverd_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
217 | stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS) | |
218 | stap_serverd_LDADD = $(nss_LIBS) -lpthread $(debuginfod_LIBS) | |
219 | if HAVE_AVAHI | |
220 | stap_serverd_CFLAGS += $(avahi_CFLAGS) | |
221 | stap_serverd_CXXFLAGS += $(avahi_CFLAGS) | |
222 | stap_serverd_LDADD += $(avahi_LIBS) | |
223 | endif | |
224 | if HAVE_HTTP_SUPPORT | |
225 | stap_serverd_LDADD += $(openssl_LIBS) | |
226 | endif | |
227 | ||
228 | ||
229 | stap_gen_cert_SOURCES = stap-gen-cert.cxx util.cxx nsscommon.cxx | |
230 | stap_gen_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
231 | stap_gen_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) $(debuginfod_CFLAGS) | |
232 | stap_gen_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ $(debuginfod_LDFLAGS) | |
233 | stap_gen_cert_LDADD = $(nss_LIBS) $(debuginfod_LIBS) | |
234 | if HAVE_HTTP_SUPPORT | |
235 | stap_gen_cert_LDADD += $(openssl_LIBS) | |
236 | endif | |
237 | endif | |
238 | endif | |
239 | endif | |
240 | ||
241 | # crash(8) extension | |
242 | if BUILD_CRASHMOD | |
243 | STAPLOG=staplog.so | |
244 | ||
245 | $(STAPLOG): staplog.c | |
246 | $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \ | |
247 | $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $< | |
248 | all-local: $(STAPLOG) example_index | |
249 | install-exec-local: $(STAPLOG) | |
250 | $(MKDIR_P) $(DESTDIR)$(pkglibdir) | |
251 | $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir) | |
252 | else | |
253 | all-local: example_index | |
254 | endif | |
255 | ||
256 | # Get extra libs as needed | |
257 | LDADD = | |
258 | ||
259 | EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples | |
260 | EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta | |
261 | ||
262 | example_index: $(EXAMPLE_SOURCE_DIR)/index.html | |
263 | ||
264 | $(EXAMPLE_SOURCE_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN) | |
265 | @echo "The script example index is outdated, run" | |
266 | @echo " cd $(EXAMPLE_SOURCE_DIR) && \\ " | |
267 | @echo " perl examples-index-gen.pl" | |
268 | @echo "to regenerate it." | |
269 | ||
270 | install-data-local: | |
271 | (cd $(srcdir)/runtime; for f in *.[ch]; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/$$f; done) | |
272 | if HAVE_DYNINST | |
273 | (cd $(srcdir)/runtime/dyninst; find . \( -name '*.[ch]' \) -print \ | |
274 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/dyninst/$$f; done) | |
275 | endif | |
276 | (cd $(srcdir)/runtime/unwind; find . \( -name '*.[ch]' \) -print \ | |
277 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/unwind/$$f; done) | |
278 | (cd $(srcdir)/runtime/transport; for f in *.[ch]; \ | |
279 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/transport/$$f; done) | |
280 | (cd $(srcdir)/runtime/softfloat; for f in *.[ch]; \ | |
281 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/softfloat/$$f; done) | |
282 | (cd $(srcdir)/runtime/linux; for f in *.[ch]; \ | |
283 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/$$f; done) | |
284 | (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name '*.stpm' -o -name README \) -print \ | |
285 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done) | |
286 | (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \ | |
287 | | grep -E -v 'check.exp|ChangeLog|examples-index-gen.pl|html/.*\.tmpl|metadatabase.dbq$$' \ | |
288 | | while read f; do if test -x $$f; then \ | |
289 | i_cmd="$(INSTALL_PROGRAM)"; else \ | |
290 | i_cmd="$(INSTALL_DATA)"; fi; \ | |
291 | $$i_cmd -D $$f $(DESTDIR)$(pkgdatadir)/examples/$$f; done) | |
292 | test -e $(DESTDIR)$(sysconfdir)/systemtap || mkdir -p $(DESTDIR)$(sysconfdir)/systemtap | |
293 | if BUILD_SERVER | |
294 | test -e $(DESTDIR)$(localstatedir)/run/stap-server || mkdir -p $(DESTDIR)$(localstatedir)/run/stap-server | |
295 | test -e $(DESTDIR)$(localstatedir)/log || mkdir -p $(DESTDIR)$(localstatedir)/log | |
296 | endif | |
297 | ||
298 | ||
299 | TEST_COV_DIR = coverage | |
300 | ||
301 | gcov: | |
302 | find . -name '*.gc*' | xargs rm -f | |
303 | $(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" CFLAGS="-g -fprofile-arcs -ftest-coverage" all install | |
304 | -sudo $(MAKE) installcheck $${RUNTESTFLAGS+RUNTESTFLAGS=$${RUNTESTFLAGS}} | |
305 | for dir in $(SUBDIRS); do \ | |
306 | (cd $$dir; gcov *.gcno > SUMMARY.gcov 2>&1 || true); \ | |
307 | done | |
308 | find . -name '*.gcov' | |
309 | ||
310 | clean-local: | |
311 | rm -rf ${PACKAGE_TARNAME}-*.tar.gz | |
312 | rm -rf ${PACKAGE_TARNAME}-${PACKAGE_VERSION} | |
313 | rm -rf $(TEST_COV_DIR) | |
314 | rm -rf stap.info | |
315 | rm -rf staplog.so | |
316 | ||
317 | distclean-local: | |
318 | rm -f doc/beginners/en-US doc/beginners/build/en-US/testsuite | |
319 | ||
320 | uninstall-local: | |
321 | rm -rf $(DESTDIR)$(pkgdatadir) | |
322 | rm -rf $(DESTDIR)$(libdir)/$(PACKAGE) | |
323 | -rm -rf $(DESTDIR)$(localstatedir)/cache/$(PACKAGE) | |
324 | @list='$(EXAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ | |
325 | echo " rm -f '$(EXAMPLE_INSTALL_DIR)/$$p'"; \ | |
326 | rm -f "$(EXAMPLE_INSTALL_DIR)/$$p"; \ | |
327 | done | |
328 | @list='$(DEMO_SRC)'; for f in $$list; do p=`basename $$f`; \ | |
329 | echo " rm -f '$(DEMO_INSTALL_DIR)/$$p'"; \ | |
330 | rm -f "$(DEMO_INSTALL_DIR)/$$p"; \ | |
331 | done | |
332 | @list='$(SAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ | |
333 | echo " rm -f '$(SAMPLE_INSTALL_DIR)/$$p'"; \ | |
334 | rm -f "$(SAMPLE_INSTALL_DIR)/$$p"; \ | |
335 | done | |
336 | rm -rf $(DESTDIR)$(sysconfdir)/systemtap | |
337 | rm -rf $(DESTDIR)$(docdir)/examples | |
338 | if BUILD_SERVER | |
339 | rm -rf $(DESTDIR)$(localstatedir)/run/stap-server | |
340 | rm -f $(DESTDIR)$(localstatedir)/log/stap-server/log | |
341 | endif | |
342 | ||
343 | SUBDIRS = . java python stapdyn staprun stapbpf doc man po httpd stap-exporter interactive-notebook | |
344 | # NB: the gcov target above uses this to enumarate linked binaries' build directories | |
345 | DIST_SUBDIRS = testsuite $(SUBDIRS) | |
346 | EXTRA_DIST = m4/ChangeLog | |
347 | ||
348 | check-local: | |
349 | SRCDIR=`cd $(srcdir); pwd`; \ | |
350 | PWD=`pwd`; \ | |
351 | $(MAKE) -C testsuite check SYSTEMTAP_RUNTIME=$$SRCDIR/runtime SYSTEMTAP_TAPSET=$$SRCDIR/tapset LD_LIBRARY_PATH=$$LD_LIBRARY_PATH$${LD_LIBRARY_PATH:+:}$$PWD/lib-elfutils:$$PWD/lib-elfutils/systemtap SYSTEMTAP_PATH=$$PWD SYSTEMTAP_INCLUDES=$$PWD/includes RUNTESTFLAGS="$(RUNTESTFLAGS)" PKGLIBDIR="$(pkglibexecdir)"; | |
352 | ||
353 | installcheck: | |
354 | if test \! -e $(DESTDIR)$(bindir)/stap; then \ | |
355 | echo $(DESTDIR)$(bindir)/stap doesn\'t exist, run make install; \ | |
356 | exit -1; \ | |
357 | fi; \ | |
358 | if test $(builddir)/stap -nt $(DESTDIR)$(bindir)/stap; then \ | |
359 | echo "$(DESTDIR)$(bindir)/stap is not recent, run make install"; \ | |
360 | exit -1; \ | |
361 | fi; | |
362 | $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" | |
363 | ||
364 | installcheck-parallel: | |
365 | if test \! -e $(DESTDIR)$(bindir)/stap; then \ | |
366 | echo $(DESTDIR)$(bindir)/stap doesn\'t exist, run make install; \ | |
367 | exit -1; \ | |
368 | fi; \ | |
369 | if test $(builddir)/stap -nt $(DESTDIR)$(bindir)/stap; then \ | |
370 | echo "$(DESTDIR)$(bindir)/stap is not recent, run make install"; \ | |
371 | exit -1; \ | |
372 | fi; | |
373 | $(MAKE) -C testsuite installcheck-parallel RUNTESTFLAGS="$(RUNTESTFLAGS)" | |
374 | ||
375 | list-unfinished: | |
376 | if test \! -e $(DESTDIR)$(bindir)/stap; then \ | |
377 | echo $(DESTDIR)$(bindir)/stap doesn\'t exist, run make install; \ | |
378 | exit -1; \ | |
379 | fi; \ | |
380 | if test $(builddir)/stap -nt $(DESTDIR)$(bindir)/stap; then \ | |
381 | echo "$(DESTDIR)$(bindir)/stap is not recent, run make install"; \ | |
382 | exit -1; \ | |
383 | fi; | |
384 | $(MAKE) -C testsuite list-unfinished RUNTESTFLAGS="$(RUNTESTFLAGS)" | |
385 | ||
386 | PHONIES += runcheck | |
387 | # All the variables are overridden by run-stap, but SYSTEMTAP_RUNTIME | |
388 | # is used by the testsuite scripts themselves. | |
389 | runcheck: testsuite/stap testsuite/dtrace | |
390 | $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" \ | |
391 | SYSTEMTAP_PATH="`cd testsuite; pwd`" \ | |
392 | SYSTEMTAP_RUNTIME="`cd $(srcdir)/runtime; pwd`" | |
393 | testsuite/stap: run-stap | |
394 | (echo '#!/bin/sh'; echo "exec `pwd`/run-stap" '$${1+"$$@"}') > $@.new | |
395 | chmod 555 $@.new | |
396 | mv -f $@.new $@ | |
397 | testsuite/dtrace: dtrace | |
398 | (echo '#!/bin/sh'; echo "exec `pwd`/dtrace" '$${1+"$$@"}') > $@.new | |
399 | chmod 555 $@.new | |
400 | mv -f $@.new $@ | |
401 | ||
402 | PHONIES += update-po | |
403 | update-po: | |
404 | (cd $(srcdir); ls -1d *.c *.cxx *.h staprun/*.c staprun/*.h) \ | |
405 | | grep -v loc2c-test.c \ | |
406 | | grep -v config.h \ | |
407 | | grep -v git_version.h \ | |
408 | | grep -v staprun/config.h \ | |
409 | | sort > $(srcdir)/po/POTFILES.in | |
410 | $(MAKE) -C po update-po | |
411 | @echo | |
412 | @echo if systemtam.pot is shown as modified ... | |
413 | @echo | |
414 | (cd $(srcdir)/po; git status *.pot) | |
415 | @echo | |
416 | @echo ... then check in with zanata ... | |
417 | @echo | |
418 | @echo % cd $(srcdir) | |
419 | @echo % zanata-cli -B push -s po -t po | |
420 | @echo % zanata-cli -B pull -s po -t po | |
421 | @echo | |
422 | @echo if the .po files are shown as modified ... | |
423 | @echo | |
424 | (cd $(srcdir)/po; git status *.po) | |
425 | @echo | |
426 | @echo ... regenerate just once ... | |
427 | @echo | |
428 | @echo % $(MAKE) -C `pwd` update-po | |
429 | ||
430 | ||
431 | # Any extra flags, such as: | |
432 | # --define "with_docs 0" | |
433 | # --define "elfutils_version 0.135" | |
434 | RPMBUILDFLAGS= | |
435 | ||
436 | PHONIES += dist-gzip rpm srpm | |
437 | ||
438 | PHONIES += uprobes install-uprobes | |
439 | uprobes: | |
440 | $(MAKE) -C $(srcdir)/runtime/uprobes clean default | |
441 | install-uprobes: | |
442 | $(MAKE) -C $(DESTDIR)$(pkgdatadir)/runtime/uprobes clean default | |
443 | ||
444 | .PHONY: $(PHONIES) | |
445 | ||
446 | dist-gzip: | |
447 | cd $(srcdir); git status | grep -E 'working.(tree|directory).clean' || (echo "You should commit your changes before 'make rpm'.") | |
448 | (cd $(srcdir); git archive --prefix=systemtap-$(VERSION)/ --format=tar HEAD) | gzip > systemtap-$(VERSION).tar.gz | |
449 | ||
450 | rpm: dist-gzip | |
451 | if [ `id -u` = 0 ]; then echo NOTE: do not run this as root; exit 1; fi | |
452 | if [ ! -w `rpm --eval %_topdir` ]; then \ | |
453 | echo WARNING: you do not have access to `rpm --eval %_topdir`; \ | |
454 | echo WARNING: you may receive a permission denied error; \ | |
455 | echo WARNING: consider adding \'%_topdir $(HOME)/rpmbuild\' to $(HOME)/.rpmmacros; \ | |
456 | fi | |
457 | mkdir -p `rpm --eval %_specdir` | |
458 | mkdir -p `rpm --eval %_srcrpmdir` | |
459 | mkdir -p `rpm --eval %_rpmdir` | |
460 | mkdir -p `rpm --eval %_builddir` | |
461 | mkdir -p `rpm --eval %_buildroot` | |
462 | rpmbuild --define "_sourcedir $(PWD)/" --define "release_override .`date +%Y%m%d%H%M`" -ta systemtap-$(VERSION).tar.gz $(RPMBUILDFLAGS) | |
463 | ||
464 | srpm: dist-gzip | |
465 | mkdir -p `rpm --eval %_srcrpmdir` | |
466 | rpmbuild --define "_sourcedir $(PWD)/" -ts systemtap-$(VERSION).tar.gz $(RPMBUILDFLAGS) | |
467 | ||
468 | ACLOCAL_AMFLAGS = -I m4 |