The git version could lead to cases where the version seems to be wrong, in
the case where no tags are pulled from upstream. So I decided to throw this
away. Bay the was the none posix sed command to convert project name to word
starting with upper case char, was replaces by a awk call.
endif
# generate a first char upper case project name
-PROJECT_UCFIRST = $(shell echo '${PROJECT}' | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/')
+PROJECT_UCFIRST = $(shell echo '${PROJECT}' | awk '{for(i=1;i<=NF;i++){$$i=toupper(substr($$i,1,1))substr($$i,2)}}1')
-# try to get a better version string from git
-GIT_VERSION = $(shell git describe --tags | tr -d '\n')
-FULL_VERSION = $(shell if [ "$(GIT_VERSION)" ]; then echo "$(GIT_VERSION)"; else echo "$(VERSION)"; fi)
-
-CPPFLAGS = -DVERSION=\"${VERSION}\" -DFULL_VERSION=\"${FULL_VERSION}\"
+CPPFLAGS = -DVERSION=\"${VERSION}\"
CPPFLAGS += -DPROJECT=\"${PROJECT}\" -DPROJECT_UCFIRST=\"${PROJECT_UCFIRST}\"
CPPFLAGS += -D_BSD_SOURCE -D_XOPEN_SOURCE=500
ifeq ($(USEGTK3), 1)
}
if (ver) {
- fprintf(stdout, "%s/%s\n", PROJECT, FULL_VERSION);
+ fprintf(stdout, "%s/%s\n", PROJECT, VERSION);
return EXIT_SUCCESS;
}
if (dump) {