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.

This commit is contained in:
Mike Brady
2022-10-24 12:00:17 +01:00
2 changed files with 8 additions and 8 deletions
+1 -6
View File
@@ -28,15 +28,13 @@ scripts/shairport-sync.service
scripts/shairport-sync.service-avahi
scripts/shairport-sync
shairport-sync.core
gitversion.h
gitversion.*
plist_xml_strings.*
#Some dbus files that are automatically generated
/org.gnome.ShairportSync.service
/dbus-interface.*
/mpris-interface.*
/plist_xml_strings.*
/lib_*.*
# Some eclipse project files
@@ -47,9 +45,6 @@ plist_xml_strings.*
.DS_Store
shairport-sync.xcodeproj
# version string generation
gitversion.h
# separate build directory
build
+7 -2
View File
@@ -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