mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fixed version string macro when git is not installed
This commit is contained in:
parent
d25ad21d86
commit
39f1dff626
3 changed files with 15 additions and 4 deletions
|
@ -12,9 +12,11 @@ V ?= 2
|
|||
LDLIBS = -pthread -lrt -lm -lconfig
|
||||
CFLAGS = -std=c99 -Iinclude/ -MMD -Wall
|
||||
CFLAGS += -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -DV=$(V)
|
||||
CFLAGS += -D__GIT_REV__='"-$(shell git rev-parse --short HEAD)"'
|
||||
|
||||
# Conditional flags
|
||||
# Add git commit hash
|
||||
ifneq (,$(shell which git))
|
||||
CFLAGS += -D_GIT_REV='"$(shell git rev-parse --short HEAD)"'
|
||||
endif
|
||||
ifdef DEBUG
|
||||
CFLAGS += -O0 -g
|
||||
else
|
||||
|
|
|
@ -11,9 +11,12 @@
|
|||
#ifndef _CONFIG_H_
|
||||
#define _CONFIG_H_
|
||||
|
||||
/** The version number of the s2ss server */
|
||||
#ifndef _GIT_REV
|
||||
#define _GIT_REV "nogit"
|
||||
#endif
|
||||
|
||||
#define VERSION "v0.4" __GIT_REV__
|
||||
/** The version number of the s2ss server */
|
||||
#define VERSION "v0.4-" _GIT_REV
|
||||
|
||||
/** Maximum number of double values in a struct msg */
|
||||
#define MAX_VALUES 64
|
||||
|
|
|
@ -55,8 +55,14 @@
|
|||
#define LEFT(n) ""
|
||||
#endif
|
||||
|
||||
/* CPP stringification */
|
||||
#define XSTR(x) STR(x)
|
||||
#define STR(x) #x
|
||||
|
||||
/** Calculate the number of elements in an array. */
|
||||
#define ARRAY_LEN(a) ( sizeof (a) / sizeof (a)[0] )
|
||||
|
||||
/** Swap two values by using a local third one. */
|
||||
#define SWAP(a, b) do { \
|
||||
__typeof__(a) tmp = a; \
|
||||
a = b; \
|
||||
|
|
Loading…
Add table
Reference in a new issue