gluon/package/gluon-mesh-babel/src/Makefile
Christof Schulze 1db3c8b40b gluon-mesh-babel: respondd: reduce load
* open babel socket in its own event loop, allowing to monitor instead of dump
* keep state from monitor in json object, providing that to clients on
  network on demand
* do not parse babel routes, instead use netlink to obtain nexthop

babeld still does not support limiting the data on the socket by object. When
that is merged, the load can be further reduced by limiting to neighbour
changes with a small change.
2020-01-20 22:18:25 +01:00

32 lines
1.1 KiB
Makefile

all: respondd.so neighbours-babel
CFLAGS += -Wall -g -fPIC -D_GNU_SOURCE
ifeq ($(origin PKG_CONFIG), undefined)
PKG_CONFIG = pkg-config
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
$(error $(PKG_CONFIG) not found)
endif
endif
ifeq ($(origin LIBBABEL_CFLAGS) $(origin LIBBABEL_LDLIBS), undefined undefined)
LIBBABEL_NAME ?= libbabelhelper
ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBBABEL_NAME) 2>/dev/null),)
$(error No $(LIBBABEL_NAME) development libraries found!)
endif
LIBBABEL_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBBABEL_NAME))
LIBBABEL_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBBABEL_NAME))
endif
CFLAGS += $(LIBBABEL_CFLAGS)
LDLIBS += $(LIBBABEL_LDLIBS)
CFLAGS_JSONC = $(shell pkg-config --cflags json-c)
LDFLAGS_JSONC = $(shell pkg-config --libs json-c)
respondd.so: respondd.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -shared $(LDFLAGS_JSONC) -o $@ $^ -lgluonutil -lblobmsg_json -lubox -lubus -luci
neighbours-babel: neighbours-babel.c handle_neighbour.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDLIBS) $(LDFLAGS_JSONC) -o $@ $^