diff --git a/Makefile b/Makefile index c6e0e84..4994d0c 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,11 @@ +BASE_VERSION=0.1.0 +VERSION="\"$(BASE_VERSION)-$(shell git rev-parse --short HEAD)\"" + MAGIC_CFLAGS=-DHAVE_MAGIC MAGIC_LIBS=-lmagic CC=gcc -CFLAGS+=-Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=20120607L -D_FILE_OFFSET_BITS=64 $(MAGIC_CFLAGS) +CFLAGS+=-Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=20120607L -D_FILE_OFFSET_BITS=64 -DVERSION=$(VERSION) $(MAGIC_CFLAGS) LIBS=-lmicrohttpd $(MAGIC_LIBS) TARGET=fileshare diff --git a/main.c b/main.c index c223826..9b9d229 100644 --- a/main.c +++ b/main.c @@ -386,13 +386,16 @@ int main(int argc, char ** argv) { logger_init(); + LOG(LVL_INFO, "Welcome to fileshare " VERSION); + #ifndef DEBUG // don't show debug output in release build logger_set_verbosity(LVL_INFO); #endif if (argc < 2) { - printf("%s