]> sourceware.org Git - systemtap.git/blame_incremental - Makefile.am
Add tapset/arm64/aux_syscalls.stp
[systemtap.git] / Makefile.am
... / ...
CommitLineData
1# Makefile.am --- automake input file for systemtap
2## process this file with automake to produce Makefile.in
3
4# we don't maintain a ChangeLog, which makes us non-GNU -> foreign
5AUTOMAKE_OPTIONS = no-dist foreign
6
7pkglibexecdir = ${libexecdir}/${PACKAGE}
8oldincludedir = ${includedir}/sys
9
10AM_CPPFLAGS = -DBINDIR='"$(bindir)"' \
11 -DSYSCONFDIR='"$(sysconfdir)"' \
12 -DPKGDATADIR='"$(pkgdatadir)"' \
13 -DPKGLIBDIR='"$(pkglibexecdir)"' \
14 -DLOCALEDIR='"$(localedir)"' \
15 -I$(srcdir)/includes -I$(builddir)/includes/sys
16
17AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W
18AM_CXXFLAGS = -Wall -Werror
19
20bin_SCRIPTS = stap-report
21pkglibexec_SCRIPTS = stap-env
22oldinclude_HEADERS = includes/sys/sdt.h includes/sys/sdt-config.h
23
24bin_PROGRAMS =
25
26if BUILD_TRANSLATOR
27bin_PROGRAMS += stap
28bin_SCRIPTS += dtrace
29
30pkglibexec_PROGRAMS =
31
32if HAVE_NSS
33pkglibexec_PROGRAMS += stap-sign-module stap-authorize-cert
34
35if BUILD_SERVER
36pkglibexec_PROGRAMS += stap-serverd stap-gen-cert
37bin_SCRIPTS += stap-server
38pkglibexec_SCRIPTS += stap-start-server stap-stop-server
39endif
40endif
41
42stap_SOURCES = main.cxx session.cxx \
43 parse.cxx staptree.cxx elaborate.cxx translate.cxx \
44 tapsets.cxx buildrun.cxx loc2c.c hash.cxx mdfour.c \
45 cache.cxx util.cxx coveragedb.cxx dwarf_wrappers.cxx \
46 tapset-been.cxx tapset-procfs.cxx tapset-timers.cxx tapset-netfilter.cxx \
47 tapset-perfmon.cxx tapset-mark.cxx tapset-itrace.cxx \
48 tapset-utrace.cxx task_finder.cxx dwflpp.cxx rpm_finder.cxx \
49 setupdwfl.cxx remote.cxx privilege.cxx cmdline.cxx \
50 tapset-dynprobe.cxx tapset-method.cxx translator-output.cxx
51stap_SOURCES += stapregex.cxx stapregex-tree.cxx stapregex-parse.cxx \
52 stapregex-dfa.cxx
53noinst_HEADERS = sdt_types.h
54stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @LIBINTL@ -lpthread
55stap_DEPENDENCIES =
56
57if HAVE_LIBVIRT
58if HAVE_LIBXML2
59bin_PROGRAMS += stapvirt
60stapvirt_SOURCES = stapvirt.c
61stapvirt_CFLAGS = $(AM_CFLAGS)
62stapvirt_CFLAGS += $(libvirt_CFLAGS) $(libxml2_CFLAGS)
63stapvirt_LDFLAGS = $(AM_LDFLAGS)
64stapvirt_LDADD = $(libvirt_LIBS) $(libxml2_LIBS)
65endif
66endif
67
68endif
69
70install: all
71 $(MAKE) $(AM_MAKEFLAGS) install-recursive
72
73BUILT_SOURCES =
74CLEANFILES =
75
76# Arrange for git_version.h to be regenerated at every "make".
77# Code fragment is based upon RadeonHD.am.
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.
84BUILT_SOURCES += git_version.stamp
85CLEANFILES += git_version.h
86GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh
87git_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
104git_version.h:
105 $(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h
106
107cscope:
108 cd $(srcdir) && \
109 (echo -q ; git ls-files '*.cxx' '*.c' '*.h' | grep -v '^testsuite' ) > cscope.files && \
110 cscope -b -q @DYNINST_CXXFLAGS@
111
112PHONIES =
113if BUILD_TRANSLATOR
114stap_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@
115stap_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@
116stap_CPPFLAGS = $(AM_CPPFLAGS) -DSTAP_SDT_V2
117stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
118
119if HAVE_AVAHI
120stap_CXXFLAGS += $(avahi_CFLAGS)
121stap_CPPFLAGS += $(avahi_CFLAGS)
122stap_LDADD += $(avahi_LIBS)
123endif
124
125if HAVE_NSS
126stap_SOURCES += nsscommon.cxx csclient.cxx cscommon.cxx
127stap_CFLAGS += $(nss_CFLAGS) -DSTAP
128stap_CXXFLAGS += $(nss_CFLAGS)
129stap_CPPFLAGS += $(nss_CFLAGS)
130stap_LDADD += $(nss_LIBS)
131
132install-exec-local: install-scripts
133
134PHONIES += install-scripts
135# scripts must be installed before this rule is run
136install-scripts: install-binSCRIPTS install-pkglibexecSCRIPTS
137 for f in $(bin_SCRIPTS); do \
138 sed -i -e "s,\$${PKGLIBEXECDIR},$(pkglibexecdir)/," $(DESTDIR)$(bindir)/$$f; \
139 done
140 for f in $(pkglibexec_SCRIPTS); do \
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; \
142 done
143endif
144
145if BUILD_ELFUTILS
146stap_CPPFLAGS += -Iinclude-elfutils
147stap_LDFLAGS += -Llib-elfutils -Wl,-rpath-link,lib-elfutils \
148 -Wl,--enable-new-dtags,-rpath,$(pkglibdir)
149
150
151BUILT_SOURCES += stamp-elfutils
152CLEANFILES += stamp-elfutils
153stamp-elfutils: config.status
154 $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all bin_PROGRAMS=
155 for dir in libelf libebl libdw libdwfl backends; do \
156 $(MAKE) $(AM_MAKEFLAGS) -j1 -C build-elfutils/$$dir bin_PROGRAMS= install; \
157 done
158 $(MAKE) $(AM_MAKEFLAGS) -j1 -C build-elfutils install-pkgincludeHEADERS;
159 touch $@
160stap_DEPENDENCIES += lib-elfutils/libdw.so
161lib-elfutils/libdw.so: stamp-elfutils ;
162
163PHONIES += install-elfutils
164install-elfutils:
165 mkdir -p $(DESTDIR)$(pkglibdir)
166 for file in lib-elfutils/*.so* lib-elfutils/${PACKAGE_NAME}/*.so*; do \
167 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(pkglibdir); \
168 done
169install-exec-local: install-elfutils
170endif
171endif
172
173CLEANFILES += $(pkglibexec_PROGRAMS)
174
175if BUILD_TRANSLATOR
176if HAVE_NSS
177stap_sign_module_SOURCES = stap-sign-module.cxx nsscommon.cxx util.cxx
178stap_sign_module_CPPFLAGS = $(AM_CPPFLAGS)
179stap_sign_module_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
180stap_sign_module_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS)
181stap_sign_module_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
182stap_sign_module_LDADD = $(nss_LIBS)
183
184stap_authorize_cert_SOURCES = stap-authorize-cert.cxx nsscommon.cxx util.cxx
185stap_authorize_cert_CPPFLAGS = $(AM_CPPFLAGS)
186stap_authorize_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
187stap_authorize_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS)
188stap_authorize_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
189stap_authorize_cert_LDADD = $(nss_LIBS)
190
191if BUILD_SERVER
192stap_serverd_SOURCES = stap-serverd.cxx cscommon.cxx util.cxx privilege.cxx nsscommon.cxx cmdline.cxx
193stap_serverd_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
194stap_serverd_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS)
195stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
196stap_serverd_LDADD = $(nss_LIBS) -lpthread
197if HAVE_AVAHI
198stap_serverd_CFLAGS += $(avahi_CFLAGS)
199stap_serverd_CXXFLAGS += $(avahi_CFLAGS)
200stap_serverd_LDADD += $(avahi_LIBS)
201endif
202
203stap_gen_cert_SOURCES = stap-gen-cert.cxx util.cxx nsscommon.cxx
204stap_gen_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
205stap_gen_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS)
206stap_gen_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
207stap_gen_cert_LDADD = $(nss_LIBS)
208endif
209endif
210
211noinst_PROGRAMS = loc2c-test
212loc2c_test_SOURCES = loc2c-test.c loc2c.c
213loc2c_test_CFLAGS = $(stap_CFLAGS)
214loc2c_test_CPPFLAGS = $(stap_CPPFLAGS)
215loc2c_test_LDFLAGS = $(stap_LDFLAGS)
216loc2c_test_LDADD = $(stap_LDADD)
217endif
218
219# crash(8) extension
220if BUILD_CRASHMOD
221STAPLOG=staplog.so
222
223$(STAPLOG): staplog.c
224 $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \
225 $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $<
226all-local: $(STAPLOG) example_index
227install-exec-local: $(STAPLOG)
228 $(MKDIR_P) $(DESTDIR)$(pkglibdir)
229 $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir)
230else
231all-local: example_index
232endif
233
234# Get extra libs as needed
235LDADD =
236
237EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples
238EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta
239
240example_index: $(EXAMPLE_SOURCE_DIR)/index.html
241
242$(EXAMPLE_SOURCE_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN)
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."
247
248install-data-local:
249 (cd $(srcdir)/runtime; for f in *.[ch]; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/$$f; done)
250if 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)
253endif
254 (cd $(srcdir)/runtime/unwind; find . \( -name '*.[ch]' \) -print \
255 | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/unwind/$$f; done)
256 (cd $(srcdir)/runtime/transport; for f in *.[ch]; \
257 do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/transport/$$f; done)
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)
264 (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name '*.stpm' -o -name README \) -print \
265 | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
266 (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \
267 | egrep -v 'check.exp|ChangeLog|examples-index-gen.pl|html/.*\.tmpl$$' \
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)
272 test -e $(DESTDIR)$(sysconfdir)/systemtap || mkdir -p $(DESTDIR)$(sysconfdir)/systemtap
273if 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
276endif
277
278
279TEST_COV_DIR = coverage
280
281gcov:
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'
289
290clean-local:
291 rm -rf ${PACKAGE_TARNAME}-*.tar.gz
292 rm -rf ${PACKAGE_TARNAME}-${PACKAGE_VERSION}
293 rm -rf $(TEST_COV_DIR)
294 rm -rf stap.info
295 rm -rf staplog.so
296
297distclean-local:
298 rm -rf build-elfutils include-elfutils lib-elfutils
299 rm -f doc/beginners/en-US doc/beginners/build/en-US/testsuite
300
301uninstall-local:
302 rm -rf $(DESTDIR)$(pkgdatadir)
303 rm -rf $(DESTDIR)$(libdir)/$(PACKAGE)
304 -rm -rf $(DESTDIR)$(localstatedir)/cache/$(PACKAGE)
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
317 rm -rf $(DESTDIR)$(sysconfdir)/systemtap
318 rm -rf $(DESTDIR)$(docdir)/examples
319if BUILD_SERVER
320 rm -rf $(DESTDIR)$(localstatedir)/run/stap-server
321 rm -f $(DESTDIR)$(localstatedir)/log/stap-server/log
322endif
323
324SUBDIRS = . java stapdyn staprun doc man po
325# NB: the gcov target above uses this to enumarate linked binaries' build directories
326DIST_SUBDIRS = testsuite $(SUBDIRS)
327EXTRA_DIST = m4/ChangeLog
328
329check-local:
330 SRCDIR=`cd $(srcdir); pwd`; \
331 PWD=`pwd`; \
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)";
333
334installcheck:
335 if test \! -e $(DESTDIR)$(bindir)/stap; then \
336 echo $(DESTDIR)$(bindir)/stap doesn\'t exist, run make install; \
337 exit -1; \
338 fi; \
339 if test $(builddir)/stap -nt $(DESTDIR)$(bindir)/stap; then \
340 echo "$(DESTDIR)$(bindir)/stap is not recent, run make install"; \
341 exit -1; \
342 fi;
343 $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)"
344
345PHONIES += runcheck
346# All the variables are overridden by run-stap, but SYSTEMTAP_RUNTIME
347# is used by the testsuite scripts themselves.
348runcheck: testsuite/stap testsuite/dtrace
349 $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" \
350 SYSTEMTAP_PATH="`cd testsuite; pwd`" \
351 SYSTEMTAP_RUNTIME="`cd $(srcdir)/runtime; pwd`"
352testsuite/stap: run-stap
353 (echo '#!/bin/sh'; echo "exec `pwd`/run-stap" '$${1+"$$@"}') > $@.new
354 chmod 555 $@.new
355 mv -f $@.new $@
356testsuite/dtrace: dtrace
357 (echo '#!/bin/sh'; echo "exec `pwd`/dtrace" '$${1+"$$@"}') > $@.new
358 chmod 555 $@.new
359 mv -f $@.new $@
360
361PHONIES += update-po
362update-po:
363 (cd $(srcdir); ls -1d *.c *.cxx *.h staprun/*.c staprun/*.h) \
364 | grep -v loc2c-test.c \
365 | grep -v config.h \
366 | grep -v git_version.h \
367 | grep -v staprun/config.h \
368 | sort > $(srcdir)/po/POTFILES.in
369 $(MAKE) -C po update-po
370
371
372# Any extra flags, such as:
373# --define "with_docs 0"
374# --define "with_bundled_elfutils 1" --define "elfutils_version 0.135"
375RPMBUILDFLAGS=
376
377PHONIES += dist-gzip rpm srpm
378
379PHONIES += uprobes install-uprobes
380uprobes:
381 $(MAKE) -C $(srcdir)/runtime/uprobes clean default
382install-uprobes:
383 $(MAKE) -C $(DESTDIR)$(pkgdatadir)/runtime/uprobes clean default
384
385.PHONY: $(PHONIES)
386
387dist-gzip:
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
390
391rpm: dist-gzip
392 if [ `id -u` = 0 ]; then echo NOTE: do not run this as root; exit 1; fi
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)
399
400srpm: dist-gzip
401 mkdir -p `rpm --eval %_srcrpmdir`
402 rpmbuild --define "_sourcedir $(PWD)/" -ts systemtap-$(VERSION).tar.gz $(RPMBUILDFLAGS)
403
404ACLOCAL_AMFLAGS = -I m4
This page took 0.025083 seconds and 5 git commands to generate.