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.c 18endif 19 20ifdef CONFIG_DRIVER_NL80211 21DRV_CFLAGS += -DCONFIG_DRIVER_NL80211 22DRV_OBJS += src/drivers/driver_nl80211.c 23DRV_OBJS += src/drivers/driver_nl80211_android.c 24DRV_OBJS += src/drivers/driver_nl80211_capa.c 25DRV_OBJS += src/drivers/driver_nl80211_event.c 26DRV_OBJS += src/drivers/driver_nl80211_monitor.c 27DRV_OBJS += src/drivers/driver_nl80211_scan.c 28DRV_OBJS += src/utils/radiotap.c 29ifdef CONFIG_DRIVER_NL80211_QCA 30DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_QCA 31endif 32NEED_SME=y 33NEED_AP_MLME=y 34NEED_NETLINK=y 35NEED_LINUX_IOCTL=y 36NEED_RFKILL=y 37 38ifdef CONFIG_LIBNL32 39 DRV_LIBS += -lnl-3 40 DRV_LIBS += -lnl-genl-3 41 DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3 42ifdef CONFIG_LIBNL3_ROUTE 43 DRV_LIBS += -lnl-route-3 44 DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE 45endif 46else 47 ifdef CONFIG_LIBNL_TINY 48 DRV_LIBS += -lnl-tiny 49 else 50 DRV_LIBS += -lnl 51 endif 52 53 ifdef CONFIG_LIBNL20 54 ifndef CONFIG_LIBNL_TINY 55 DRV_LIBS += -lnl-genl 56 endif 57 DRV_CFLAGS += -DCONFIG_LIBNL20 58 endif 59endif 60endif 61 62ifdef CONFIG_DRIVER_BSD 63ifndef CONFIG_L2_PACKET 64CONFIG_L2_PACKET=freebsd 65endif 66DRV_CFLAGS += -DCONFIG_DRIVER_BSD 67DRV_OBJS += src/drivers/driver_bsd.c 68CONFIG_L2_FREEBSD=y 69CONFIG_DNET_PCAP=y 70endif 71 72ifdef CONFIG_DRIVER_OPENBSD 73ifndef CONFIG_L2_PACKET 74CONFIG_L2_PACKET=freebsd 75endif 76DRV_CFLAGS += -DCONFIG_DRIVER_OPENBSD 77DRV_OBJS += src/drivers/driver_openbsd.c 78endif 79 80ifdef CONFIG_DRIVER_NONE 81DRV_CFLAGS += -DCONFIG_DRIVER_NONE 82DRV_OBJS += src/drivers/driver_none.c 83endif 84 85##### PURE AP DRIVERS 86 87ifdef CONFIG_DRIVER_HOSTAP 88DRV_AP_CFLAGS += -DCONFIG_DRIVER_HOSTAP 89DRV_AP_OBJS += src/drivers/driver_hostap.c 90CONFIG_WIRELESS_EXTENSION=y 91NEED_AP_MLME=y 92NEED_NETLINK=y 93NEED_LINUX_IOCTL=y 94endif 95 96ifdef CONFIG_DRIVER_ATHEROS 97DRV_AP_CFLAGS += -DCONFIG_DRIVER_ATHEROS 98DRV_AP_OBJS += src/drivers/driver_atheros.c 99CONFIG_L2_PACKET=linux 100NEED_NETLINK=y 101NEED_LINUX_IOCTL=y 102endif 103 104##### PURE CLIENT DRIVERS 105 106ifdef CONFIG_DRIVER_WEXT 107DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT 108CONFIG_WIRELESS_EXTENSION=y 109NEED_NETLINK=y 110NEED_LINUX_IOCTL=y 111NEED_RFKILL=y 112endif 113 114ifdef CONFIG_DRIVER_NDIS 115DRV_WPA_CFLAGS += -DCONFIG_DRIVER_NDIS 116DRV_WPA_OBJS += src/drivers/driver_ndis.c 117ifdef CONFIG_NDIS_EVENTS_INTEGRATED 118DRV_WPA_OBJS += src/drivers/driver_ndis_.c 119endif 120ifndef CONFIG_L2_PACKET 121CONFIG_L2_PACKET=pcap 122endif 123CONFIG_WINPCAP=y 124ifdef CONFIG_USE_NDISUIO 125DRV_WPA_CFLAGS += -DCONFIG_USE_NDISUIO 126endif 127endif 128 129ifdef CONFIG_DRIVER_ROBOSWITCH 130DRV_WPA_CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH 131DRV_WPA_OBJS += src/drivers/driver_roboswitch.c 132endif 133 134ifdef CONFIG_WIRELESS_EXTENSION 135DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION 136DRV_WPA_OBJS += src/drivers/driver_wext.c 137NEED_RFKILL=y 138endif 139 140ifdef NEED_NETLINK 141DRV_OBJS += src/drivers/netlink.c 142endif 143 144ifdef NEED_LINUX_IOCTL 145DRV_OBJS += src/drivers/linux_ioctl.c 146endif 147 148ifdef NEED_RFKILL 149DRV_OBJS += src/drivers/rfkill.c 150endif 151 152ifdef CONFIG_DRIVER_CUSTOM 153DRV_CFLAGS += -DCONFIG_DRIVER_CUSTOM 154endif 155 156ifdef CONFIG_VLAN_NETLINK 157ifdef CONFIG_FULL_DYNAMIC_VLAN 158ifdef CONFIG_LIBNL32 159 DRV_LIBS += -lnl-3 160 DRV_LIBS += -lnl-genl-3 161 DRV_LIBS += -lnl-route-3 162 DRV_CFLAGS += -DCONFIG_LIBNL20 163else 164 ifdef CONFIG_LIBNL_TINY 165 DRV_LIBS += -lnl-tiny 166 else 167 DRV_LIBS += -lnl 168 endif 169 170 ifdef CONFIG_LIBNL20 171 DRV_LIBS += -lnl-genl 172 DRV_LIBS += -lnl-route 173 DRV_CFLAGS += -DCONFIG_LIBNL20 174 endif 175endif 176endif 177endif 178 179##### COMMON VARS 180DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS) 181DRV_WPA_CFLAGS += $(DRV_CFLAGS) 182DRV_AP_CFLAGS += $(DRV_CFLAGS) 183 184DRV_BOTH_LIBS := $(DRV_LIBS) $(DRV_WPA_LIBS) $(DRV_AP_LIBS) 185DRV_WPA_LIBS += $(DRV_LIBS) 186DRV_AP_LIBS += $(DRV_LIBS) 187 188DRV_BOTH_OBJS := $(DRV_OBJS) $(DRV_WPA_OBJS) $(DRV_AP_OBJS) 189DRV_WPA_OBJS += $(DRV_OBJS) 190DRV_AP_OBJS += $(DRV_OBJS) 191 192DRV_BOTH_LDFLAGS := $(DRV_LDFLAGS) $(DRV_WPA_LDFLAGS) $(DRV_AP_LDFLAGS) 193DRV_WPA_LDFLAGS += $(DRV_LDFLAGS) 194DRV_AP_LDFLAGS += $(DRV_LDFLAGS) 195