]>
Commit | Line | Data |
---|---|---|
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 | |
5 | AUTOMAKE_OPTIONS = no-dist foreign | |
6 | ||
7 | pkglibexecdir = ${libexecdir}/${PACKAGE} | |
8 | oldincludedir = ${includedir}/sys | |
9 | ||
10 | AM_CPPFLAGS = -DBINDIR='"$(bindir)"' \ | |
11 | -DSYSCONFDIR='"$(sysconfdir)"' \ | |
12 | -DPKGDATADIR='"$(pkgdatadir)"' \ | |
13 | -DPKGLIBDIR='"$(pkglibexecdir)"' \ | |
14 | -DLOCALEDIR='"$(localedir)"' \ | |
15 | -I$(srcdir)/includes -I$(builddir)/includes/sys | |
16 | ||
17 | AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W | |
18 | AM_CXXFLAGS = -Wall -Werror | |
19 | ||
20 | bin_SCRIPTS = stap-report | |
21 | pkglibexec_SCRIPTS = stap-env | |
22 | oldinclude_HEADERS = includes/sys/sdt.h includes/sys/sdt-config.h | |
23 | ||
24 | bin_PROGRAMS = | |
25 | ||
26 | if BUILD_TRANSLATOR | |
27 | bin_PROGRAMS += stap | |
28 | bin_SCRIPTS += dtrace | |
29 | ||
30 | pkglibexec_PROGRAMS = | |
31 | ||
32 | if HAVE_NSS | |
33 | pkglibexec_PROGRAMS += stap-sign-module stap-authorize-cert | |
34 | ||
35 | if BUILD_SERVER | |
36 | pkglibexec_PROGRAMS += stap-serverd stap-gen-cert | |
37 | bin_SCRIPTS += stap-server | |
38 | pkglibexec_SCRIPTS += stap-start-server stap-stop-server | |
39 | endif | |
40 | endif | |
41 | ||
42 | stap_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 | |
51 | stap_SOURCES += stapregex.cxx stapregex-tree.cxx stapregex-parse.cxx \ | |
52 | stapregex-dfa.cxx | |
53 | noinst_HEADERS = sdt_types.h | |
54 | stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @LIBINTL@ -lpthread | |
55 | stap_DEPENDENCIES = | |
56 | ||
57 | if HAVE_LIBVIRT | |
58 | if HAVE_LIBXML2 | |
59 | bin_PROGRAMS += stapvirt | |
60 | stapvirt_SOURCES = stapvirt.c | |
61 | stapvirt_CFLAGS = $(AM_CFLAGS) | |
62 | stapvirt_CFLAGS += $(libvirt_CFLAGS) $(libxml2_CFLAGS) | |
63 | stapvirt_LDFLAGS = $(AM_LDFLAGS) | |
64 | stapvirt_LDADD = $(libvirt_LIBS) $(libxml2_LIBS) | |
65 | endif | |
66 | endif | |
67 | ||
68 | endif | |
69 | ||
70 | install: all | |
71 | $(MAKE) $(AM_MAKEFLAGS) install-recursive | |
72 | ||
73 | BUILT_SOURCES = | |
74 | CLEANFILES = | |
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. | |
84 | BUILT_SOURCES += git_version.stamp | |
85 | CLEANFILES += git_version.h | |
86 | GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh | |
87 | git_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 | ||
104 | git_version.h: | |
105 | $(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h | |
106 | ||
107 | cscope: | |
108 | cd $(srcdir) && \ | |
109 | (echo -q ; git ls-files '*.cxx' '*.c' '*.h' | grep -v '^testsuite' ) > cscope.files && \ | |
110 | cscope -b -q @DYNINST_CXXFLAGS@ | |
111 | ||
112 | PHONIES = | |
113 | if BUILD_TRANSLATOR | |
114 | stap_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ | |
115 | stap_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ | |
116 | stap_CPPFLAGS = $(AM_CPPFLAGS) -DSTAP_SDT_V2 | |
117 | stap_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ | |
118 | ||
119 | if HAVE_AVAHI | |
120 | stap_CXXFLAGS += $(avahi_CFLAGS) | |
121 | stap_CPPFLAGS += $(avahi_CFLAGS) | |
122 | stap_LDADD += $(avahi_LIBS) | |
123 | endif | |
124 | ||
125 | if HAVE_NSS | |
126 | stap_SOURCES += nsscommon.cxx csclient.cxx cscommon.cxx | |
127 | stap_CFLAGS += $(nss_CFLAGS) -DSTAP | |
128 | stap_CXXFLAGS += $(nss_CFLAGS) | |
129 | stap_CPPFLAGS += $(nss_CFLAGS) | |
130 | stap_LDADD += $(nss_LIBS) | |
131 | ||
132 | install-exec-local: install-scripts | |
133 | ||
134 | PHONIES += install-scripts | |
135 | # scripts must be installed before this rule is run | |
136 | install-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 | |
143 | endif | |
144 | ||
145 | if BUILD_ELFUTILS | |
146 | stap_CPPFLAGS += -Iinclude-elfutils | |
147 | stap_LDFLAGS += -Llib-elfutils -Wl,-rpath-link,lib-elfutils \ | |
148 | -Wl,--enable-new-dtags,-rpath,$(pkglibdir) | |
149 | ||
150 | ||
151 | BUILT_SOURCES += stamp-elfutils | |
152 | CLEANFILES += stamp-elfutils | |
153 | stamp-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 $@ | |
160 | stap_DEPENDENCIES += lib-elfutils/libdw.so | |
161 | lib-elfutils/libdw.so: stamp-elfutils ; | |
162 | ||
163 | PHONIES += install-elfutils | |
164 | install-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 | |
169 | install-exec-local: install-elfutils | |
170 | endif | |
171 | endif | |
172 | ||
173 | CLEANFILES += $(pkglibexec_PROGRAMS) | |
174 | ||
175 | if BUILD_TRANSLATOR | |
176 | if HAVE_NSS | |
177 | stap_sign_module_SOURCES = stap-sign-module.cxx nsscommon.cxx util.cxx | |
178 | stap_sign_module_CPPFLAGS = $(AM_CPPFLAGS) | |
179 | stap_sign_module_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) | |
180 | stap_sign_module_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
181 | stap_sign_module_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ | |
182 | stap_sign_module_LDADD = $(nss_LIBS) | |
183 | ||
184 | stap_authorize_cert_SOURCES = stap-authorize-cert.cxx nsscommon.cxx util.cxx | |
185 | stap_authorize_cert_CPPFLAGS = $(AM_CPPFLAGS) | |
186 | stap_authorize_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) | |
187 | stap_authorize_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
188 | stap_authorize_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ | |
189 | stap_authorize_cert_LDADD = $(nss_LIBS) | |
190 | ||
191 | if BUILD_SERVER | |
192 | stap_serverd_SOURCES = stap-serverd.cxx cscommon.cxx util.cxx privilege.cxx nsscommon.cxx cmdline.cxx | |
193 | stap_serverd_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) | |
194 | stap_serverd_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
195 | stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ | |
196 | stap_serverd_LDADD = $(nss_LIBS) -lpthread | |
197 | if HAVE_AVAHI | |
198 | stap_serverd_CFLAGS += $(avahi_CFLAGS) | |
199 | stap_serverd_CXXFLAGS += $(avahi_CFLAGS) | |
200 | stap_serverd_LDADD += $(avahi_LIBS) | |
201 | endif | |
202 | ||
203 | stap_gen_cert_SOURCES = stap-gen-cert.cxx util.cxx nsscommon.cxx | |
204 | stap_gen_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS) | |
205 | stap_gen_cert_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS) | |
206 | stap_gen_cert_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@ | |
207 | stap_gen_cert_LDADD = $(nss_LIBS) | |
208 | endif | |
209 | endif | |
210 | ||
211 | noinst_PROGRAMS = loc2c-test | |
212 | loc2c_test_SOURCES = loc2c-test.c loc2c.c | |
213 | loc2c_test_CFLAGS = $(stap_CFLAGS) | |
214 | loc2c_test_CPPFLAGS = $(stap_CPPFLAGS) | |
215 | loc2c_test_LDFLAGS = $(stap_LDFLAGS) | |
216 | loc2c_test_LDADD = $(stap_LDADD) | |
217 | endif | |
218 | ||
219 | # crash(8) extension | |
220 | if BUILD_CRASHMOD | |
221 | STAPLOG=staplog.so | |
222 | ||
223 | $(STAPLOG): staplog.c | |
224 | $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \ | |
225 | $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $< | |
226 | all-local: $(STAPLOG) example_index | |
227 | install-exec-local: $(STAPLOG) | |
228 | $(MKDIR_P) $(DESTDIR)$(pkglibdir) | |
229 | $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir) | |
230 | else | |
231 | all-local: example_index | |
232 | endif | |
233 | ||
234 | # Get extra libs as needed | |
235 | LDADD = | |
236 | ||
237 | EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples | |
238 | EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta | |
239 | ||
240 | example_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 | ||
248 | install-data-local: | |
249 | (cd $(srcdir)/runtime; for f in *.[ch]; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/$$f; done) | |
250 | if 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) | |
253 | endif | |
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 | |
273 | if 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 | |
276 | endif | |
277 | ||
278 | ||
279 | TEST_COV_DIR = coverage | |
280 | ||
281 | gcov: | |
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 | ||
290 | clean-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 | ||
297 | distclean-local: | |
298 | rm -rf build-elfutils include-elfutils lib-elfutils | |
299 | rm -f doc/beginners/en-US doc/beginners/build/en-US/testsuite | |
300 | ||
301 | uninstall-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 | |
319 | if BUILD_SERVER | |
320 | rm -rf $(DESTDIR)$(localstatedir)/run/stap-server | |
321 | rm -f $(DESTDIR)$(localstatedir)/log/stap-server/log | |
322 | endif | |
323 | ||
324 | SUBDIRS = . java stapdyn staprun doc man po | |
325 | # NB: the gcov target above uses this to enumarate linked binaries' build directories | |
326 | DIST_SUBDIRS = testsuite $(SUBDIRS) | |
327 | EXTRA_DIST = m4/ChangeLog | |
328 | ||
329 | check-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 | ||
334 | installcheck: | |
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 | ||
345 | PHONIES += runcheck | |
346 | # All the variables are overridden by run-stap, but SYSTEMTAP_RUNTIME | |
347 | # is used by the testsuite scripts themselves. | |
348 | runcheck: testsuite/stap testsuite/dtrace | |
349 | $(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" \ | |
350 | SYSTEMTAP_PATH="`cd testsuite; pwd`" \ | |
351 | SYSTEMTAP_RUNTIME="`cd $(srcdir)/runtime; pwd`" | |
352 | testsuite/stap: run-stap | |
353 | (echo '#!/bin/sh'; echo "exec `pwd`/run-stap" '$${1+"$$@"}') > $@.new | |
354 | chmod 555 $@.new | |
355 | mv -f $@.new $@ | |
356 | testsuite/dtrace: dtrace | |
357 | (echo '#!/bin/sh'; echo "exec `pwd`/dtrace" '$${1+"$$@"}') > $@.new | |
358 | chmod 555 $@.new | |
359 | mv -f $@.new $@ | |
360 | ||
361 | PHONIES += update-po | |
362 | update-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" | |
375 | RPMBUILDFLAGS= | |
376 | ||
377 | PHONIES += dist-gzip rpm srpm | |
378 | ||
379 | PHONIES += uprobes install-uprobes | |
380 | uprobes: | |
381 | $(MAKE) -C $(srcdir)/runtime/uprobes clean default | |
382 | install-uprobes: | |
383 | $(MAKE) -C $(DESTDIR)$(pkgdatadir)/runtime/uprobes clean default | |
384 | ||
385 | .PHONY: $(PHONIES) | |
386 | ||
387 | dist-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 | ||
391 | rpm: 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 | ||
400 | srpm: dist-gzip | |
401 | mkdir -p `rpm --eval %_srcrpmdir` | |
402 | rpmbuild --define "_sourcedir $(PWD)/" -ts systemtap-$(VERSION).tar.gz $(RPMBUILDFLAGS) | |
403 | ||
404 | ACLOCAL_AMFLAGS = -I m4 |