diff --git a/server/Makefile b/server/Makefile index ecd198e1a..d1bb2637b 100644 --- a/server/Makefile +++ b/server/Makefile @@ -1,18 +1,8 @@ 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 = socket.o if.o utils.o msg.o node.o cfg.o tc.o hooks.o -# Dependencies for individual binaries -server: $(COMMON) path.o hist.o -send: $(COMMON) -receive: $(COMMON) -random: utils.o msg.o -test: $(COMMON) hist.o - VPATH = src # Default debug level @@ -21,7 +11,7 @@ V ?= 2 # Some details about the compiled version # Compiler and linker flags -LDFLAGS = -pthread -lrt -lm -lconfig +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)"' @@ -33,8 +23,28 @@ else CFLAGS += -O3 endif +# Enable OPAL-RT Asynchronous Process support +#OPALDIR = /usr/opalrt/common +OPALDIR = ../opal +ifneq (,$(wildcard $(OPALDIR)/include_target/AsyncApi.h)) + CFLAGS += -m32 -DENABLE_OPAL_ASYNC -I$(OPALDIR)/include_target + LDFLAGS += -m32 + LDLIBS += $(addprefix $(OPALDIR)/lib/redhawk/, libOpalAsyncApiCore.a libOpalCore.a libOpalUtils.a libirc.a) + COMMON += opal.o +endif + .PHONY: all clean +# Default target: build everything +all: $(TARGETS) + +# Specific dependencies +server: $(COMMON) server.o path.o hist.o +send: $(COMMON) send.o +receive: $(COMMON) receive.o +random: random.o utils.o msg.o +test: $(COMMON) hist.o + clean: $(RM) *~ *.o *.d $(RM) $(TARGETS)