1##### CLEAR VARS 2 3DRV_CFLAGS = 4DRV_WPA_CFLAGS = 5DRV_AP_CFLAGS = 6DRV_OBJS = 7DRV_WPA_OBJS = 8DRV_AP_OBJS = 9DRV_LIBS = 10DRV_WPA_LIBS = 11DRV_AP_LIBS = 12 13##### COMMON DRIVERS 14 15ifdef CONFIG_DRIVER_WIRED 16DRV_CFLAGS += -DCONFIG_DRIVER_WIRED 17DRV_OBJS += ../src/drivers/driver_wired.o 18NEED_DRV_WIRED_COMMON=1 19endif 20 21ifdef CONFIG_DRIVER_MACSEC_LINUX 22DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_LINUX 23DRV_OBJS += ../src/drivers/driver_macsec_linux.o 24NEED_DRV_WIRED_COMMON=1 25NEED_LIBNL=y 26CONFIG_LIBNL3_ROUTE=y 27endif 28 29ifdef CONFIG_DRIVER_MACSEC_QCA 30DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_QCA 31DRV_OBJS += ../src/drivers/driver_macsec_qca.o 32NEED_DRV_WIRED_COMMON=1 33endif 34 35ifdef NEED_DRV_WIRED_COMMON 36DRV_OBJS += ../src/drivers/driver_wired_common.o 37endif 38 39ifdef CONFIG_DRIVER_NL80211 40DRV_CFLAGS += -DCONFIG_DRIVER_NL80211 41DRV_OBJS += ../src/drivers/driver_nl80211.o 42DRV_OBJS += ../src/drivers/driver_nl80211_capa.o 43DRV_OBJS += ../src/drivers/driver_nl80211_event.o 44DRV_OBJS += ../src/drivers/driver_nl80211_monitor.o 45DRV_OBJS += ../src/drivers/driver_nl80211_scan.o 46ifdef CONFIG_DRIVER_NL80211_QCA 47DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_QCA 48endif 49NEED_SME=y 50NEED_AP_MLME=y 51NEED_NETLINK=y 52NEED_LINUX_IOCTL=y 53NEED_RFKILL=y 54NEED_RADIOTAP=y 55NEED_LIBNL=y 56endif 57 58ifdef CONFIG_DRIVER_BSD 59ifndef CONFIG_L2_PACKET 60CONFIG_L2_PACKET=freebsd 61endif 62DRV_CFLAGS += -DCONFIG_DRIVER_BSD 63DRV_OBJS += ../src/drivers/driver_bsd.o 64CONFIG_L2_FREEBSD=y 65CONFIG_DNET_PCAP=y 66endif 67 68ifdef CONFIG_DRIVER_OPENBSD 69ifndef CONFIG_L2_PACKET 70CONFIG_L2_PACKET=freebsd 71endif 72DRV_CFLAGS += -DCONFIG_DRIVER_OPENBSD 73DRV_OBJS += ../src/drivers/driver_openbsd.o 74endif 75 76ifdef CONFIG_DRIVER_NONE 77DRV_CFLAGS += -DCONFIG_DRIVER_NONE 78DRV_OBJS += ../src/drivers/driver_none.o 79endif 80 81##### PURE AP DRIVERS 82 83ifdef CONFIG_DRIVER_HOSTAP 84DRV_AP_CFLAGS += -DCONFIG_DRIVER_HOSTAP 85DRV_AP_OBJS += ../src/drivers/driver_hostap.o 86CONFIG_WIRELESS_EXTENSION=y 87NEED_AP_MLME=y 88NEED_NETLINK=y 89NEED_LINUX_IOCTL=y 90endif 91 92ifdef CONFIG_DRIVER_ATHEROS 93DRV_AP_CFLAGS += -DCONFIG_DRIVER_ATHEROS 94DRV_AP_OBJS += ../src/drivers/driver_atheros.o 95CONFIG_L2_PACKET=linux 96NEED_NETLINK=y 97NEED_LINUX_IOCTL=y 98ifdef ATH_GCM_SUPPORT 99CFLAGS += -DATH_GCM_SUPPORT 100endif 101endif 102 103##### PURE CLIENT DRIVERS 104 105ifdef CONFIG_DRIVER_WEXT 106DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT 107CONFIG_WIRELESS_EXTENSION=y 108NEED_NETLINK=y 109NEED_LINUX_IOCTL=y 110NEED_RFKILL=y 111endif 112 113ifdef CONFIG_DRIVER_NDIS 114DRV_WPA_CFLAGS += -DCONFIG_DRIVER_NDIS 115DRV_WPA_OBJS += ../src/drivers/driver_ndis.o 116ifdef CONFIG_NDIS_EVENTS_INTEGRATED 117DRV_WPA_OBJS += ../src/drivers/driver_ndis_.o 118endif 119ifndef CONFIG_L2_PACKET 120CONFIG_L2_PACKET=pcap 121endif 122CONFIG_WINPCAP=y 123ifdef CONFIG_USE_NDISUIO 124DRV_WPA_CFLAGS += -DCONFIG_USE_NDISUIO 125endif 126endif 127 128ifdef CONFIG_DRIVER_ROBOSWITCH 129DRV_WPA_CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH 130DRV_WPA_OBJS += ../src/drivers/driver_roboswitch.o 131endif 132 133ifdef CONFIG_WIRELESS_EXTENSION 134DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION 135DRV_WPA_OBJS += ../src/drivers/driver_wext.o 136NEED_RFKILL=y 137endif 138 139ifdef NEED_NETLINK 140DRV_OBJS += ../src/drivers/netlink.o 141endif 142 143ifdef NEED_RFKILL 144DRV_OBJS += ../src/drivers/rfkill.o 145endif 146 147ifdef NEED_RADIOTAP 148DRV_OBJS += ../src/utils/radiotap.o 149endif 150 151ifdef CONFIG_FULL_DYNAMIC_VLAN 152NEED_LINUX_IOCTL=y 153ifdef CONFIG_VLAN_NETLINK 154NEED_LIBNL=y 155CONFIG_LIBNL3_ROUTE=y 156endif 157endif 158 159ifdef NEED_LINUX_IOCTL 160DRV_OBJS += ../src/drivers/linux_ioctl.o 161endif 162 163ifdef NEED_LIBNL 164ifndef CONFIG_LIBNL32 165ifndef CONFIG_LIBNL20 166ifndef CONFIG_LIBNL_TINY 167PKG_CONFIG ?= pkg-config 168HAVE_LIBNL3 := $(shell $(PKG_CONFIG) --exists libnl-3.0; echo $$?) 169ifeq ($(HAVE_LIBNL3),0) 170CONFIG_LIBNL32=y 171endif 172endif 173endif 174endif 175 176ifdef CONFIG_LIBNL32 177 DRV_LIBS += -lnl-3 178 DRV_LIBS += -lnl-genl-3 179 ifdef LIBNL_INC 180 DRV_CFLAGS += -I$(LIBNL_INC) 181 else 182 PKG_CONFIG ?= pkg-config 183 DRV_CFLAGS += $(shell $(PKG_CONFIG) --cflags libnl-3.0) 184 endif 185 ifdef CONFIG_LIBNL3_ROUTE 186 DRV_LIBS += -lnl-route-3 187 DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE 188 endif 189else 190 ifdef CONFIG_LIBNL_TINY 191 DRV_LIBS += -lnl-tiny 192 else 193 ifndef CONFIG_OSX 194 DRV_LIBS += -lnl 195 DRV_LIBS += -lnl-genl 196 endif 197 endif 198endif 199endif 200 201##### COMMON VARS 202DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS) 203DRV_WPA_CFLAGS += $(DRV_CFLAGS) 204DRV_AP_CFLAGS += $(DRV_CFLAGS) 205 206DRV_BOTH_LIBS := $(DRV_LIBS) $(DRV_WPA_LIBS) $(DRV_AP_LIBS) 207DRV_WPA_LIBS += $(DRV_LIBS) 208DRV_AP_LIBS += $(DRV_LIBS) 209 210DRV_BOTH_OBJS := $(DRV_OBJS) $(DRV_WPA_OBJS) $(DRV_AP_OBJS) 211DRV_WPA_OBJS += $(DRV_OBJS) 212DRV_AP_OBJS += $(DRV_OBJS) 213 214DRV_BOTH_LDFLAGS := $(DRV_LDFLAGS) $(DRV_WPA_LDFLAGS) $(DRV_AP_LDFLAGS) 215DRV_WPA_LDFLAGS += $(DRV_LDFLAGS) 216DRV_AP_LDFLAGS += $(DRV_LDFLAGS) 217