diff --git a/.gitignore b/.gitignore index e3de72a2d..898d99781 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -bin/* -build/* -dep/* doc/html/ doc/latex/ @@ -8,3 +5,6 @@ doc/latex/ *.d *.o *~ + +server +test diff --git a/Makefile b/Makefile index 9c1edd569..ae986bf25 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,12 @@ VPATH = src CC = gcc RM = rm -f +GIT_TAG = $(shell git describe --tags) +GIT_REV = $(shell git rev-parse --short HEAD) LDFLAGS = -pthread -lrt CFLAGS = -std=c99 -Iinclude/ -D_XOPEN_SOURCE=500 +CFLAGS += -D__GIT_REV__='"$(GIT_REV)"' -D__GIT_TAG__='"$(GIT_TAG)"' ifdef (DEBUG) CFLAGS += -DDEBUG=$(DEBUG) -g diff --git a/include/config.h b/include/config.h index 9a74d476d..fb49e25e8 100644 --- a/include/config.h +++ b/include/config.h @@ -9,7 +9,7 @@ #define _CONFIG_H_ /// The version number of the s2ss server -#define VERSION "0.01" +#define VERSION __GIT_TAG__ "-" __GIT_REV__ /// The Procotol version determines the format of a struct msg #define PROTOCOL 0 /// The name of this node diff --git a/src/main.c b/src/server.c similarity index 81% rename from src/main.c rename to src/server.c index ed99428a5..b5686c87b 100644 --- a/src/main.c +++ b/src/server.c @@ -64,15 +64,19 @@ int main(int argc, char *argv[]) { atexit(&quit); + assert(0); + if (argc != 1) { printf("Usage: s2ss [config]\n"); printf(" config is an optional path to a configuration file\n\n"); - printf("s2ss Simulator2Simulator Server v%s\n", VERSION); - printf("Copyright 2014, Institute for Automation of Complex Power Systems, EONERC\n"); + printf("Simulator2Simulator Server %s\n", VERSION); + printf(" Build: %s %s\n", __DATE__, __TIME__); + printf(" Contact: Steffen Vogel