From: Johannes Berg Date: Wed, 2 Apr 2008 15:40:05 +0000 (+0200) Subject: try to run cgcc (sparse) if possible X-Git-Tag: v0.9~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=82afaeb7659ddac96679107bd08e7fc33951f002;p=thirdparty%2Fiw.git try to run cgcc (sparse) if possible --- diff --git a/Makefile b/Makefile index 12643ba..edda026 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ -include .config +MAKEFLAGS += --no-print-directory + CC ?= "gcc" CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration CFLAGS += -I/lib/modules/`uname -r`/build/include @@ -8,14 +10,24 @@ LDFLAGS += -lnl OBJS = iw.o interface.o info.o station.o util.o mpath.o ALL = iw +ifneq ($(shell which cgcc),"") +DEF := check +else +DEF := all +endif + +default: $(DEF) all: verify_config $(ALL) iw: $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o iw $(LDFLAGS) +check: + @$(MAKE) all CC="REAL_CC=$(CC) CHECK=\"sparse -Wall\" cgcc" + clean: - rm -f iw *.o *~ + @rm -f iw *.o *~ verify_config: @if [ ! -r .config ]; then \