]> git.ipfire.org Git - thirdparty/nqptp.git/commitdiff
Use .git/index's modification date as a dependency to generate gitversion
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 14 May 2021 16:25:31 +0000 (17:25 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 14 May 2021 16:25:31 +0000 (17:25 +0100)
Makefile.am

index e7dd8349a0883b4539b4aa0691e239998e793983..9bcaa3e2588da586b36e452f3d08b7b7ce08d6d4 100644 (file)
@@ -2,18 +2,21 @@ bin_PROGRAMS = nqptp
 nqptp_SOURCES = nqptp.c nqptp-clock-sources.c nqptp-message-handlers.c nqptp-utilities.c general-utilities.c debug.c
 
 AM_CFLAGS = -fno-common -Wno-multichar -Wall -Wextra -Wno-clobbered -Wno-psabi -pthread
+CLEANFILES =
 
 if USE_GIT
 nqptp.c: gitversion.h
-gitversion.h: FORCE
+gitversion.h: .git/index
        echo "// Do not edit!" > gitversion.h
        echo "// This file is automatically generated by 'git describe --dirty', if available." >> gitversion.h
        echo -n "  char git_version_string[] = \"" >> gitversion.h
        git describe --dirty | tr -d '[[:space:]]' >> gitversion.h
        echo "\";" >> gitversion.h
 FORCE: ;
+CLEANFILES += gitversion.h
 endif
 
+
 install-exec-hook:
        -e /lib/systemd/system || mkdir -p /lib/systemd/system
        -f /lib/systemd/system/nqptp.service || cp nqptp.service /lib/systemd/system