summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-04-10 13:34:30 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-04-10 13:34:30 -0400
commite434132f0168145d24cc8f0e6b204020773d561a (patch)
tree2b831a840328b872a83399e65de33efa0628f07e
parentc0f9d4b0f1e4d1d49d238e4b2546de46f51166eb (diff)
downloadsystemtap-steved-e434132f0168145d24cc8f0e6b204020773d561a.tar.gz
systemtap-steved-e434132f0168145d24cc8f0e6b204020773d561a.tar.xz
systemtap-steved-e434132f0168145d24cc8f0e6b204020773d561a.zip
PR6393: regenerate git_version.h at every make
2008-04-10 Frank Ch. Eigler <fche@elastic.org> PR 6393 cont'd. * Makefile.am: Also copy RadeonHD.am fragment to force git_version.h regeneration at every make, and also special tagging for "make dist". Thanks <ndim>.
-rw-r--r--ChangeLog7
-rw-r--r--Makefile.am49
-rw-r--r--Makefile.in42
3 files changed, 87 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index fc720484..e35c3f71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-04-10 Frank Ch. Eigler <fche@elastic.org>
+ PR 6393 cont'd.
+ * Makefile.am: Also copy RadeonHD.am fragment to force
+ git_version.h regeneration at every make, and also special
+ tagging for "make dist". Thanks <ndim>.
+
+2008-04-10 Frank Ch. Eigler <fche@elastic.org>
+
PR 6393.
* git_version.sh: New file, copied from radeonhd.
* configure.ac: No longer generate $builddir/SNAPSHOT.
diff --git a/Makefile.am b/Makefile.am
index b09bbc05..19451834 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,16 +17,54 @@ stap_SOURCES = main.cxx \
tapsets.cxx buildrun.cxx loc2c.c hash.cxx mdfour.c \
cache.cxx util.cxx coveragedb.cxx
stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@
-main.o: git_version.h
+
+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)
@@ -34,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
@@ -125,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
@@ -160,7 +198,6 @@ clean-local:
rm -rf $(TEST_COV_DIR)
rm -rf stap.info
rm -rf staplog.so
- rm -f git_version.h
uninstall-local:
rm -rf $(DESTDIR)$(pkgdatadir)
diff --git a/Makefile.in b/Makefile.in
index e1259bde..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 \
@@ -1459,7 +1470,29 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
uninstall-man uninstall-man1 uninstall-man5 uninstall-man8 \
uninstall-pkglibexecPROGRAMS
-main.o: git_version.h
+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
@@ -1496,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
@@ -1529,7 +1562,6 @@ clean-local:
rm -rf $(TEST_COV_DIR)
rm -rf stap.info
rm -rf staplog.so
- rm -f git_version.h
uninstall-local:
rm -rf $(DESTDIR)$(pkgdatadir)