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