diff --git a/GNUmakefile.template b/GNUmakefile.template index 515fd68..2d96985 100644 --- a/GNUmakefile.template +++ b/GNUmakefile.template @@ -75,6 +75,10 @@ ${BUILDTMP}/%.o : %.c all: time-stamp dvdisaster +${BUILDTMP}/build.o : build.c build.h + @echo "Compiling:" build.o + @$(CC) $(COPTS) -c build.c -o $@ + # Building the dvdisaster binary time-stamp: diff --git a/configure b/configure index 8edb32a..b17164b 100755 --- a/configure +++ b/configure @@ -9,6 +9,9 @@ DEBUG_CFLAGS="-ggdb -Wall" if [ "$CLI_ONLY" = 1 ]; then REQUIRED_CFLAGS="-DCLI $REQUIRED_CFLAGS" + echo '#define FLAVOR CLI' > build.h +else + echo '#define FLAVOR GUI' > build.h fi CFG_USE_CYGWIN="no" # do not change diff --git a/scripts/time-stamper.bash b/scripts/time-stamper.bash index fd28794..66c22c9 100755 --- a/scripts/time-stamper.bash +++ b/scripts/time-stamper.bash @@ -1,7 +1,17 @@ #!/usr/bin/env bash - -build=$(grep BUILD $1 | cut -d\ -f3) +build=$(grep BUILDNUM $1 2>/dev/null | cut -d\ -f3) build=$((build+1)) -echo "#define BUILD $build" >$1 +flavor=$(grep FLAVOR $1 2>/dev/null | cut -d\ -f3) +if [ -z "$flavor" ]; then + flavor=UNKNOWN +fi +echo "#define FLAVOR $flavor" >$1 +echo "#define BUILDNUM $build" >>$1 +if git describe >/dev/null 2>/dev/null; then + gitver=$(git describe) + echo "#define BUILD \"$(git describe)-$flavor-speed47.build$build\"" >>$1 +else + echo "#define BUILD \"$flavor-speed47.build$build\"" >$1 +fi date=$(date +"%d.%m.%y (%A, %H:%M)") echo "#define BDATE \"$date\"" >>$1