From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 24 Oct 2022 10:36:18 +0000 (+0100) Subject: Modify the Makefile.am entry for generating gitversion.h so that it works in a separa... X-Git-Tag: 4.1-rc4~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb0276bcaee494614b8b7b788625f4335b1084d;p=thirdparty%2Fshairport-sync.git Modify the Makefile.am entry for generating gitversion.h so that it works in a separate build directory and on FreeBSD as well as Linux. --- diff --git a/Makefile.am b/Makefile.am index bc1393d4..e1aa43f6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,14 +40,19 @@ endif # include information generated by 'git describe --tags --dirty' if requested if USE_GIT_VERSION -common.c: gitversion.h +shairport_sync_SOURCES += gitversion.c gitversion.h: .git/index printf "// Do not edit!\n" > gitversion.h printf "// This file is automatically generated by 'git describe --tags --dirty', if available.\n" >> gitversion.h printf " char git_version_string[] = \"" >> gitversion.h git describe --tags --dirty | tr -d '[[:space:]]' >> gitversion.h printf "\";\n" >> gitversion.h -CLEANFILES += gitversion.h +gitversion.c: gitversion.h + touch gitversion.c +BUILT_SOURCES += gitversion.c gitversion.h +noinst_HEADERS += $(BUILT_SOURCES) +# Correctly clean the generated headers, but keep the xml description +CLEANFILES += $(BUILT_SOURCES) endif if USE_APPLE_ALAC