]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - Makefile
iw: print ctrl port tx status event
[thirdparty/iw.git] / Makefile
index 9bcfa8a0ee2136029322b041d32cb9903f7b11db..8bd5457279df4332b8a392492bb1cb0f611e974c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,9 +14,10 @@ cc-option = $(shell set -e ; $(CC) $(1) -c -x c /dev/null -o /dev/null >/dev/nul
 CFLAGS_EVAL := $(call cc-option,-Wstringop-overflow=4)
 
 CFLAGS ?= -O2 -g
-CFLAGS += -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common \
-         -Werror-implicit-function-declaration -Wsign-compare -Wno-unused-parameter \
-         $(CFLAGS_EVAL)
+CFLAGS += -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
+CFLAGS += -Werror-implicit-function-declaration -Wsign-compare -Wno-unused-parameter
+CFLAGS += -Wdeclaration-after-statement
+CFLAGS += $(CFLAGS_EVAL)
 
 _OBJS := $(sort $(patsubst %.c,%.o,$(wildcard *.c)))
 VERSION_OBJS := $(filter-out version.o, $(_OBJS))
@@ -94,7 +95,11 @@ version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) nl80211.h iw.h Makefil
        @$(NQ) ' GEN ' $@
        $(Q)./version.sh $@
 
-%.o: %.c iw.h nl80211.h
+nl80211-commands.inc: nl80211.h
+       @$(NQ) ' GEN ' $@
+       $(Q)sed 's%^\tNL80211_CMD_%%;t n;d;:n s%^\([^=]*\),.*%\t[NL80211_CMD_\1] = \"\L\1\",%;t;d' nl80211.h | grep -v "reserved" > $@
+
+%.o: %.c iw.h nl80211.h nl80211-commands.inc
        @$(NQ) ' CC  ' $@
        $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
@@ -120,4 +125,4 @@ install: iw iw.8.gz
        $(Q)$(INSTALL) -m 644 iw.8.gz $(DESTDIR)$(MANDIR)/man8/
 
 clean:
-       $(Q)rm -f iw *.o *~ *.gz version.c *-stamp
+       $(Q)rm -f iw *.o *~ *.gz version.c *-stamp nl80211-commands.inc