]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
try to run cgcc (sparse) if possible
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 2 Apr 2008 15:40:05 +0000 (17:40 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Wed, 2 Apr 2008 15:40:05 +0000 (17:40 +0200)
Makefile

index 12643ba224f63be7b5a6e73b5f46c292ff9025c3..edda026e90bfd9fbde372a4215dc3d57a4bba66e 100644 (file)
--- 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 \