]> git.ipfire.org Git - thirdparty/iw.git/blob - Makefile
try to run cgcc (sparse) if possible
[thirdparty/iw.git] / Makefile
1 -include .config
2
3 MAKEFLAGS += --no-print-directory
4
5 CC ?= "gcc"
6 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
7 CFLAGS += -I/lib/modules/`uname -r`/build/include
8 CFLAGS += -O2 -g
9 LDFLAGS += -lnl
10
11 OBJS = iw.o interface.o info.o station.o util.o mpath.o
12 ALL = iw
13 ifneq ($(shell which cgcc),"")
14 DEF := check
15 else
16 DEF := all
17 endif
18
19 default: $(DEF)
20
21 all: verify_config $(ALL)
22
23 iw: $(OBJS)
24 $(CC) $(CFLAGS) $(OBJS) -o iw $(LDFLAGS)
25
26 check:
27 @$(MAKE) all CC="REAL_CC=$(CC) CHECK=\"sparse -Wall\" cgcc"
28
29 clean:
30 @rm -f iw *.o *~
31
32 verify_config:
33 @if [ ! -r .config ]; then \
34 echo 'Building iw requires a configuration file'; \
35 echo '(.config). cp defconfig .config and edit.'; \
36 exit 1; \
37 fi