Introduced automatic buildstamp generation for dynamic library version
This commit is contained in:
parent
589f3c45f0
commit
4a7805e2cd
@ -32,6 +32,15 @@ libinclude_HEADERS = \
|
|||||||
bin_PROGRAMS = \
|
bin_PROGRAMS = \
|
||||||
xorriso/xorriso
|
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_CPPFLAGS = -Ilibisoburn
|
||||||
xorriso_xorriso_CFLAGS = -DXorriso_with_maiN -DXorriso_with_regeX $(READLINE_DEF)
|
xorriso_xorriso_CFLAGS = -DXorriso_with_maiN -DXorriso_with_regeX $(READLINE_DEF)
|
||||||
xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn $(THREAD_LIBS)
|
xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn $(THREAD_LIBS)
|
||||||
@ -56,7 +65,8 @@ install-exec-hook:
|
|||||||
ln -s xorriso $(bindir)/xorrecord
|
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:
|
buildstamp:
|
||||||
date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h
|
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.
|
# For now make buildstamped has to be performed explicitely.
|
||||||
buildstamped: buildstamp
|
buildstamped: buildstamp
|
||||||
make
|
make
|
||||||
#
|
|
||||||
# Processing of the "all:" rule happens too late.
|
# ^^^ Outperformed by the .PHONY above ^^^
|
||||||
# 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
|
## Build test applications
|
||||||
|
@ -76,9 +76,11 @@ libisofs="$libisofs $isofs"/util.o
|
|||||||
libisofs="$libisofs $isofs"/util_htable.o
|
libisofs="$libisofs $isofs"/util_htable.o
|
||||||
libisofs="$libisofs $isofs"/util_rbtree.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 "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"
|
echo "compiling program $xorr/xorriso.c $static_opts $debug_opts $def_opts"
|
||||||
cc -I. -DXorriso_with_maiN -DXorriso_with_regeX -DXorriso_with_readlinE \
|
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 \
|
$def_opts \
|
||||||
$largefile_opts \
|
$largefile_opts \
|
||||||
\
|
\
|
||||||
-DXorriso_build_timestamP='"'"$timestamp"'"' \
|
|
||||||
\
|
|
||||||
-o "$xorr"/xorriso \
|
-o "$xorr"/xorriso \
|
||||||
\
|
\
|
||||||
"$xorr"/xorriso.c \
|
"$xorr"/xorriso.c \
|
||||||
|
Loading…
Reference in New Issue
Block a user