Introduced automatic buildstamp generation for dynamic library version

This commit is contained in:
Thomas Schmitt 2008-07-19 11:30:08 +00:00
parent 589f3c45f0
commit 4a7805e2cd
2 changed files with 17 additions and 14 deletions

View File

@ -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

View File

@ -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 \