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_LINUX_IOCTL 144DRV_OBJS += ../src/drivers/linux_ioctl.o 145endif 146 147ifdef NEED_RFKILL 148DRV_OBJS += ../src/drivers/rfkill.o 149endif 150 151ifdef NEED_RADIOTAP 152DRV_OBJS += ../src/utils/radiotap.o 153endif 154 155ifdef CONFIG_VLAN_NETLINK 156ifdef CONFIG_FULL_DYNAMIC_VLAN 157NEED_LIBNL=y 158CONFIG_LIBNL3_ROUTE=y 159endif 160endif 161 162ifdef NEED_LIBNL 163ifndef CONFIG_LIBNL32 164ifndef CONFIG_LIBNL20 165ifndef CONFIG_LIBNL_TINY 166PKG_CONFIG ?= pkg-config 167HAVE_LIBNL3 := $(shell $(PKG_CONFIG) --exists libnl-3.0; echo $$?) 168ifeq ($(HAVE_LIBNL3),0) 169CONFIG_LIBNL32=y 170endif 171endif 172endif 173endif 174 175ifdef CONFIG_LIBNL32 176 DRV_LIBS += -lnl-3 177 DRV_LIBS += -lnl-genl-3 178 DRV_CFLAGS += -DCONFIG_LIBNL20 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 endif 196 endif 197 198 ifdef CONFIG_LIBNL20 199 ifndef CONFIG_LIBNL_TINY 200 DRV_LIBS += -lnl-genl 201 endif 202 DRV_CFLAGS += -DCONFIG_LIBNL20 203 endif 204endif 205endif 206 207##### COMMON VARS 208DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS) 209DRV_WPA_CFLAGS += $(DRV_CFLAGS) 210DRV_AP_CFLAGS += $(DRV_CFLAGS) 211 212DRV_BOTH_LIBS := $(DRV_LIBS) $(DRV_WPA_LIBS) $(DRV_AP_LIBS) 213DRV_WPA_LIBS += $(DRV_LIBS) 214DRV_AP_LIBS += $(DRV_LIBS) 215 216DRV_BOTH_OBJS := $(DRV_OBJS) $(DRV_WPA_OBJS) $(DRV_AP_OBJS) 217DRV_WPA_OBJS += $(DRV_OBJS) 218DRV_AP_OBJS += $(DRV_OBJS) 219 220DRV_BOTH_LDFLAGS := $(DRV_LDFLAGS) $(DRV_WPA_LDFLAGS) $(DRV_AP_LDFLAGS) 221DRV_WPA_LDFLAGS += $(DRV_LDFLAGS) 222DRV_AP_LDFLAGS += $(DRV_LDFLAGS) 223