1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

added support for pkg-config to Makefile

This commit is contained in:
Steffen Vogel 2015-09-21 17:11:23 +02:00
parent d1dbc8e915
commit 47be437292

View file

@ -4,8 +4,6 @@ TARGETS = server send random receive test
OBJS = path.o node.o hooks.o msg.o cfg.o stats.o
# Helper libs
OBJS += utils.o list.o hist.o log.o timing.o checks.o
# Node types
OBJS += file.o
VPATH = src
@ -32,23 +30,38 @@ ifneq (,$(shell which git))
override CFLAGS += -D_GIT_REV='"$(shell git rev-parse --short HEAD)"'
endif
######## Node types ########
# Enable file node type support
ifndef DISABLE_FILE
override CFLAGS += -DENABLE_FILE
OBJS += ngsi.o
endif
# Enable Socket node type when libnl3 is available
ifneq (,$(wildcard $(NLDIR)/netlink/netlink.h))
override CFLAGS += -DENABLE_SOCKET -I$(NLDIR)
ifeq ($(shell pkg-config libnl-3.0; echo $$?),0)
override CFLAGS += -DENABLE_SOCKET $(shell pkg-config --cflags libnl-3.0)
LDLIBS += -lnl-3 -lnl-route-3
OBJS += nl.o tc.o if.o socket.o
endif
# Enable GTFPGA support when libpci is available
ifneq (,$(wildcard $(PCIDIR)/pci/pci.h))
override CFLAGS += -DENABLE_GTFPGA -I$(PCIDIR)
LDLIBS += -lpci
ifeq ($(shell pkg-config libpci; echo $$?),0)
override CFLAGS += -DENABLE_GTFPGA $(shell pkg-config --cflags libpci)
LDLIBS += $(shell pkg-config --libs libpci)
OBJS += gtfpga.o
endif
# Enable NGSI support
ifeq ($(shell pkg-config libcurl jansson uuid; echo $$?),0)
override CFLAGS += -DENABLE_NGSI $(shell pkg-config --cflags libcurl jansson uuid)
LDLIBS += $(shell pkg-config --libs libcurl jansson uuid)
OBJS += ngsi.o
endif
# Enable OPAL-RT Asynchronous Process support (will result in 32bit binary!!!)
ifneq (,$(wildcard $(OPALDIR)/include_target/AsyncApi.h))
override CFLAGS += -m32 -DENABLE_OPAL_ASYNC -I$(OPALDIR)/include_target
override CFLAGS += -m32 -DENABLE_OPAL_ASYNC
LDFLAGS += -m32 -Wl,-L/lib/i386-linux-gnu/,-L/usr/lib/i386-linux-gnu/
LDLIBS += $(addprefix $(OPALDIR)/lib/redhawk/, libOpalAsyncApiCore.a libOpalCore.a libOpalUtils.a libirc.a)
OBJS += opal.o