From 16d65c96b035a10aa93a96e5a789ebef9ca3a76d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 27 Sep 2010 15:38:35 +0000 Subject: [libiwinfo] - fix compilation of WL backend - conditionally compile backends according to selected wifi drivers --- contrib/package/iwinfo/src/Makefile | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'contrib/package/iwinfo/src/Makefile') diff --git a/contrib/package/iwinfo/src/Makefile b/contrib/package/iwinfo/src/Makefile index 1d4319fb0..40b720ab9 100644 --- a/contrib/package/iwinfo/src/Makefile +++ b/contrib/package/iwinfo/src/Makefile @@ -1,8 +1,25 @@ -IWINFO_LDFLAGS = $(LDFLAGS) -shared -llua $(if $(CRAP),,-lnl-tiny) -IWINFO_CFLAGS = $(CFLAGS) -std=gnu99 -fstrict-aliasing $(if $(CRAP),-DUSE_WL,-DUSE_MADWIFI -DUSE_NL80211) +IWINFO_BACKENDS = $(if $(BACKENDS),$(BACKENDS),madwifi nl80211) +IWINFO_LDFLAGS = $(LDFLAGS) -shared -llua +IWINFO_CFLAGS = $(CFLAGS) -std=gnu99 -fstrict-aliasing IWINFO_SO = iwinfo.so -IWINFO_OBJ = $(if $(CRAP),iwinfo_wl.o,iwinfo_madwifi.o iwinfo_nl80211.o) \ - iwinfo_wext.o iwinfo_wext_scan.o iwinfo_lualib.o +IWINFO_OBJ = iwinfo_wext.o iwinfo_wext_scan.o iwinfo_lualib.o + +ifneq ($(filter wl,$(IWINFO_BACKENDS)),) + IWINFO_CFLAGS += -DUSE_WL + IWINFO_OBJ += iwinfo_wl.o +endif + +ifneq ($(filter madwifi,$(IWINFO_BACKENDS)),) + IWINFO_CFLAGS += -DUSE_MADWIFI + IWINFO_OBJ += iwinfo_madwifi.o +endif + +ifneq ($(filter nl80211,$(IWINFO_BACKENDS)),) + IWINFO_CFLAGS += -DUSE_NL80211 + IWINFO_LDFLAGS += -lnl-tiny + IWINFO_OBJ += iwinfo_nl80211.o +endif + %.o: %.c $(CC) $(IWINFO_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $< -- cgit v1.2.3