]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - Makefile
use genl_ctrl_resolve()
[thirdparty/iw.git] / Makefile
index 520723cf77fd2a7819a2bd7bfb867ae509452646..fb463244c5961c71a65946083bbf6e4fa0c7d342 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
 MAKEFLAGS += --no-print-directory
 
 PREFIX ?= /usr
-BINDIR ?= $(PREFIX)/bin
+SBINDIR ?= $(PREFIX)/sbin
 MANDIR ?= $(PREFIX)/share/man
 PKG_CONFIG ?= pkg-config
 
@@ -14,11 +14,17 @@ CC ?= "gcc"
 CFLAGS ?= -O2 -g
 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
 
-OBJS = iw.o genl.o event.o info.o phy.o interface.o ibss.o station.o util.o mesh.o mpath.o scan.o reg.o version.o reason.o status.o connect.o
+OBJS = iw.o genl.o event.o info.o phy.o \
+       interface.o ibss.o station.o survey.o util.o \
+       mesh.o mpath.o scan.o reg.o version.o \
+       reason.o status.o connect.o link.o offch.o ps.o cqm.o \
+       bitrate.o wowlan.o roc.o
+OBJS += sections.o
 ALL = iw
 
 NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
 NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
+NL3FOUND := $(shell $(PKG_CONFIG) --atleast-version=3 libnl-3.0 && echo Y)
 
 ifeq ($(NL1FOUND),Y)
 NLLIBNAME = libnl-1
@@ -30,12 +36,19 @@ LIBS += -lnl-genl
 NLLIBNAME = libnl-2.0
 endif
 
+# libnl-3 has a separate libnl-genl-3.0.pc
+ifeq ($(NL3FOUND),Y)
+CFLAGS += -DCONFIG_LIBNL30
+LIBS =
+NLLIBNAME = libnl-genl-3.0
+endif
+
 ifeq ($(NLLIBNAME),)
 $(error Cannot find development files for any supported version of libnl)
 endif
 
-LIBS += $(shell pkg-config --libs $(NLLIBNAME))
-CFLAGS += $(shell pkg-config --cflags $(NLLIBNAME))
+LIBS += $(shell $(PKG_CONFIG) --libs $(NLLIBNAME))
+CFLAGS += $(shell $(PKG_CONFIG) --cflags $(NLLIBNAME))
 
 ifeq ($(V),1)
 Q=
@@ -48,6 +61,8 @@ endif
 all: version_check $(ALL)
 
 version_check:
+ifeq ($(NL3FOUND),Y)
+else
 ifeq ($(NL2FOUND),Y)
 else
 ifeq ($(NL1FOUND),Y)
@@ -55,6 +70,7 @@ else
        $(error No libnl found)
 endif
 endif
+endif
 
 
 VERSION_OBJS := $(filter-out version.o, $(OBJS))
@@ -81,11 +97,11 @@ check:
 
 install: iw iw.8.gz
        @$(NQ) ' INST iw'
-       $(Q)$(MKDIR) $(DESTDIR)$(BINDIR)
-       $(Q)$(INSTALL) -m 755 -t $(DESTDIR)$(BINDIR) iw
+       $(Q)$(MKDIR) $(DESTDIR)$(SBINDIR)
+       $(Q)$(INSTALL) -m 755 iw $(DESTDIR)$(SBINDIR)
        @$(NQ) ' INST iw.8'
        $(Q)$(MKDIR) $(DESTDIR)$(MANDIR)/man8/
-       $(Q)$(INSTALL) -m 644 -t $(DESTDIR)$(MANDIR)/man8/ iw.8.gz
+       $(Q)$(INSTALL) -m 644 iw.8.gz $(DESTDIR)$(MANDIR)/man8/
 
 clean:
        $(Q)rm -f iw *.o *~ *.gz version.c *-stamp