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