]>
Commit | Line | Data |
---|---|---|
2f1a1aea FCE |
1 | # Makefile.am --- automake input file for systemtap |
2 | ## process this file with automake to produce Makefile.in | |
3 | ||
4040e9ea | 4 | AUTOMAKE_OPTIONS = no-dist |
42b926b7 | 5 | |
e460639f | 6 | pkglibexecdir = ${libexecdir}/${PACKAGE} |
b899aa79 | 7 | oldincludedir = ${includedir}/sys |
e460639f | 8 | |
6bc51533 | 9 | AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"' |
f00a8372 | 10 | |
8558d392 | 11 | AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W |
a4531d21 | 12 | AM_CXXFLAGS = -Wall -Werror |
77de5e9e | 13 | |
19a0d4b6 | 14 | man_MANS = stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5 |
4040e9ea FCE |
15 | # see also configure.ac |
16 | ||
19a0d4b6 MW |
17 | bin_PROGRAMS = stap staprun |
18 | bin_SCRIPTS = stap-report | |
b899aa79 | 19 | oldinclude_HEADERS = runtime/sdt.h |
19a0d4b6 MW |
20 | if BUILD_SERVER |
21 | man_MANS += stap-server.8 | |
22 | bin_PROGRAMS += stap-client-connect stap-server-connect | |
23 | bin_SCRIPTS += stap-client stap-serverd stap-server stap-find-servers \ | |
24 | stap-start-server stap-find-or-start-server stap-stop-server \ | |
25 | stap-gen-server-cert stap-add-server-cert | |
26 | endif | |
b899aa79 | 27 | bin_SCRIPTS += dtrace |
56e12059 | 28 | stap_SOURCES = main.cxx \ |
f4b28491 | 29 | parse.cxx staptree.cxx elaborate.cxx translate.cxx \ |
1b78aef5 | 30 | tapsets.cxx buildrun.cxx loc2c.c hash.cxx mdfour.c \ |
86bf665e | 31 | cache.cxx util.cxx coveragedb.cxx dwarf_wrappers.cxx |
42feb3c0 | 32 | stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ |
e9d58a72 | 33 | |
e434132f FCE |
34 | BUILT_SOURCES = |
35 | CLEANFILES = | |
1cecb3c5 | 36 | stap_DEPENDENCIES = |
e434132f FCE |
37 | |
38 | # Arrange for git_version.h to be regenerated at every "make". | |
4040e9ea | 39 | # Code fragment is based upon RadeonHD.am. |
e434132f FCE |
40 | |
41 | # The stamp file which is never created ensures that git_version.h is updated | |
42 | # before every build. Having git_version.h in foo_SOURCES ensures a recompile | |
43 | # of foo-bar.c if it is newer than the foo-bar.o file. Using noinst_foo_SOURCES | |
44 | # instead of foo_SOURCES prevents shipping git_version.h in dist tarballs, | |
45 | # which may cause false GIT_FOO readings. | |
46 | BUILT_SOURCES += git_version.stamp | |
47 | CLEANFILES += git_version.h | |
48 | GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh | |
49 | git_version.stamp: | |
50 | @if test -f "$(srcdir)/git_version.h"; then \ | |
51 | if test -f "git_version.h"; then :; \ | |
52 | else \ | |
53 | cp "$(srcdir)/git_version.h" "git_version.h"; \ | |
54 | fi; \ | |
55 | fi | |
56 | $(GIT_VERSION_CMD) -k -s $(top_srcdir) -o git_version.h | |
57 | @if test -s "$(srcdir)/git_version.h"; then \ | |
58 | if cmp "$(srcdir)/git_version.h" "git_version.h"; then :; \ | |
59 | else \ | |
60 | echo "Error: $(srcdir)/git_version.h and git_version.h differ."; \ | |
61 | echo " You probably want to remove the former."; \ | |
62 | exit 1; \ | |
63 | fi; \ | |
64 | fi | |
65 | ||
c0f9d4b0 FCE |
66 | git_version.h: |
67 | $(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h | |
e9d58a72 | 68 | |
8437928b | 69 | cscope: |
6cf88792 FCE |
70 | cd $(srcdir) && \ |
71 | (echo -q ; git ls-files '*.cxx' '*.c' '*.h' | grep -v '^testsuite' ) > cscope.files && \ | |
8437928b | 72 | cscope -b -q |
e434132f FCE |
73 | |
74 | ||
78f6bba6 | 75 | stap_CXXFLAGS = $(AM_CXXFLAGS) |
e460639f | 76 | stap_CPPFLAGS = $(AM_CPPFLAGS) |
8730f377 FCE |
77 | stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ |
78 | staprun_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ | |
b976b20e | 79 | stapio_CPPFLAGS = $(AM_CPPFLAGS) |
8730f377 | 80 | stapio_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ |
19a0d4b6 MW |
81 | |
82 | if BUILD_SERVER | |
1cecb3c5 DB |
83 | stap_client_connect_LDFLAGS = $(AM_LDFLAGS) |
84 | stap_server_connect_LDFLAGS = $(AM_LDFLAGS) | |
19a0d4b6 | 85 | endif |
337cd273 FCE |
86 | |
87 | PHONIES = | |
e460639f RM |
88 | if BUILD_ELFUTILS |
89 | stap_CPPFLAGS += -Iinclude-elfutils | |
90 | stap_LDFLAGS += -Llib-elfutils -Wl,-rpath-link,lib-elfutils \ | |
91 | -Wl,--enable-new-dtags,-rpath,$(pkglibdir) | |
b976b20e FCE |
92 | |
93 | ||
e434132f | 94 | BUILT_SOURCES += stamp-elfutils |
e460639f RM |
95 | CLEANFILES += stamp-elfutils |
96 | stamp-elfutils: config.status | |
b01369ba | 97 | $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all bin_PROGRAMS= |
e460639f | 98 | for dir in libelf libebl libdw libdwfl backends; do \ |
b01369ba | 99 | $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils/$$dir bin_PROGRAMS= install; \ |
e460639f RM |
100 | done |
101 | touch $@ | |
1cecb3c5 | 102 | stap_DEPENDENCIES += lib-elfutils/libdw.so |
e460639f RM |
103 | lib-elfutils/libdw.so: stamp-elfutils ; |
104 | ||
f28a8c28 SC |
105 | pkglib_LIBRARIES = libsduprobes.a |
106 | libsduprobes_a_SOURCES = runtime/sduprobes.c | |
107 | sduprobes.o: runtime/sduprobes.c | |
108 | $(CC) -g -O0 -c -o $@ $< | |
109 | ||
337cd273 | 110 | PHONIES += install-elfutils |
e460639f | 111 | install-elfutils: |
17a127da | 112 | mkdir -p $(DESTDIR)$(pkglibdir) |
a3e695ac | 113 | for file in lib-elfutils/*.so* lib-elfutils/${PACKAGE_NAME}/*.so*; do \ |
17a127da | 114 | $(INSTALL_PROGRAM) $$file $(DESTDIR)$(pkglibdir); \ |
a3e695ac | 115 | done |
e460639f RM |
116 | install-exec-local: install-elfutils |
117 | endif | |
d04cf5ff | 118 | |
98aab489 | 119 | staprun_SOURCES = runtime/staprun/staprun.c runtime/staprun/staprun_funcs.c\ |
337cd273 | 120 | runtime/staprun/ctl.c runtime/staprun/common.c |
e65b03c1 | 121 | |
7651c16b | 122 | staprun_CPPFLAGS = $(AM_CPPFLAGS) |
3a4e19b8 | 123 | staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -DSINGLE_THREADED -fno-strict-aliasing |
337cd273 | 124 | staprun_LDADD = @PROCFLAGS@ |
2f1a1aea | 125 | |
98aab489 DS |
126 | stapio_SOURCES = runtime/staprun/stapio.c \ |
127 | runtime/staprun/mainloop.c runtime/staprun/common.c \ | |
4776796a | 128 | runtime/staprun/ctl.c \ |
4040e9ea | 129 | runtime/staprun/relay.c runtime/staprun/relay_old.c |
3a4e19b8 | 130 | stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -fno-strict-aliasing |
4776796a | 131 | stapio_LDADD = @PROCFLAGS@ -lpthread |
98aab489 | 132 | |
19a0d4b6 | 133 | if BUILD_SERVER |
1cecb3c5 | 134 | stap_client_connect_SOURCES = stap-client-connect.c |
43498922 | 135 | stap_client_connect_CFLAGS = -Wall -Werror $(nss_CFLAGS) $(nspr_CFLAGS) |
1cecb3c5 DB |
136 | stap_client_connect_LDADD = -lssl3 |
137 | ||
138 | stap_server_connect_SOURCES = stap-server-connect.c | |
43498922 | 139 | stap_server_connect_CFLAGS = -Wall -Werror $(nss_CFLAGS) $(nspr_CFLAGS) |
1cecb3c5 | 140 | stap_server_connect_LDADD = -lssl3 |
19a0d4b6 | 141 | endif |
1cecb3c5 | 142 | |
98aab489 | 143 | install-exec-hook: |
7ab87feb FCE |
144 | if [ `id -u` -eq 0 ]; then chmod 04111 "$(DESTDIR)$(bindir)/staprun"; fi |
145 | ||
146 | # Why the "id -u" condition? This way, an unprivileged user can run | |
147 | # make install, and have "sudo stap ...." or "sudo staprun ...." work later. | |
148 | ||
98aab489 DS |
149 | |
150 | pkglibexec_PROGRAMS = stapio | |
151 | CLEANFILES += $(pkglibexec_PROGRAMS) | |
e460639f | 152 | |
5a5e5134 | 153 | noinst_PROGRAMS = loc2c-test |
51e874a1 | 154 | loc2c_test_SOURCES = loc2c-test.c loc2c.c |
e460639f RM |
155 | loc2c_test_CPPFLAGS = $(stap_CPPFLAGS) |
156 | loc2c_test_LDFLAGS = $(stap_LDFLAGS) | |
157 | loc2c_test_LDADD = $(stap_LDADD) | |
51e874a1 | 158 | |
35a04c8e FCE |
159 | # crash(8) extension |
160 | if BUILD_CRASHMOD | |
161 | STAPLOG=staplog.so | |
162 | ||
163 | $(STAPLOG): staplog.c | |
564eb0a8 DS |
164 | $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \ |
165 | $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $< | |
551a4f58 | 166 | all-local: $(STAPLOG) example_index |
35a04c8e | 167 | install-exec-local: $(STAPLOG) |
674427d3 | 168 | $(MKDIR_P) $(DESTDIR)$(pkglibdir) |
17a127da | 169 | $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir) |
551a4f58 MW |
170 | else |
171 | all-local: example_index | |
35a04c8e FCE |
172 | endif |
173 | ||
2f1a1aea FCE |
174 | # Get extra libs as needed |
175 | LDADD = | |
176 | ||
ec4d1558 | 177 | EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples |
551a4f58 | 178 | EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta |
551a4f58 | 179 | |
751f8288 | 180 | example_index: $(EXAMPLE_SOURCE_DIR)/index.html |
551a4f58 | 181 | |
751f8288 | 182 | $(EXAMPLE_SOURCE_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN) |
59ec9408 FCE |
183 | @echo "The script example index is outdated, run" |
184 | @echo " cd $(EXAMPLE_SOURCE_DIR) && \\ " | |
185 | @echo " perl examples-index-gen.pl" | |
186 | @echo "to regenerate it." | |
ec4d1558 | 187 | |
ecfa3e8b | 188 | install-data-local: |
ef9e124a | 189 | (cd $(srcdir)/runtime; for f in *.[ch]; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/$$f; done) |
aaf2af3e FCE |
190 | (cd $(srcdir)/runtime/unwind; find . \( -name '*.[ch]' \) -print \ |
191 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/unwind/$$f; done) | |
ef9e124a MH |
192 | (cd $(srcdir)/runtime/transport; for f in *.[ch]; \ |
193 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/transport/$$f; done) | |
6274464e | 194 | (cd $(srcdir)/runtime/uprobes; for f in Makefile *.[ch]; \ |
36b16282 | 195 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done) |
904b272c JK |
196 | (cd $(srcdir)/runtime/uprobes2; for f in *.[ch]; \ |
197 | do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes2/$$f; done) | |
4b2c4ab5 | 198 | (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \ |
ef9e124a | 199 | | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done) |
751f8288 | 200 | (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \ |
9b3f22a9 | 201 | | egrep -v 'check.exp|ChangeLog|examples-index-gen.pl' \ |
5b8561dc MW |
202 | | while read f; do if test -x $$f; then \ |
203 | i_cmd="$(INSTALL_PROGRAM)"; else \ | |
204 | i_cmd="$(INSTALL_DATA)"; fi; \ | |
205 | $$i_cmd -D $$f $(DESTDIR)$(docdir)/examples/$$f; done) | |
ecfa3e8b | 206 | |
e885b2ec WC |
207 | TEST_COV_DIR = coverage |
208 | ||
af56020f | 209 | gcov: |
e885b2ec | 210 | @-$(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" all check |
af56020f | 211 | @gcov *.gcno >/dev/null 2>&1 |
af56020f FCE |
212 | @rm -f `ls -1 *.gcov | fgrep -v .cxx.gcov` |
213 | ls -l *.cxx.gcov | |
214 | ||
e885b2ec WC |
215 | lcov: |
216 | @lcov --directory . -z | |
217 | @-$(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" all check | |
218 | @lcov --directory . -c -o stap.info | |
219 | @genhtml -o ./$(TEST_COV_DIR) stap.info | |
220 | ||
1e7ad3bf | 221 | clean-local: |
f00a8372 RM |
222 | rm -f *.gcov *.gcno *.gcda ${PACKAGE_TARNAME}-*.tar.gz |
223 | rm -rf ${PACKAGE_TARNAME}-${PACKAGE_VERSION} | |
e885b2ec WC |
224 | rm -rf $(TEST_COV_DIR) |
225 | rm -rf stap.info | |
35a04c8e | 226 | rm -rf staplog.so |
1c4cf93d MW |
227 | |
228 | distclean-local: | |
daae650d | 229 | rm -rf build-elfutils include-elfutils lib-elfutils |
4d4f412b FCE |
230 | |
231 | uninstall-local: | |
232 | rm -rf $(DESTDIR)$(pkgdatadir) | |
233 | rm -rf $(DESTDIR)$(libexecdir)/$(PACKAGE) | |
35a04c8e | 234 | rm -rf $(DESTDIR)$(libdir)/$(PACKAGE) |
4d4f412b | 235 | -rm -rf $(DESTDIR)$(localstatedir)/cache/$(PACKAGE) |
ec4d1558 MW |
236 | @list='$(EXAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ |
237 | echo " rm -f '$(EXAMPLE_INSTALL_DIR)/$$p'"; \ | |
238 | rm -f "$(EXAMPLE_INSTALL_DIR)/$$p"; \ | |
239 | done | |
240 | @list='$(DEMO_SRC)'; for f in $$list; do p=`basename $$f`; \ | |
241 | echo " rm -f '$(DEMO_INSTALL_DIR)/$$p'"; \ | |
242 | rm -f "$(DEMO_INSTALL_DIR)/$$p"; \ | |
243 | done | |
244 | @list='$(SAMPLE_SRC)'; for f in $$list; do p=`basename $$f`; \ | |
245 | echo " rm -f '$(SAMPLE_INSTALL_DIR)/$$p'"; \ | |
246 | rm -f "$(SAMPLE_INSTALL_DIR)/$$p"; \ | |
247 | done | |
8cd5d9f0 | 248 | rm -rf $(DESTDIR)$(sysconfdir)/systemtap |
35a04c8e | 249 | # XXX: leaves behind man pages |
8129fd92 | 250 | |
465e8fbf | 251 | SUBDIRS = testsuite doc |
5ba96b90 | 252 | |
5ba96b90 | 253 | check: |
17a127da | 254 | SRCDIR=`cd $(srcdir); pwd`; \ |
d5658775 | 255 | $(MAKE) -C testsuite check SYSTEMTAP_RUNTIME=$$SRCDIR/runtime SYSTEMTAP_TAPSET=$$SRCDIR/tapset LD_LIBRARY_PATH=$(PWD)/lib-elfutils:$(PWD)/lib-elfutils/systemtap SYSTEMTAP_PATH="$(PWD)" RUNTESTFLAGS="$(RUNTESTFLAGS)"; |
5ba96b90 FCE |
256 | |
257 | installcheck: | |
20fb5020 MW |
258 | if test \! -e $(DESTDIR)$(bindir)/stap; then \ |
259 | echo $(DESTDIR)$(bindir)/stap doesn\'t exist, run make install; \ | |
260 | exit -1; \ | |
0e47827d | 261 | fi; \ |
20fb5020 MW |
262 | if test $(builddir)/stap -nt $(DESTDIR)$(bindir)/stap; then \ |
263 | echo "$(DESTDIR)$(bindir)/stap is not recent, run make install"; \ | |
264 | exit -1; \ | |
d5658775 | 265 | fi; |
b5935516 | 266 | $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" |
8f3c45cc | 267 | |
4040e9ea FCE |
268 | |
269 | # Any extra flags, such as: | |
270 | # --define "with_docs 0" | |
271 | # --define "with_bundled_elfutils 1" --define "elfutils_version 0.135" | |
272 | RPMBUILDFLAGS= | |
273 | ||
337cd273 FCE |
274 | PHONIES += dist-gzip |
275 | ||
276 | .PHONY: $(PHONIES) | |
277 | ||
813ed4cb | 278 | dist-gzip: |
4040e9ea FCE |
279 | cd $(srcdir); git status | grep working.directory.clean || (echo "You should commit your changes before 'make rpm'.") |
280 | (cd $(srcdir); git archive --prefix=systemtap-$(VERSION)/ --format=tar HEAD) | gzip > systemtap-$(VERSION).tar.gz | |
813ed4cb | 281 | |
9b2e2b58 | 282 | rpm: dist-gzip |
4040e9ea FCE |
283 | mkdir -p `rpm --eval %_specdir` |
284 | mkdir -p `rpm --eval %_srcrpmdir` | |
285 | mkdir -p `rpm --eval %_rpmdir` | |
286 | mkdir -p `rpm --eval %_builddir` | |
287 | mkdir -p `rpm --eval %_buildroot` | |
288 | rpmbuild --define "_sourcedir $(PWD)/" -ta systemtap-$(VERSION).tar.gz $(RPMBUILDFLAGS) |