]> sourceware.org Git - systemtap.git/blame - Makefile.am
rebased unwind_branch on top of current master
[systemtap.git] / Makefile.am
CommitLineData
2f1a1aea
FCE
1# Makefile.am --- automake input file for systemtap
2## process this file with automake to produce Makefile.in
3
42b926b7
RM
4AUTOMAKE_OPTIONS = dist-bzip2
5
e460639f
RM
6pkglibexecdir = ${libexecdir}/${PACKAGE}
7
6bc51533 8AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"'
f00a8372 9
a4531d21
FCE
10AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wshadow -Wunused -Wformat=2 -W
11AM_CXXFLAGS = -Wall -Werror
77de5e9e 12
8905eef6 13dist_man_MANS = stap.1 stapprobes.5 stapfuncs.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
a63a95dc 14bin_PROGRAMS = stap staprun
56e12059 15stap_SOURCES = main.cxx \
f4b28491 16 parse.cxx staptree.cxx elaborate.cxx translate.cxx \
1b78aef5 17 tapsets.cxx buildrun.cxx loc2c.c hash.cxx mdfour.c \
c3a3c0c9 18 cache.cxx util.cxx coveragedb.cxx
42feb3c0 19stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@
e9d58a72 20
78f6bba6 21stap_CXXFLAGS = $(AM_CXXFLAGS)
e460639f
RM
22stap_CPPFLAGS = $(AM_CPPFLAGS)
23stap_LDFLAGS = $(AM_LDFLAGS)
24
25CLEANFILES =
26
27if BUILD_ELFUTILS
fa1d05cd
RM
28# This tells automake's "make distcheck" what we need to compile.
29DISTCHECK_CONFIGURE_FLAGS = --with-elfutils=$(elfutils_abs_srcdir)
30
e460639f
RM
31stap_CPPFLAGS += -Iinclude-elfutils
32stap_LDFLAGS += -Llib-elfutils -Wl,-rpath-link,lib-elfutils \
33 -Wl,--enable-new-dtags,-rpath,$(pkglibdir)
34BUILT_SOURCES = stamp-elfutils
35CLEANFILES += stamp-elfutils
36stamp-elfutils: config.status
37 $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all
38 for dir in libelf libebl libdw libdwfl backends; do \
39 $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils/$$dir install; \
40 done
41 touch $@
42stap_DEPENDENCIES = lib-elfutils/libdw.so
43lib-elfutils/libdw.so: stamp-elfutils ;
44
45.PHONY: install-elfutils
46install-elfutils:
17a127da 47 mkdir -p $(DESTDIR)$(pkglibdir)
a3e695ac 48 for file in lib-elfutils/*.so* lib-elfutils/${PACKAGE_NAME}/*.so*; do \
17a127da 49 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(pkglibdir); \
a3e695ac 50 done
e460639f
RM
51install-exec-local: install-elfutils
52endif
d04cf5ff 53
98aab489
DS
54staprun_SOURCES = runtime/staprun/staprun.c runtime/staprun/staprun_funcs.c\
55 runtime/staprun/ctl.c runtime/staprun/common.c \
aaf2af3e 56 runtime/staprun/cap.c
e65b03c1 57
7651c16b 58staprun_CPPFLAGS = $(AM_CPPFLAGS)
aaf2af3e
FCE
59staprun_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) -DSINGLE_THREADED
60staprun_LDADD = @PROCFLAGS@ @cap_LIBS@
2f1a1aea 61
98aab489
DS
62stapio_SOURCES = runtime/staprun/stapio.c \
63 runtime/staprun/mainloop.c runtime/staprun/common.c \
aaf2af3e 64 runtime/staprun/ctl.c runtime/staprun/unwind_data.c \
98aab489
DS
65 runtime/staprun/relay.c runtime/staprun/relay_old.c
66
67stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS)
aaf2af3e 68stapio_LDADD = @PROCFLAGS@ -ldw -lpthread
98aab489
DS
69
70install-exec-hook:
7ab87feb
FCE
71 if [ `id -u` -eq 0 ]; then chmod 04111 "$(DESTDIR)$(bindir)/staprun"; fi
72
73# Why the "id -u" condition? This way, an unprivileged user can run
74# make install, and have "sudo stap ...." or "sudo staprun ...." work later.
75
98aab489
DS
76
77pkglibexec_PROGRAMS = stapio
78CLEANFILES += $(pkglibexec_PROGRAMS)
e460639f 79
5a5e5134 80noinst_PROGRAMS = loc2c-test
51e874a1 81loc2c_test_SOURCES = loc2c-test.c loc2c.c
e460639f
RM
82loc2c_test_CPPFLAGS = $(stap_CPPFLAGS)
83loc2c_test_LDFLAGS = $(stap_LDFLAGS)
84loc2c_test_LDADD = $(stap_LDADD)
51e874a1 85
35a04c8e
FCE
86# crash(8) extension
87if BUILD_CRASHMOD
88STAPLOG=staplog.so
89
90$(STAPLOG): staplog.c
564eb0a8
DS
91 $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \
92 $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $<
35a04c8e
FCE
93all-local: $(STAPLOG)
94install-exec-local: $(STAPLOG)
674427d3 95 $(MKDIR_P) $(DESTDIR)$(pkglibdir)
17a127da 96 $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir)
35a04c8e
FCE
97endif
98
2f1a1aea
FCE
99# Get extra libs as needed
100LDADD =
101
6a39967c 102EXTRA_DIST = buildrun.h elaborate.h loc2c.h session.h \
840e48ba 103 parse.h staptree.h tapsets.h translate.h \
9c94117b 104 cache.h hash.h mdfour.h util.h staplog.c coveragedb.h \
94cfa802
DS
105 examples testsuite systemtap.spec runtime tapset
106
107SAMPLE_DEST_DIR = $(distdir)/examples/samples
108
2686f60a
WC
109SAMPLE_SRC = $(srcdir)/testsuite/systemtap.samples/iotask.stp \
110 $(srcdir)/testsuite/systemtap.samples/kmalloc-stacks.stp \
111 $(srcdir)/testsuite/systemtap.samples/kmalloc-top \
112 $(srcdir)/testsuite/systemtap.samples/pfaults.stp \
113 $(srcdir)/testsuite/systemtap.samples/profile.stp \
114 $(srcdir)/testsuite/systemtap.samples/tcp_connections.stp \
115 $(srcdir)/testsuite/systemtap.samples/topsys.stp
94cfa802
DS
116
117# Copy some of the testsuite sample scripts to the distdir
118# 'examples/samples' directory.
119dist-add-samples: $(SAMPLE_SRC)
120 rm -rf $(SAMPLE_DEST_DIR)
121 mkdir -p $(SAMPLE_DEST_DIR)
122 cp $(SAMPLE_SRC) $(SAMPLE_DEST_DIR)
123
124dist-hook: dist-add-samples
f00a8372 125 find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf
a544b4ae 126 find $(distdir) -name '*.o' -o -name '*.ko' -o -name '*.cmd' -o -name '*.mod.c' -o -name '.??*' | xargs rm -rf
2752649c 127 find $(distdir) -name 'stap' -o -name '*.log' -o -name '*.sum' -o -name 'site.exp' | xargs rm -rf
0d49d7bc 128
ecfa3e8b 129install-data-local:
ef9e124a 130 (cd $(srcdir)/runtime; for f in *.[ch]; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/$$f; done)
aaf2af3e
FCE
131 (cd $(srcdir)/runtime/unwind; find . \( -name '*.[ch]' \) -print \
132 | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/unwind/$$f; done)
ef9e124a
MH
133 (cd $(srcdir)/runtime/transport; for f in *.[ch]; \
134 do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/transport/$$f; done)
6274464e 135 (cd $(srcdir)/runtime/uprobes; for f in Makefile *.[ch]; \
36b16282 136 do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done)
4b2c4ab5 137 (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \
ef9e124a 138 | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
ecfa3e8b 139
e885b2ec
WC
140TEST_COV_DIR = coverage
141
af56020f 142gcov:
e885b2ec 143 @-$(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" all check
af56020f 144 @gcov *.gcno >/dev/null 2>&1
af56020f
FCE
145 @rm -f `ls -1 *.gcov | fgrep -v .cxx.gcov`
146 ls -l *.cxx.gcov
147
e885b2ec
WC
148lcov:
149 @lcov --directory . -z
150 @-$(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" all check
151 @lcov --directory . -c -o stap.info
152 @genhtml -o ./$(TEST_COV_DIR) stap.info
153
1e7ad3bf 154clean-local:
f00a8372
RM
155 rm -f *.gcov *.gcno *.gcda ${PACKAGE_TARNAME}-*.tar.gz
156 rm -rf ${PACKAGE_TARNAME}-${PACKAGE_VERSION}
e885b2ec
WC
157 rm -rf $(TEST_COV_DIR)
158 rm -rf stap.info
35a04c8e 159 rm -rf staplog.so
4d4f412b
FCE
160
161uninstall-local:
162 rm -rf $(DESTDIR)$(pkgdatadir)
163 rm -rf $(DESTDIR)$(libexecdir)/$(PACKAGE)
35a04c8e 164 rm -rf $(DESTDIR)$(libdir)/$(PACKAGE)
4d4f412b 165 -rm -rf $(DESTDIR)$(localstatedir)/cache/$(PACKAGE)
35a04c8e 166# XXX: leaves behind man pages
8129fd92 167
465e8fbf 168SUBDIRS = testsuite doc
5ba96b90 169
5ba96b90 170check:
17a127da
RM
171 SRCDIR=`cd $(srcdir); pwd`; \
172 $(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
173
174installcheck:
175 $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)"
8f3c45cc
FCE
176
177rpm: systemtap.spec dist
178 rpmbuild --define "_sourcedir $(PWD)/" -ba systemtap.spec
This page took 0.067481 seconds and 5 git commands to generate.