]>
Commit | Line | Data |
---|---|---|
2f1a1aea FCE |
1 | # Makefile.am --- automake input file for systemtap |
2 | ## process this file with automake to produce Makefile.in | |
3 | ||
398edb63 JS |
4 | # we don't maintain a ChangeLog, which makes us non-GNU -> foreign |
5 | AUTOMAKE_OPTIONS = no-dist foreign | |
42b926b7 | 6 | |
e460639f | 7 | pkglibexecdir = ${libexecdir}/${PACKAGE} |
b899aa79 | 8 | oldincludedir = ${includedir}/sys |
e460639f | 9 | |
5e3b8687 RM |
10 | AM_CPPFLAGS = -DBINDIR='"$(bindir)"' \ |
11 | -DSYSCONFDIR='"$(sysconfdir)"' \ | |
8f223b3e | 12 | -DPKGDATADIR='"$(pkgdatadir)"' \ |
5e3b8687 | 13 | -DPKGLIBDIR='"$(pkglibexecdir)"' \ |
8f223b3e | 14 | -DLOCALEDIR='"$(localedir)"' \ |
5e3b8687 | 15 | -I$(srcdir)/includes -I$(builddir)/includes/sys |
f00a8372 | 16 | |
8558d392 | 17 | AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W |
a4531d21 | 18 | AM_CXXFLAGS = -Wall -Werror |
77de5e9e | 19 | |
a0fc7f8e | 20 | bin_SCRIPTS = stap-report |
961588fd | 21 | pkglibexec_SCRIPTS = stap-env |
5e3b8687 | 22 | oldinclude_HEADERS = includes/sys/sdt.h includes/sys/sdt-config.h |
6d14a4a9 | 23 | |
1bb80d04 FCE |
24 | bin_PROGRAMS = |
25 | ||
6d14a4a9 | 26 | if BUILD_TRANSLATOR |
645d2e52 | 27 | bin_PROGRAMS += stap |
6d14a4a9 EB |
28 | bin_SCRIPTS += dtrace |
29 | ||
29000306 | 30 | pkglibexec_PROGRAMS = |
1bb80d04 | 31 | |
a0fc7f8e | 32 | if HAVE_NSS |
aeb9cc10 | 33 | pkglibexec_PROGRAMS += stap-sign-module stap-authorize-cert |
a0fc7f8e | 34 | |
19a0d4b6 | 35 | if BUILD_SERVER |
aeb9cc10 | 36 | pkglibexec_PROGRAMS += stap-serverd stap-gen-cert |
1114c4f2 | 37 | bin_SCRIPTS += stap-server |
aeb9cc10 | 38 | pkglibexec_SCRIPTS += stap-start-server stap-stop-server |
19a0d4b6 | 39 | endif |
a0fc7f8e | 40 | endif |
6d14a4a9 | 41 | |
e2012a7a | 42 | stap_SOURCES = main.cxx session.cxx \ |
f4b28491 | 43 | parse.cxx staptree.cxx elaborate.cxx translate.cxx \ |
1b78aef5 | 44 | tapsets.cxx buildrun.cxx loc2c.c hash.cxx mdfour.c \ |
912e8c59 | 45 | cache.cxx util.cxx coveragedb.cxx dwarf_wrappers.cxx \ |
8d9609f5 | 46 | tapset-been.cxx tapset-procfs.cxx tapset-timers.cxx tapset-netfilter.cxx \ |
93646f4d | 47 | tapset-perfmon.cxx tapset-mark.cxx tapset-itrace.cxx \ |
3db9c843 | 48 | tapset-utrace.cxx task_finder.cxx dwflpp.cxx rpm_finder.cxx \ |
f31a77f5 | 49 | setupdwfl.cxx remote.cxx privilege.cxx cmdline.cxx \ |
60cf5fae | 50 | tapset-dynprobe.cxx tapset-method.cxx translator-output.cxx |
07777235 SM |
51 | stap_SOURCES += stapregex.cxx stapregex-tree.cxx stapregex-parse.cxx \ |
52 | stapregex-dfa.cxx | |
4d0d9e8a | 53 | noinst_HEADERS = sdt_types.h |
0ae1833b | 54 | stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @LIBINTL@ -lpthread |
6d14a4a9 | 55 | stap_DEPENDENCIES = |
64b53440 JL |
56 | |
57 | if HAVE_LIBVIRT | |
58 | if HAVE_LIBXML2 | |
59 | bin_PROGRAMS += stapvirt | |
60 | stapvirt_SOURCES = stapvirt.c | |
61 | stapvirt_CFLAGS = $(AM_CFLAGS) | |
62 | stapvirt_CFLAGS += $(libvirt_CFLAGS) $(libxml2_CFLAGS) | |
63 | stapvirt_LDFLAGS = $(AM_LDFLAGS) | |
64 | stapvirt_LDADD = $(libvirt_LIBS) $(libxml2_LIBS) | |
65 | endif | |
66 | endif | |
67 | ||
6d14a4a9 | 68 | endif |
e9d58a72 | 69 | |
8c0bea1f FCE |
70 | install: all |
71 | $(MAKE) $(AM_MAKEFLAGS) install-recursive | |
72 | ||
e434132f FCE |
73 | BUILT_SOURCES = |
74 | CLEANFILES = | |
75 | ||
76 | # Arrange for git_version.h to be regenerated at every "make". | |
4040e9ea | 77 | # Code fragment is based upon RadeonHD.am. |
e434132f FCE |
78 | |
79 | # The stamp file which is never created ensures that git_version.h is updated | |
80 | # before every build. Having git_version.h in foo_SOURCES ensures a recompile | |
81 | # of foo-bar.c if it is newer than the foo-bar.o file. Using noinst_foo_SOURCES | |
82 | # instead of foo_SOURCES prevents shipping git_version.h in dist tarballs, | |
83 | # which may cause false GIT_FOO readings. | |
84 | BUILT_SOURCES += git_version.stamp | |
85 | CLEANFILES += git_version.h | |
86 | GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh | |
87 | git_version.stamp: | |
88 | @if test -f "$(srcdir)/git_version.h"; then \ | |
89 | if test -f "git_version.h"; then :; \ | |
90 | else \ | |
91 | cp "$(srcdir)/git_version.h" "git_version.h"; \ | |
92 | fi; \ | |
93 | fi | |
94 | $(GIT_VERSION_CMD) -k -s $(top_srcdir) -o git_version.h | |
95 | @if test -s "$(srcdir)/git_version.h"; then \ | |
96 | if cmp "$(srcdir)/git_version.h" "git_version.h"; then :; \ | |
97 | else \ | |
98 | echo "Error: $(srcdir)/git_version.h and git_version.h differ."; \ | |
99 | echo " You probably want to remove the former."; \ | |
100 | exit 1; \ | |
101 | fi; \ | |
102 | fi | |
103 | ||
c0f9d4b0 FCE |
104 | git_version.h: |
105 | $(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h | |
e9d58a72 | 106 | |
8437928b | 107 | cscope: |
6cf88792 FCE |
108 | cd $(srcdir) && \ |
109 | (echo -q ; git ls-files '*.cxx' '*.c' '*.h' | grep -v '^testsuite' ) > cscope.files && \ | |
60c493ce | 110 | cscope -b -q @DYNINST_CXXFLAGS@ |
e434132f | 111 | |
6d14a4a9 EB |
112 | PHONIES = |
113 | if BUILD_TRANSLATOR | |
97859b9d | 114 | stap_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ |
5574ef2c | 115 | stap_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ |
a794dbeb | 116 | stap_CPPFLAGS = $(AM_CPPFLAGS) -DSTAP_SDT_V2 |
8730f377 | 117 | stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ |
19a0d4b6 | 118 | |
2dce8c42 DB |
119 | if HAVE_AVAHI |
120 | stap_CXXFLAGS += $(avahi_CFLAGS) | |
121 | stap_CPPFLAGS += $(avahi_CFLAGS) | |
f5a118c0 | 122 | stap_LDADD += $(avahi_LIBS) |
2dce8c42 DB |
123 | endif |
124 | ||
2035bcd4 | 125 | if HAVE_NSS |
c4fd15b4 | 126 | stap_SOURCES += nsscommon.cxx csclient.cxx cscommon.cxx |
f5a118c0 DEP |
127 | stap_CFLAGS += $(nss_CFLAGS) -DSTAP |
128 | stap_CXXFLAGS += $(nss_CFLAGS) | |
129 | stap_CPPFLAGS += $(nss_CFLAGS) | |
130 | stap_LDADD += $(nss_LIBS) | |
a0fc7f8e | 131 | |
a0fc7f8e DB |
132 | install-exec-local: install-scripts |
133 | ||
134 | PHONIES += install-scripts | |
135 | # scripts must be installed before this rule is run | |
961588fd | 136 | install-scripts: install-binSCRIPTS install-pkglibexecSCRIPTS |
a0fc7f8e | 137 | for f in $(bin_SCRIPTS); do \ |
961588fd DB |
138 | sed -i -e "s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(bindir)/$$f; \ |
139 | done | |
140 | for f in $(pkglibexec_SCRIPTS); do \ | |
1114c4f2 | 141 | sed -i -e "/INSTALL-HOOK/d;s,sysconfdir=.*,sysconfdir=$(sysconfdir),;s,pkglibexecdir=.*,pkglibexecdir=$(pkglibexecdir)/,;s,localstatedir=.*,localstatedir=$(localstatedir),;s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(pkglibexecdir)/$$f; \ |
a0fc7f8e DB |
142 | done |
143 | endif | |
337cd273 | 144 | |
e460639f RM |
145 | if BUILD_ELFUTILS |
146 | stap_CPPFLAGS += -Iinclude-elfutils | |
147 | stap_LDFLAGS += -Llib-elfutils -Wl,-rpath-link,lib-elfutils \ | |
148 | -Wl,--enable-new-dtags,-rpath,$(pkglibdir) | |
b976b20e FCE |
149 | |
150 | ||
e434132f | 151 | BUILT_SOURCES += stamp-elfutils |
e460639f RM |
152 | CLEANFILES += stamp-elfutils |
153 | stamp-elfutils: config.status | |
b01369ba | 154 | $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all bin_PROGRAMS= |
e460639f | 155 | for dir in libelf libebl libdw libdwfl backends; do \ |
e6364d79 | 156 | $(MAKE) $(AM_MAKEFLAGS) -j1 -C build-elfutils/$$dir bin_PROGRAMS= install; \ |
e460639f | 157 | done |
e050d62f | 158 | $(MAKE) $(AM_MAKEFLAGS) -j1 -C build-elfutils install-pkgincludeHEADERS; |
e460639f | 159 | touch $@ |
1cecb3c5 | 160 | stap_DEPENDENCIES += lib-elfutils/libdw.so |
e460639f RM |
161 | lib-elfutils/libdw.so: stamp-elfutils ; |
162 | ||
337cd273 | 163 | PHONIES += install-elfutils |
e460639f | 164 | install-elfutils: |
17a127da | 165 | mkdir -p $(DESTDIR)$(pkglibdir) |
a3e695ac | 166 | for file in lib-elfutils/*.so* lib-elfutils/${PACKAGE_NAME}/*.so*; do \ |
17a127da | 167 | $(INSTALL_PROGRAM) $$file $(DESTDIR)$(pkglibdir); \ |
a3e695ac | 168 | done |
e460639f RM |
169 | install-exec-local: install-elfutils |
170 | endif | |
6d14a4a9 | 171 | endif |
552276c8 | 172 | |
c32d53de | 173 | CLEANFILES += $(pkglibexec_PROGRAMS) |
e460639f | 174 | |
6d14a4a9 | 175 | if BUILD_TRANSLATOR |
a0fc7f8e | 176 | if HAVE_NSS |
aeb9cc10 | 177 | stap_sign_module_SOURCES = stap-sign-module.cxx nsscommon.cxx util.cxx |
a530cfe0 | 178 | stap_sign_module_CPPFLAGS = $(AM_CPPFLAGS) |
f5a118c0 DEP |
179 | stap_sign_module_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) |
180 | stap_sign_module_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
e7081358 | 181 | stap_sign_module_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ |
f5a118c0 | 182 | stap_sign_module_LDADD = $(nss_LIBS) |
aeb9cc10 DB |
183 | |
184 | stap_authorize_cert_SOURCES = stap-authorize-cert.cxx nsscommon.cxx util.cxx | |
185 | stap_authorize_cert_CPPFLAGS = $(AM_CPPFLAGS) | |
f5a118c0 DEP |
186 | stap_authorize_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) |
187 | stap_authorize_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
e7081358 | 188 | stap_authorize_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ |
f5a118c0 | 189 | stap_authorize_cert_LDADD = $(nss_LIBS) |
a0fc7f8e | 190 | |
6d14a4a9 | 191 | if BUILD_SERVER |
73f52eb4 | 192 | stap_serverd_SOURCES = stap-serverd.cxx cscommon.cxx util.cxx privilege.cxx nsscommon.cxx cmdline.cxx |
f5a118c0 DEP |
193 | stap_serverd_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) |
194 | stap_serverd_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
e7081358 | 195 | stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ |
f7707c31 | 196 | stap_serverd_LDADD = $(nss_LIBS) -lpthread |
43951734 | 197 | if HAVE_AVAHI |
f5a118c0 DEP |
198 | stap_serverd_CFLAGS += $(avahi_CFLAGS) |
199 | stap_serverd_CXXFLAGS += $(avahi_CFLAGS) | |
200 | stap_serverd_LDADD += $(avahi_LIBS) | |
43951734 | 201 | endif |
aeb9cc10 DB |
202 | |
203 | stap_gen_cert_SOURCES = stap-gen-cert.cxx util.cxx nsscommon.cxx | |
f5a118c0 DEP |
204 | stap_gen_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) |
205 | stap_gen_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
e7081358 | 206 | stap_gen_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ |
f5a118c0 | 207 | stap_gen_cert_LDADD = $(nss_LIBS) |
a0fc7f8e | 208 | endif |
6d14a4a9 EB |
209 | endif |
210 | ||
5a5e5134 | 211 | noinst_PROGRAMS = loc2c-test |
51e874a1 | 212 | loc2c_test_SOURCES = loc2c-test.c loc2c.c |
5574ef2c | 213 | loc2c_test_CFLAGS = $(stap_CFLAGS) |
e460639f RM |
214 | loc2c_test_CPPFLAGS = $(stap_CPPFLAGS) |
215 | loc2c_test_LDFLAGS = $(stap_LDFLAGS) | |
216 | loc2c_test_LDADD = $(stap_LDADD) | |
6d14a4a9 | 217 | endif |
51e874a1 | 218 | |
35a04c8e FCE |
219 | # crash(8) extension |
220 | if BUILD_CRASHMOD | |
221 | STAPLOG=staplog.so | |
222 | ||
223 | $(STAPLOG): staplog.c | |
564eb0a8 DS |
224 | $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \ |
225 | $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $< | |
551a4f58 | 226 | all-local: $(STAPLOG) example_index |
35a04c8e | 227 | install-exec-local: $(STAPLOG) |
674427d3 | 228 | $(MKDIR_P) $(DESTDIR)$(pkglibdir) |
17a127da | 229 | $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir) |
551a4f58 MW |
230 | else |
231 | all-local: example_index | |
35a04c8e FCE |
232 | endif |
233 | ||
2f1a1aea FCE |
234 | # Get extra libs as needed |
235 | LDADD = | |
236 | ||
ec4d1558 | 237 | EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples |
551a4f58 | 238 | EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta |
551a4f58 | 239 | |
751f8288 | 240 | example_index: $(EXAMPLE_SOURCE_DIR)/index.html |
551a4f58 | 241 | |
751f8288 | 242 | $(EXAMPLE_SOURCE_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN) |
59ec9408 FCE |
243 | @echo "The script example index is outdated, run" |
244 | @echo " cd $(EXAMPLE_SOURCE_DIR) && \\ " | |
245 | @echo " perl examples-index-gen.pl" | |
246 | @echo "to regenerate it." | |
ec4d1558 | 247 | |
ecfa3e8b | 248 | install-data-local: |
ef9e124a | 249 | (cd $(srcdir)/runtime; for f in *.[ch]; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/$$f; done) |
b61527e5 JS |
250 | if HAVE_DYNINST |
251 | (cd $(srcdir)/runtime/dyninst; find . \( -name '*.[ch]' \) -print \ | |
252 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/dyninst/$$f; done) | |
253 | endif | |
aaf2af3e FCE |
254 | (cd $(srcdir)/runtime/unwind; find . \( -name '*.[ch]' \) -print \ |
255 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/unwind/$$f; done) | |
ef9e124a MH |
256 | (cd $(srcdir)/runtime/transport; for f in *.[ch]; \ |
257 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/transport/$$f; done) | |
7eaca571 JS |
258 | (cd $(srcdir)/runtime/linux; for f in *.[ch]; \ |
259 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/$$f; done) | |
260 | (cd $(srcdir)/runtime/linux/uprobes; for f in Makefile *.[ch]; \ | |
261 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/uprobes/$$f; done) | |
262 | (cd $(srcdir)/runtime/linux/uprobes2; for f in *.[ch]; \ | |
263 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/uprobes2/$$f; done) | |
b2103a16 | 264 | (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name '*.stpm' -o -name README \) -print \ |
ef9e124a | 265 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done) |
751f8288 | 266 | (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \ |
7a92fcf7 | 267 | | egrep -v 'check.exp|ChangeLog|examples-index-gen.pl|html/.*\.tmpl$$' \ |
5b8561dc MW |
268 | | while read f; do if test -x $$f; then \ |
269 | i_cmd="$(INSTALL_PROGRAM)"; else \ | |
270 | i_cmd="$(INSTALL_DATA)"; fi; \ | |
271 | $$i_cmd -D $$f $(DESTDIR)$(docdir)/examples/$$f; done) | |
552276c8 | 272 | test -e $(DESTDIR)$(sysconfdir)/systemtap || mkdir -p $(DESTDIR)$(sysconfdir)/systemtap |
60045090 DB |
273 | if BUILD_SERVER |
274 | test -e $(DESTDIR)$(localstatedir)/run/stap-server || mkdir -p $(DESTDIR)$(localstatedir)/run/stap-server | |
275 | test -e $(DESTDIR)$(localstatedir)/log || mkdir -p $(DESTDIR)$(localstatedir)/log | |
276 | endif | |
b46393fc | 277 | |
ecfa3e8b | 278 | |
e885b2ec WC |
279 | TEST_COV_DIR = coverage |
280 | ||
af56020f | 281 | gcov: |
62700107 FCE |
282 | find . -name '*.gc*' | xargs rm -f |
283 | $(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" CFLAGS="-g -fprofile-arcs -ftest-coverage" all install | |
284 | -sudo $(MAKE) installcheck $${RUNTESTFLAGS+RUNTESTFLAGS=$${RUNTESTFLAGS}} | |
285 | for dir in $(SUBDIRS); do \ | |
286 | (cd $$dir; gcov *.gcno > SUMMARY.gcov 2>&1 || true); \ | |
287 | done | |
288 | find . -name '*.gcov' | |
e885b2ec | 289 | |
1e7ad3bf | 290 | clean-local: |
62700107 | 291 | rm -rf ${PACKAGE_TARNAME}-*.tar.gz |
f00a8372 | 292 | rm -rf ${PACKAGE_TARNAME}-${PACKAGE_VERSION} |
e885b2ec WC |
293 | rm -rf $(TEST_COV_DIR) |
294 | rm -rf stap.info | |
35a04c8e | 295 | rm -rf staplog.so |
1c4cf93d MW |
296 | |
297 | distclean-local: | |
daae650d | 298 | rm -rf build-elfutils include-elfutils lib-elfutils |
5409bb17 | 299 | rm -f doc/beginners/en-US doc/beginners/build/en-US/testsuite |
4d4f412b FCE |
300 | |
301 | uninstall-local: | |
302 | rm -rf $(DESTDIR)$(pkgdatadir) | |
35a04c8e | 303 | rm -rf $(DESTDIR)$(libdir)/$(PACKAGE) |
4d4f412b | 304 | -rm -rf $(DESTDIR)$(localstatedir)/cache/$(PACKAGE) |
ec4d1558 MW |
305 | @list='$(EXAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ |
306 | echo " rm -f '$(EXAMPLE_INSTALL_DIR)/$$p'"; \ | |
307 | rm -f "$(EXAMPLE_INSTALL_DIR)/$$p"; \ | |
308 | done | |
309 | @list='$(DEMO_SRC)'; for f in $$list; do p=`basename $$f`; \ | |
310 | echo " rm -f '$(DEMO_INSTALL_DIR)/$$p'"; \ | |
311 | rm -f "$(DEMO_INSTALL_DIR)/$$p"; \ | |
312 | done | |
313 | @list='$(SAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ | |
314 | echo " rm -f '$(SAMPLE_INSTALL_DIR)/$$p'"; \ | |
315 | rm -f "$(SAMPLE_INSTALL_DIR)/$$p"; \ | |
316 | done | |
8cd5d9f0 | 317 | rm -rf $(DESTDIR)$(sysconfdir)/systemtap |
e1335449 | 318 | rm -rf $(DESTDIR)$(docdir)/examples |
60045090 DB |
319 | if BUILD_SERVER |
320 | rm -rf $(DESTDIR)$(localstatedir)/run/stap-server | |
2648a9b4 | 321 | rm -f $(DESTDIR)$(localstatedir)/log/stap-server/log |
60045090 | 322 | endif |
8129fd92 | 323 | |
db887d2c | 324 | SUBDIRS = . java stapdyn staprun doc man po |
62700107 | 325 | # NB: the gcov target above uses this to enumarate linked binaries' build directories |
2a650e10 | 326 | DIST_SUBDIRS = testsuite $(SUBDIRS) |
e6e2c7bb | 327 | EXTRA_DIST = m4/ChangeLog |
5ba96b90 | 328 | |
4b3c90da | 329 | check-local: |
17a127da | 330 | SRCDIR=`cd $(srcdir); pwd`; \ |
818ba2bc | 331 | PWD=`pwd`; \ |
645d2e52 | 332 | $(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)"; |
5ba96b90 FCE |
333 | |
334 | installcheck: | |
20fb5020 MW |
335 | if test \! -e $(DESTDIR)$(bindir)/stap; then \ |
336 | echo $(DESTDIR)$(bindir)/stap doesn\'t exist, run make install; \ | |
337 | exit -1; \ | |
0e47827d | 338 | fi; \ |
20fb5020 MW |
339 | if test $(builddir)/stap -nt $(DESTDIR)$(bindir)/stap; then \ |
340 | echo "$(DESTDIR)$(bindir)/stap is not recent, run make install"; \ | |
341 | exit -1; \ | |
d5658775 | 342 | fi; |
a5b17365 | 343 | $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" |
8f3c45cc | 344 | |
cb3f3970 RM |
345 | PHONIES += runcheck |
346 | # All the variables are overridden by run-stap, but SYSTEMTAP_RUNTIME | |
347 | # is used by the testsuite scripts themselves. | |
29000306 | 348 | runcheck: testsuite/stap testsuite/dtrace |
cb3f3970 RM |
349 | $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" \ |
350 | SYSTEMTAP_PATH="`cd testsuite; pwd`" \ | |
351 | SYSTEMTAP_RUNTIME="`cd $(srcdir)/runtime; pwd`" | |
352 | testsuite/stap: run-stap | |
7c28c54e | 353 | (echo '#!/bin/sh'; echo "exec `pwd`/run-stap" '$${1+"$$@"}') > $@.new |
29000306 RM |
354 | chmod 555 $@.new |
355 | mv -f $@.new $@ | |
356 | testsuite/dtrace: dtrace | |
7c28c54e | 357 | (echo '#!/bin/sh'; echo "exec `pwd`/dtrace" '$${1+"$$@"}') > $@.new |
cb3f3970 RM |
358 | chmod 555 $@.new |
359 | mv -f $@.new $@ | |
4040e9ea | 360 | |
4075df88 FCE |
361 | PHONIES += update-po |
362 | update-po: | |
a54d79ce | 363 | (cd $(srcdir); ls -1d *.c *.cxx *.h staprun/*.c staprun/*.h) \ |
ce0f6648 | 364 | | grep -v loc2c-test.c \ |
eeacd9d4 LB |
365 | | grep -v config.h \ |
366 | | grep -v git_version.h \ | |
02311ab4 | 367 | | grep -v staprun/config.h \ |
4075df88 FCE |
368 | | sort > $(srcdir)/po/POTFILES.in |
369 | $(MAKE) -C po update-po | |
370 | ||
371 | ||
4040e9ea FCE |
372 | # Any extra flags, such as: |
373 | # --define "with_docs 0" | |
374 | # --define "with_bundled_elfutils 1" --define "elfutils_version 0.135" | |
375 | RPMBUILDFLAGS= | |
376 | ||
0265eef0 | 377 | PHONIES += dist-gzip rpm srpm |
337cd273 | 378 | |
3620fb20 JS |
379 | PHONIES += uprobes install-uprobes |
380 | uprobes: | |
381 | $(MAKE) -C $(srcdir)/runtime/uprobes clean default | |
382 | install-uprobes: | |
383 | $(MAKE) -C $(DESTDIR)$(pkgdatadir)/runtime/uprobes clean default | |
384 | ||
337cd273 FCE |
385 | .PHONY: $(PHONIES) |
386 | ||
813ed4cb | 387 | dist-gzip: |
4040e9ea FCE |
388 | cd $(srcdir); git status | grep working.directory.clean || (echo "You should commit your changes before 'make rpm'.") |
389 | (cd $(srcdir); git archive --prefix=systemtap-$(VERSION)/ --format=tar HEAD) | gzip > systemtap-$(VERSION).tar.gz | |
813ed4cb | 390 | |
9b2e2b58 | 391 | rpm: dist-gzip |
08f99919 | 392 | if [ `id -u` = 0 ]; then echo NOTE: do not run this as root; exit 1; fi |
4040e9ea FCE |
393 | mkdir -p `rpm --eval %_specdir` |
394 | mkdir -p `rpm --eval %_srcrpmdir` | |
395 | mkdir -p `rpm --eval %_rpmdir` | |
396 | mkdir -p `rpm --eval %_builddir` | |
397 | mkdir -p `rpm --eval %_buildroot` | |
398 | rpmbuild --define "_sourcedir $(PWD)/" -ta systemtap-$(VERSION).tar.gz $(RPMBUILDFLAGS) | |
8f223b3e | 399 | |
0265eef0 JS |
400 | srpm: dist-gzip |
401 | mkdir -p `rpm --eval %_srcrpmdir` | |
402 | rpmbuild --define "_sourcedir $(PWD)/" -ts systemtap-$(VERSION).tar.gz $(RPMBUILDFLAGS) | |
403 | ||
8f223b3e | 404 | ACLOCAL_AMFLAGS = -I m4 |