1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

lib: add a version string

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2017-01-18 22:17:02 -05:00
parent 50417e961f
commit 38fffa8e27
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#ifndef CRUCIBLE_VERSION_H
#define CRUCIBLE_VERSION_H
namespace crucible {
extern const char *VERSION;
}
#endif CRUCIBLE_VERSION_H

1
lib/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.version.*

View File

@ -13,6 +13,7 @@ OBJS = \
string.o \ string.o \
time.o \ time.o \
uuid.o \ uuid.o \
.version.o \
include ../makeflags include ../makeflags
@ -21,6 +22,10 @@ depends.mk: *.c *.cc
for x in *.cc; do $(CXX) $(CXXFLAGS) -M "$$x"; done >> depends.mk.new for x in *.cc; do $(CXX) $(CXXFLAGS) -M "$$x"; done >> depends.mk.new
mv -fv depends.mk.new depends.mk mv -fv depends.mk.new depends.mk
.version.cc: Makefile ../makeflags *.c *.cc ../include/crucible/*.h
echo "namespace crucible { const char *VERSION = \"$(shell git describe --always --dirty || echo UNKNOWN)\"; }" > .version.new.cc
mv -f .version.new.cc .version.cc
-include depends.mk -include depends.mk
%.o: %.c %.o: %.c