2018-11-17 18:45:18 +00:00
|
|
|
all: respondd.so neighbours-babel
|
2018-05-16 14:58:24 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
2018-11-17 18:45:18 +00:00
|
|
|
respondd.so: respondd.c handle_neighbour.c
|
2019-11-23 20:32:15 +00:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -shared $(LDFLAGS_JSONC) -o $@ $^ -lgluonutil -lblobmsg_json -lubox -lubus -luci
|
2018-05-16 14:58:24 +00:00
|
|
|
|
|
|
|
neighbours-babel: neighbours-babel.c handle_neighbour.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDLIBS) $(LDFLAGS_JSONC) -o $@ $^
|