2021-01-06 23:12:46 +01:00
|
|
|
IWINFO_SOVERSION = $(if $(SOVERSION),$(SOVERSION),0)
|
|
|
|
|
2014-10-05 19:56:27 +02:00
|
|
|
IWINFO_BACKENDS = $(BACKENDS)
|
2018-07-31 20:36:27 +02:00
|
|
|
IWINFO_CFLAGS = $(CFLAGS) -std=gnu99 -fstrict-aliasing -Iinclude
|
|
|
|
IWINFO_LDFLAGS = -luci -lubox -lubus
|
2014-10-05 19:56:27 +02:00
|
|
|
|
|
|
|
IWINFO_LIB = libiwinfo.so
|
2021-01-06 23:12:46 +01:00
|
|
|
IWINFO_LIB_LDFLAGS = $(LDFLAGS) -shared -Wl,-soname -Wl,$(IWINFO_LIB).$(IWINFO_SOVERSION)
|
2022-09-22 13:20:15 +02:00
|
|
|
IWINFO_LIB_OBJ = iwinfo_utils.o iwinfo_lib.o
|
2014-10-05 19:56:27 +02:00
|
|
|
|
|
|
|
IWINFO_LUA = iwinfo.so
|
|
|
|
IWINFO_LUA_LDFLAGS = $(LDFLAGS) -shared -L. -liwinfo -llua
|
|
|
|
IWINFO_LUA_OBJ = iwinfo_lua.o
|
|
|
|
|
|
|
|
IWINFO_CLI = iwinfo
|
|
|
|
IWINFO_CLI_LDFLAGS = $(LDFLAGS) -L. -liwinfo
|
|
|
|
IWINFO_CLI_OBJ = iwinfo_cli.o
|
|
|
|
|
|
|
|
|
2022-09-22 13:20:15 +02:00
|
|
|
ifneq ($(filter wl wext madwifi,$(IWINFO_BACKENDS)),)
|
|
|
|
IWINFO_CFLAGS += -DUSE_WEXT
|
|
|
|
IWINFO_LIB_OBJ += iwinfo_wext.o iwinfo_wext_scan.o
|
|
|
|
endif
|
|
|
|
|
2014-10-05 19:56:27 +02:00
|
|
|
ifneq ($(filter wl,$(IWINFO_BACKENDS)),)
|
|
|
|
IWINFO_CFLAGS += -DUSE_WL
|
|
|
|
IWINFO_LIB_OBJ += iwinfo_wl.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter madwifi,$(IWINFO_BACKENDS)),)
|
|
|
|
IWINFO_CFLAGS += -DUSE_MADWIFI
|
|
|
|
IWINFO_LIB_OBJ += iwinfo_madwifi.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(filter nl80211,$(IWINFO_BACKENDS)),)
|
|
|
|
IWINFO_CFLAGS += -DUSE_NL80211
|
|
|
|
IWINFO_CLI_LDFLAGS += -lnl-tiny
|
|
|
|
IWINFO_LIB_LDFLAGS += -lnl-tiny
|
|
|
|
IWINFO_LIB_OBJ += iwinfo_nl80211.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2021-01-06 23:12:46 +01:00
|
|
|
compile: clean $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI)
|
|
|
|
|
2014-10-05 19:56:27 +02:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(IWINFO_CFLAGS) $(FPIC) -c -o $@ $<
|
|
|
|
|
2021-01-06 23:12:46 +01:00
|
|
|
$(IWINFO_LIB): $(IWINFO_LIB_OBJ)
|
|
|
|
$(CC) $(IWINFO_LDFLAGS) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB).$(IWINFO_SOVERSION) $(IWINFO_LIB_OBJ) && \
|
|
|
|
ln -sf $(IWINFO_LIB).$(IWINFO_SOVERSION) $(IWINFO_LIB)
|
|
|
|
|
|
|
|
$(IWINFO_LUA): $(IWINFO_LUA_OBJ)
|
2014-10-05 12:26:05 +02:00
|
|
|
$(CC) $(IWINFO_LDFLAGS) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) $(IWINFO_LUA_OBJ)
|
2021-01-06 23:12:46 +01:00
|
|
|
|
|
|
|
$(IWINFO_CLI): $(IWINFO_CLI_OBJ)
|
2014-10-05 12:26:05 +02:00
|
|
|
$(CC) $(IWINFO_LDFLAGS) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) $(IWINFO_CLI_OBJ)
|
2014-10-05 19:56:27 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI)
|