nl80211: fix possible fd leak in nl80211_hostapd_hup()
[project/iwinfo.git] / Makefile
1 IWINFO_BACKENDS    = $(BACKENDS)
2 IWINFO_CFLAGS      = $(CFLAGS) -std=gnu99 -fstrict-aliasing -Iinclude
3 IWINFO_LDFLAGS     = -luci
4
5 IWINFO_LIB         = libiwinfo.so
6 IWINFO_LIB_LDFLAGS = $(LDFLAGS) -shared
7 IWINFO_LIB_OBJ     = iwinfo_utils.o iwinfo_wext.o iwinfo_wext_scan.o iwinfo_lib.o
8
9 IWINFO_LUA         = iwinfo.so
10 IWINFO_LUA_LDFLAGS = $(LDFLAGS) -shared -L. -liwinfo -llua
11 IWINFO_LUA_OBJ     = iwinfo_lua.o
12
13 IWINFO_CLI         = iwinfo
14 IWINFO_CLI_LDFLAGS = $(LDFLAGS) -L. -liwinfo
15 IWINFO_CLI_OBJ     = iwinfo_cli.o
16
17
18 ifneq ($(filter wl,$(IWINFO_BACKENDS)),)
19         IWINFO_CFLAGS  += -DUSE_WL
20         IWINFO_LIB_OBJ += iwinfo_wl.o
21 endif
22
23 ifneq ($(filter madwifi,$(IWINFO_BACKENDS)),)
24         IWINFO_CFLAGS  += -DUSE_MADWIFI
25         IWINFO_LIB_OBJ += iwinfo_madwifi.o
26 endif
27
28 ifneq ($(filter nl80211,$(IWINFO_BACKENDS)),)
29         IWINFO_CFLAGS      += -DUSE_NL80211
30         IWINFO_CLI_LDFLAGS += -lnl-tiny
31         IWINFO_LIB_LDFLAGS += -lnl-tiny
32         IWINFO_LIB_OBJ     += iwinfo_nl80211.o
33 endif
34
35
36 %.o: %.c
37         $(CC) $(IWINFO_CFLAGS) $(FPIC) -c -o $@ $<
38
39 compile: clean $(IWINFO_LIB_OBJ) $(IWINFO_LUA_OBJ) $(IWINFO_CLI_OBJ)
40         $(CC) $(IWINFO_LDFLAGS) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB) $(IWINFO_LIB_OBJ)
41         $(CC) $(IWINFO_LDFLAGS) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) $(IWINFO_LUA_OBJ)
42         $(CC) $(IWINFO_LDFLAGS) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) $(IWINFO_CLI_OBJ)
43
44 clean:
45         rm -f *.o $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI)