source: trunk/package/iwinfo/src/Makefile @ 29403

Last change on this file since 29403 was 29403, checked in by jow, 4 years ago

[package] add libiwinfo (moved from LuCI trunk)

File size: 1.3 KB
Line 
1IWINFO_BACKENDS    = $(BACKENDS)
2IWINFO_CFLAGS      = $(CFLAGS) -std=gnu99 -fstrict-aliasing -Iinclude
3
4IWINFO_LIB         = libiwinfo.so
5IWINFO_LIB_LDFLAGS = $(LDFLAGS) -shared
6IWINFO_LIB_OBJ     = iwinfo_utils.o iwinfo_wext.o iwinfo_wext_scan.o iwinfo_lib.o
7
8IWINFO_LUA         = iwinfo.so
9IWINFO_LUA_LDFLAGS = $(LDFLAGS) -shared -L. -liwinfo -llua
10IWINFO_LUA_OBJ     = iwinfo_lua.o
11
12IWINFO_CLI         = iwinfo
13IWINFO_CLI_LDFLAGS = $(LDFLAGS) -L. -liwinfo
14IWINFO_CLI_OBJ     = iwinfo_cli.o
15
16
17ifneq ($(filter wl,$(IWINFO_BACKENDS)),)
18        IWINFO_CFLAGS  += -DUSE_WL
19        IWINFO_LIB_OBJ += iwinfo_wl.o
20endif
21
22ifneq ($(filter madwifi,$(IWINFO_BACKENDS)),)
23        IWINFO_CFLAGS  += -DUSE_MADWIFI
24        IWINFO_LIB_OBJ += iwinfo_madwifi.o
25endif
26
27ifneq ($(filter nl80211,$(IWINFO_BACKENDS)),)
28        IWINFO_CFLAGS      += -DUSE_NL80211
29        IWINFO_CLI_LDFLAGS += -lnl-tiny
30        IWINFO_LIB_LDFLAGS += -lnl-tiny
31        IWINFO_LIB_OBJ     += iwinfo_nl80211.o
32endif
33
34
35%.o: %.c
36        $(CC) $(IWINFO_CFLAGS) $(FPIC) -c -o $@ $<
37
38compile: clean $(IWINFO_LIB_OBJ) $(IWINFO_LUA_OBJ) $(IWINFO_CLI_OBJ)
39        $(CC) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB) $(IWINFO_LIB_OBJ)
40        $(CC) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) $(IWINFO_LUA_OBJ)
41        $(CC) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) $(IWINFO_CLI_OBJ)
42
43clean:
44        rm -f *.o $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI)
Note: See TracBrowser for help on using the repository browser.