summaryrefslogtreecommitdiffstats
path: root/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in45
1 files changed, 41 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index e82d66a3..74ed1bea 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -38,6 +38,7 @@ bin_PROGRAMS = stap$(EXEEXT) staprun$(EXEEXT)
@BUILD_ELFUTILS_TRUE@ -Wl,--enable-new-dtags,-rpath,$(pkglibdir)
@BUILD_ELFUTILS_TRUE@am__append_3 = stamp-elfutils
+@BUILD_ELFUTILS_TRUE@am__append_4 = stamp-elfutils
@BUILD_ELFUTILS_FALSE@stap_DEPENDENCIES =
pkglibexec_PROGRAMS = stapio$(EXEEXT)
noinst_PROGRAMS = loc2c-test$(EXEEXT)
@@ -275,14 +276,24 @@ stap_SOURCES = main.cxx \
cache.cxx util.cxx coveragedb.cxx
stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@
+
+# 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 $(am__append_3)
+CLEANFILES = git_version.h $(am__append_4) $(pkglibexec_PROGRAMS)
+GIT_VERSION_CMD = $(SHELL) $(top_srcdir)/git_version.sh
stap_CXXFLAGS = $(AM_CXXFLAGS)
stap_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_1)
stap_LDFLAGS = $(AM_LDFLAGS) $(am__append_2)
-CLEANFILES = $(am__append_3) $(pkglibexec_PROGRAMS)
# This tells automake's "make distcheck" what we need to compile.
@BUILD_ELFUTILS_TRUE@DISTCHECK_CONFIGURE_FLAGS = --with-elfutils=$(elfutils_abs_srcdir)
-@BUILD_ELFUTILS_TRUE@BUILT_SOURCES = stamp-elfutils
@BUILD_ELFUTILS_TRUE@stap_DEPENDENCIES = lib-elfutils/libdw.so
staprun_SOURCES = runtime/staprun/staprun.c runtime/staprun/staprun_funcs.c\
runtime/staprun/ctl.c runtime/staprun/common.c \
@@ -311,7 +322,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
SAMPLE_SRC = $(srcdir)/testsuite/systemtap.samples/iotask.stp \
@@ -1458,6 +1470,31 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
uninstall-man uninstall-man1 uninstall-man5 uninstall-man8 \
uninstall-pkglibexecPROGRAMS
+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
@BUILD_ELFUTILS_TRUE@stamp-elfutils: config.status
@BUILD_ELFUTILS_TRUE@ $(MAKE) $(AM_MAKEFLAGS) -C build-elfutils all
@BUILD_ELFUTILS_TRUE@ for dir in libelf libebl libdw libdwfl backends; do \
@@ -1492,7 +1529,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