2015-09-02 14:22:12 +00:00
|
|
|
CFLAGS += -std=c99 -D_BSD_SOURCE
|
2016-09-24 17:59:44 +00:00
|
|
|
CPPFLAGS += -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 LIBNL_CFLAGS) $(origin LIBNL_LDLIBS), undefined undefined)
|
|
|
|
LIBNL_NAME ?= libnl-tiny
|
|
|
|
ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBNL_NAME) 2>/dev/null),)
|
|
|
|
$(error No $(LIBNL_NAME) development libraries found!)
|
|
|
|
endif
|
|
|
|
LIBNL_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBNL_NAME))
|
|
|
|
LIBNL_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBNL_NAME))
|
|
|
|
endif
|
2015-09-02 14:22:12 +00:00
|
|
|
|
2016-02-02 05:38:03 +00:00
|
|
|
CFLAGS_JSONC = $(shell pkg-config --cflags json-c)
|
|
|
|
LDFLAGS_JSONC = $(shell pkg-config --libs json-c)
|
2015-09-01 20:49:26 +00:00
|
|
|
|
2017-12-18 16:48:16 +00:00
|
|
|
ifeq ($(origin LIBBATADV_CFLAGS) $(origin LIBBATADV_LDLIBS), undefined undefined)
|
|
|
|
LIBBATADV_NAME ?= libbatadv
|
|
|
|
ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBBATADV_NAME) 2>/dev/null),)
|
|
|
|
$(error No $(LIBBATADV_NAME) development libraries found!)
|
|
|
|
endif
|
|
|
|
LIBBATADV_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBBATADV_NAME))
|
|
|
|
LIBBATADV_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBBATADV_NAME))
|
|
|
|
endif
|
|
|
|
|
2018-02-26 01:05:07 +00:00
|
|
|
all: neighbours-batadv stations
|
2015-09-01 20:49:26 +00:00
|
|
|
|
2017-12-18 16:48:16 +00:00
|
|
|
neighbours-batadv: neighbours-batadv.c
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LIBNL_CFLAGS) $(LIBBATADV_CFLAGS) $(LDFLAGS) $(LDFLAGS_JSONC) $(LIBNL_LDLIBS) $(LIBBATADV_LDLIBS) -Wall -o $@ $^ $(LDLIBS)
|
2015-09-02 14:22:12 +00:00
|
|
|
|
|
|
|
stations: stations.c
|
2016-02-02 05:38:03 +00:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDFLAGS_JSONC) -Wall -o $@ $^ $(LDLIBS) -liwinfo
|