diff --git a/server/Makefile b/server/Makefile index ecd198e1a..b4607380b 100644 --- a/server/Makefile +++ b/server/Makefile @@ -1,9 +1,9 @@ TARGETS = server send random receive test -SRCS = server.c send.c receive.c random.c node.c path.c utils.c socket.c msg.c cfg.c if.c tc.c hist.c # Default target: build everything all: $(TARGETS) +# Common dependencies for all binaries COMMON = socket.o if.o utils.o msg.o node.o cfg.o tc.o hooks.o # Dependencies for individual binaries @@ -13,13 +13,12 @@ receive: $(COMMON) random: utils.o msg.o test: $(COMMON) hist.o +# Search path for source files VPATH = src # Default debug level V ?= 2 -# Some details about the compiled version - # Compiler and linker flags LDFLAGS = -pthread -lrt -lm -lconfig CFLAGS = -std=c99 -Iinclude/ -MMD -Wall @@ -28,7 +27,7 @@ CFLAGS += -D__GIT_REV__='"-$(shell git rev-parse --short HEAD)"' # Conditional flags ifdef DEBUG - CFLAGS += -g + CFLAGS += -O0 -g else CFLAGS += -O3 endif diff --git a/server/src/server.c b/server/src/server.c index 2eb7962e7..e6235f24e 100644 --- a/server/src/server.c +++ b/server/src/server.c @@ -111,13 +111,13 @@ void usage(const char *name) int main(int argc, char *argv[]) { - epoch_reset(); - info("This is Simulator2Simulator Server (S2SS) %s (built on %s, %s)", - BLD(YEL(VERSION)), BLD(MAG(__DATE__)), BLD(MAG(__TIME__))); - /* Check arguments */ if (argc != 2) usage(argv[0]); + + epoch_reset(); + info("This is Simulator2Simulator Server (S2SS) %s (built on %s, %s)", + BLD(YEL(VERSION)), BLD(MAG(__DATE__)), BLD(MAG(__TIME__))); /* Check priviledges */ if (getuid() != 0)