From 4a7805e2cd0b7a1568f4a85ced73e67df90a5ba0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 19 Jul 2008 11:30:08 +0000 Subject: [PATCH] Introduced automatic buildstamp generation for dynamic library version --- libisoburn/trunk/Makefile.am | 23 ++++++++++++--------- libisoburn/trunk/xorriso/compile_xorriso.sh | 8 +++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/libisoburn/trunk/Makefile.am b/libisoburn/trunk/Makefile.am index b386987f..7fd4c566 100644 --- a/libisoburn/trunk/Makefile.am +++ b/libisoburn/trunk/Makefile.am @@ -32,6 +32,15 @@ libinclude_HEADERS = \ bin_PROGRAMS = \ xorriso/xorriso +# Trying to create a build timestamp file +# +BUILT_SOURCES = xorriso/xorriso_buildstamp.h +# phony targets get rebuilt every time +.PHONY: xorriso/xorriso_buildstamp.h +xorriso/xorriso_buildstamp.h: + date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h + cat xorriso/xorriso_buildstamp.h + xorriso_xorriso_CPPFLAGS = -Ilibisoburn xorriso_xorriso_CFLAGS = -DXorriso_with_maiN -DXorriso_with_regeX $(READLINE_DEF) xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn $(THREAD_LIBS) @@ -56,7 +65,8 @@ install-exec-hook: ln -s xorriso $(bindir)/xorrecord -# Trying to create a build timestamp file +# Outperformed by the .PHONY above. But still in for a few release cycles. +# Trying to create a build timestamp file semi-manually # buildstamp: date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h @@ -65,15 +75,8 @@ buildstamp: # 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 + +# ^^^ Outperformed by the .PHONY above ^^^ ## Build test applications diff --git a/libisoburn/trunk/xorriso/compile_xorriso.sh b/libisoburn/trunk/xorriso/compile_xorriso.sh index 85732da9..f3a39464 100755 --- a/libisoburn/trunk/xorriso/compile_xorriso.sh +++ b/libisoburn/trunk/xorriso/compile_xorriso.sh @@ -76,9 +76,11 @@ libisofs="$libisofs $isofs"/util.o libisofs="$libisofs $isofs"/util_htable.o libisofs="$libisofs $isofs"/util_rbtree.o -timestamp="$(date -u '+%Y.%m.%d.%H%M%S')" + echo "Version timestamp : $(sed -e 's/#define Xorriso_timestamP "//' -e 's/"$//' "$xorr"/xorriso_timestamp.h)" -echo "Build timestamp : $timestamp" + +date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >"$xorr"/xorriso_buildstamp.h +echo "Build timestamp : $(sed -e 's/#define Xorriso_build_timestamP "//' -e 's/"$//' "$xorr"/xorriso_buildstamp.h)" echo "compiling program $xorr/xorriso.c $static_opts $debug_opts $def_opts" cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \ @@ -88,8 +90,6 @@ cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \ $def_opts \ $largefile_opts \ \ - -DXorriso_build_timestamP='"'"$timestamp"'"' \ - \ -o "$xorr"/xorriso \ \ "$xorr"/xorriso.c \