diff options
author | wenji <wjhuang@dhcp-beijing-cdc-10-182-120-233.cn.oracle.com> | 2008-04-10 21:29:51 -0400 |
---|---|---|
committer | wenji <wjhuang@dhcp-beijing-cdc-10-182-120-233.cn.oracle.com> | 2008-04-10 21:29:51 -0400 |
commit | d58c66bfef5cfa7267ced03db11928fd5c78ba9c (patch) | |
tree | 8c7065afbd175ab315f391318a6dd7f9bb229fb9 /Makefile.am | |
parent | f317d3a33bdf4962b0655861e4552b5fec0f0a37 (diff) | |
parent | ec5d7273b73c56dacb4ac9b167186ff1ea964e63 (diff) | |
download | systemtap-steved-d58c66bfef5cfa7267ced03db11928fd5c78ba9c.tar.gz systemtap-steved-d58c66bfef5cfa7267ced03db11928fd5c78ba9c.tar.xz systemtap-steved-d58c66bfef5cfa7267ced03db11928fd5c78ba9c.zip |
Merge branch 'master' of ssh://wenji@sources.redhat.com/git/systemtap
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index 1fc4dbec..19451834 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,12 +18,53 @@ stap_SOURCES = main.cxx \ cache.cxx util.cxx coveragedb.cxx stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ +BUILT_SOURCES = +CLEANFILES = + +# Arrange for git_version.h to be regenerated at every "make". +# Code fragment is based upon RadeonHD.am. + +# The stamp file which is never created ensures that git_version.h is updated +# before every build. Having git_version.h in foo_SOURCES ensures a recompile +# of foo-bar.c if it is newer than the foo-bar.o file. Using noinst_foo_SOURCES +# instead of foo_SOURCES prevents shipping git_version.h in dist tarballs, +# which may cause false GIT_FOO readings. +BUILT_SOURCES += git_version.stamp +CLEANFILES += git_version.h +GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh +git_version.stamp: + @if test -f "$(srcdir)/git_version.h"; then \ + if test -f "git_version.h"; then :; \ + else \ + cp "$(srcdir)/git_version.h" "git_version.h"; \ + fi; \ + fi + $(GIT_VERSION_CMD) -k -s $(top_srcdir) -o git_version.h + @if test -s "$(srcdir)/git_version.h"; then \ + if cmp "$(srcdir)/git_version.h" "git_version.h"; then :; \ + else \ + echo "Error: $(srcdir)/git_version.h and git_version.h differ."; \ + echo " You probably want to remove the former."; \ + exit 1; \ + fi; \ + fi + +dist-gitversion: git_version.stamp + if test -f "git_version.h"; then \ + sed -e 's|^#undef GIT_IS_DIST.*|#define GIT_IS_DIST 1|' \ + "git_version.h" > "$(distdir)/git_version.h"; \ + fi + + +git_version.h: + $(srcdir)/git_version.sh -k --srcdir $(srcdir) -o git_version.h + + + stap_CXXFLAGS = $(AM_CXXFLAGS) stap_CPPFLAGS = $(AM_CPPFLAGS) stap_LDFLAGS = $(AM_LDFLAGS) -CLEANFILES = - if BUILD_ELFUTILS # This tells automake's "make distcheck" what we need to compile. DISTCHECK_CONFIGURE_FLAGS = --with-elfutils=$(elfutils_abs_srcdir) @@ -31,7 +72,7 @@ DISTCHECK_CONFIGURE_FLAGS = --with-elfutils=$(elfutils_abs_srcdir) stap_CPPFLAGS += -Iinclude-elfutils stap_LDFLAGS += -Llib-elfutils -Wl,-rpath-link,lib-elfutils \ -Wl,--enable-new-dtags,-rpath,$(pkglibdir) -BUILT_SOURCES = stamp-elfutils +BUILT_SOURCES += stamp-elfutils CLEANFILES += stamp-elfutils stamp-elfutils: config.status $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all @@ -102,7 +143,8 @@ LDADD = EXTRA_DIST = buildrun.h elaborate.h loc2c.h session.h \ parse.h staptree.h tapsets.h translate.h \ cache.h hash.h mdfour.h util.h staplog.c coveragedb.h \ - examples testsuite systemtap.spec runtime tapset + examples testsuite systemtap.spec runtime tapset \ + git_version.h git_version.sh SAMPLE_DEST_DIR = $(distdir)/examples/samples @@ -121,7 +163,7 @@ dist-add-samples: $(SAMPLE_SRC) mkdir -p $(SAMPLE_DEST_DIR) cp $(SAMPLE_SRC) $(SAMPLE_DEST_DIR) -dist-hook: dist-add-samples +dist-hook: dist-add-samples dist-gitversion find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf find $(distdir) -name '*.o' -o -name '*.ko' -o -name '*.cmd' -o -name '*.mod.c' -o -name '.??*' | xargs rm -rf find $(distdir) -name 'stap' -o -name '*.log' -o -name '*.sum' -o -name 'site.exp' | xargs rm -rf |