From 679dd105175e085c8d2639a2df3133f53bd5a54c Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 9 Jul 2008 15:56:23 +0000 Subject: [PATCH] Opportunity to generate build timestamp via make buildstamped --- libisoburn/trunk/Makefile.am | 25 ++++++++++++++++++- .../trunk/xorriso/make_xorriso_standalone.sh | 5 ++++ libisoburn/trunk/xorriso/xorriso_buildstamp.h | 3 +++ .../trunk/xorriso/xorriso_buildstamp_none.h | 3 +++ .../trunk/xorriso/xorriso_makefile_am.txt | 22 +++++++++++++++- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 6 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 libisoburn/trunk/xorriso/xorriso_buildstamp.h create mode 100644 libisoburn/trunk/xorriso/xorriso_buildstamp_none.h diff --git a/libisoburn/trunk/Makefile.am b/libisoburn/trunk/Makefile.am index 5e0d8e42..3693c125 100644 --- a/libisoburn/trunk/Makefile.am +++ b/libisoburn/trunk/Makefile.am @@ -41,7 +41,8 @@ xorriso_xorriso_SOURCES = \ xorriso/xorriso.c \ xorriso/xorrisoburn.h \ xorriso/xorrisoburn.c \ - xorriso/xorriso_timestamp.h + xorriso/xorriso_timestamp.h \ + xorriso/xorriso_buildstamp.h # Install symbolic links to the xorriso binary @@ -52,6 +53,27 @@ install-exec-hook: if test -e $(bindir)/osirrox ; then rm $(bindir)/osirrox ; else echo ; fi ln -s xorriso $(bindir)/osirrox + +# Trying to create a build timestamp file +# +buildstamp: + date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h + cat xorriso/xorriso_buildstamp.h + +# For now make buildstamped has to be performed explicitely. +buildstamped: buildstamp + make +# +# Processing of the "all:" rule happens too late. +# How to create a dependency of xorriso.c on buildstamp ? +# Not working: +# Add xorriso_buildstamp.h to xorriso_xorriso_SOURCES and make it depend +# on buildstamp. It runs. But at quite random occasions. +# xorriso/xorriso_buildstamp.h: buildstamp +# +# all: buildstamp + + ## Build test applications noinst_PROGRAMS = \ test/compare_file @@ -129,6 +151,7 @@ EXTRA_DIST = \ COPYING \ INSTALL \ xorriso/changelog.txt \ + xorriso/xorriso_buildstamp_none.h \ xorriso/README \ $(man_MANS) diff --git a/libisoburn/trunk/xorriso/make_xorriso_standalone.sh b/libisoburn/trunk/xorriso/make_xorriso_standalone.sh index 5a8addb9..b1c3a926 100755 --- a/libisoburn/trunk/xorriso/make_xorriso_standalone.sh +++ b/libisoburn/trunk/xorriso/make_xorriso_standalone.sh @@ -124,12 +124,17 @@ copy_files \ xorriso/xorrisoburn.[ch] \ xorriso/xorriso.[ch1] \ xorriso/xorriso_private.h \ + \ xorriso/xorriso_timestamp.h \ + \ xorriso/changelog.txt \ xorriso/xorriso_eng.html \ xorriso/man_1_xorriso.html \ "$lone_dir"/xorriso +copy_files xorriso/xorriso_buildstamp_none.h \ + "$lone_dir"/xorriso/xorriso_buildstamp.h + create_dir "$lone_dir"/test copy_files \ test/compare_file.c \ diff --git a/libisoburn/trunk/xorriso/xorriso_buildstamp.h b/libisoburn/trunk/xorriso/xorriso_buildstamp.h new file mode 100644 index 00000000..f2d17a20 --- /dev/null +++ b/libisoburn/trunk/xorriso/xorriso_buildstamp.h @@ -0,0 +1,3 @@ +#ifndef Xorriso_build_timestamP +#define Xorriso_build_timestamP "-none-given-" +#endif diff --git a/libisoburn/trunk/xorriso/xorriso_buildstamp_none.h b/libisoburn/trunk/xorriso/xorriso_buildstamp_none.h new file mode 100644 index 00000000..f2d17a20 --- /dev/null +++ b/libisoburn/trunk/xorriso/xorriso_buildstamp_none.h @@ -0,0 +1,3 @@ +#ifndef Xorriso_build_timestamP +#define Xorriso_build_timestamP "-none-given-" +#endif diff --git a/libisoburn/trunk/xorriso/xorriso_makefile_am.txt b/libisoburn/trunk/xorriso/xorriso_makefile_am.txt index 7bc3c880..a3c824ce 100644 --- a/libisoburn/trunk/xorriso/xorriso_makefile_am.txt +++ b/libisoburn/trunk/xorriso/xorriso_makefile_am.txt @@ -28,6 +28,7 @@ xorriso_xorriso_SOURCES = \ xorriso/xorrisoburn.h \ xorriso/xorrisoburn.c \ xorriso/xorriso_timestamp.h \ + xorriso/xorriso_buildstamp.h \ \ libisoburn/libisoburn.h \ libisoburn/isoburn.h \ @@ -137,7 +138,6 @@ xorriso_xorriso_SOURCES = \ \ version.h - noinst_PROGRAMS = \ test/compare_file @@ -159,6 +159,26 @@ install-exec-hook: if test -e $(bindir)/osirrox ; then rm $(bindir)/osirrox ; else echo ; fi ln -s xorriso $(bindir)/osirrox + +# Trying to create a build timestamp file +# +buildstamp: + date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h + cat xorriso/xorriso_buildstamp.h + +# For now make buildstamped has to be performed manually. +buildstamped: buildstamp + make +# +# Processing of the "all:" rule happens too late. +# How to create a dependency of xorriso.c on buildstamp ? +# Not working: +# Add xorriso_buildstamp.h to xorriso_xorriso_SOURCES and make it depend +# on buildstamp. It runs. But at quite random occasions. +# xorriso/xorriso_buildstamp.h: buildstamp +# +# all: buildstamp + ## ========================================================================= ## # Indent source files diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index f33a066d..4a4abeb4 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.07.09.055133" +#define Xorriso_timestamP "2008.07.09.155540"