Makefile 784 B

123456789101112131415161718192021222324
  1. all: respondd.so
  2. CFLAGS += -Wall
  3. ifeq ($(origin PKG_CONFIG), undefined)
  4. PKG_CONFIG = pkg-config
  5. ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
  6. $(error $(PKG_CONFIG) not found)
  7. endif
  8. endif
  9. ifeq ($(origin LIBNL_CFLAGS) $(origin LIBNL_LDLIBS), undefined undefined)
  10. LIBNL_NAME ?= libnl-tiny
  11. ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBNL_NAME) 2>/dev/null),)
  12. $(error No $(LIBNL_NAME) development libraries found!)
  13. endif
  14. LIBNL_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBNL_NAME))
  15. LIBNL_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBNL_NAME))
  16. endif
  17. CFLAGS += $(LIBNL_CFLAGS)
  18. LDLIBS += $(LIBNL_LDLIBS)
  19. respondd.so: respondd.c batadv-netlink.c
  20. $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -D_GNU_SOURCE -o $@ $^ $(LDLIBS) -lgluonutil -liwinfo -luci