Skip to content

Commit 2f087c2

Browse files
committed
make - fallback to simpler git describe if able
1 parent fd27ce5 commit 2f087c2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,11 @@ info:
456456
$(info pkgconfigdir = $(value pkgconfigdir))
457457
$(info )
458458
$(info -----------------------------------------)
459+
$(info )
460+
$(info Git:)
461+
$(info describe = $(GIT_DESCRIBE))
462+
$(info )
463+
$(info -----------------------------------------)
459464
@true
460465

461466
info-backends:
@@ -850,10 +855,11 @@ $(OBJDIR)/ceed.pc : pkgconfig-prefix = $(prefix)
850855
-e "s:%prefix%:$(pkgconfig-prefix):" \
851856
-e "s:%libs_private%:$(pkgconfig-libs-private):" $< > $@
852857

853-
GIT_DESCRIBE = $(shell git describe --dirty || printf "unknown\n")
858+
GIT_DESCRIBE = $(shell git describe --always --dirty 2>/dev/null || printf "unknown\n")
854859

855860
$(OBJDIR)/interface/ceed-config.c: Makefile
856861
@$(file >$@,#include <ceed-impl.h>) \
862+
$(file >>$@,) \
857863
$(file >>$@,int CeedGetGitVersion(const char **git_version) {) \
858864
$(file >>$@, *git_version = "$(GIT_DESCRIBE)";) \
859865
$(file >>$@, return 0;) \

tests/t010-config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main(int argc, char **argv) {
88
const char *git_version, *build_config;
99
CeedGetGitVersion(&git_version);
1010
CeedGetBuildConfiguration(&build_config);
11-
// printf("Git: %s\n", git_version);
12-
// puts(build_config);
11+
//printf("Git: %s\n", git_version);
12+
//puts(build_config);
1313
return 0;
1414
}

0 commit comments

Comments
 (0)