Create a common drivers makefile snippet

Instead of having all driver stuff collected across wpa_supplicant
and hostapd, create a common snippet that they both include and
that handles the build configuration.
This commit is contained in:
Johannes Berg 2009-08-14 19:53:27 +03:00 committed by Jouni Malinen
parent 3e91d24260
commit e7cd16cac5
3 changed files with 195 additions and 191 deletions

View file

@ -125,64 +125,11 @@ ifdef CONFIG_IEEE80211N
CFLAGS += -DCONFIG_IEEE80211N CFLAGS += -DCONFIG_IEEE80211N
endif endif
ifdef CONFIG_DRIVER_HOSTAP include ../src/drivers/drivers.mak
NEED_MLME=y OBJS += $(DRV_AP_OBJS)
CFLAGS += -DCONFIG_DRIVER_HOSTAP CFLAGS += $(DRV_AP_CFLAGS)
OBJS += ../src/drivers/driver_hostap.o LDFLAGS += $(DRV_AP_LDFLAGS)
endif LIBS += $(DRV_AP_LIBS)
ifdef CONFIG_DRIVER_WIRED
CFLAGS += -DCONFIG_DRIVER_WIRED
OBJS += ../src/drivers/driver_wired.o
endif
ifdef CONFIG_DRIVER_MADWIFI
CFLAGS += -DCONFIG_DRIVER_MADWIFI
OBJS += ../src/drivers/driver_madwifi.o
CONFIG_L2_PACKET=y
endif
ifdef CONFIG_DRIVER_ATHEROS
CFLAGS += -DCONFIG_DRIVER_ATHEROS
OBJS += ../src/drivers/driver_atheros.o
CONFIG_L2_PACKET=y
endif
ifdef CONFIG_DRIVER_PRISM54
CFLAGS += -DCONFIG_DRIVER_PRISM54
OBJS += ../src/drivers/driver_prism54.o
endif
ifdef CONFIG_DRIVER_NL80211
NEED_MLME=y
CFLAGS += -DCONFIG_DRIVER_NL80211
OBJS += ../src/drivers/driver_nl80211.o
OBJS += ../src/utils/radiotap.o
LIBS += -lnl
ifdef CONFIG_LIBNL20
LIBS += -lnl-genl
CFLAGS += -DCONFIG_LIBNL20
endif
endif
ifdef CONFIG_DRIVER_BSD
CFLAGS += -DCONFIG_DRIVER_BSD
OBJS += ../src/drivers/driver_bsd.o
CONFIG_L2_PACKET=y
CONFIG_DNET_PCAP=y
CONFIG_L2_FREEBSD=y
endif
ifdef CONFIG_DRIVER_TEST
NEED_MLME=y
CFLAGS += -DCONFIG_DRIVER_TEST
OBJS += ../src/drivers/driver_test.o
endif
ifdef CONFIG_DRIVER_NONE
CFLAGS += -DCONFIG_DRIVER_NONE
OBJS += ../src/drivers/driver_none.o
endif
ifdef CONFIG_L2_PACKET ifdef CONFIG_L2_PACKET
ifdef CONFIG_DNET_PCAP ifdef CONFIG_DNET_PCAP
@ -597,7 +544,7 @@ ifdef NEED_BASE64
OBJS += ../src/utils/base64.o OBJS += ../src/utils/base64.o
endif endif
ifdef NEED_MLME ifdef NEED_AP_MLME
OBJS += beacon.o wme.o ap_list.o ieee802_11.o OBJS += beacon.o wme.o ap_list.o ieee802_11.o
OBJS += hw_features.o OBJS += hw_features.o
CFLAGS += -DNEED_MLME CFLAGS += -DNEED_MLME

177
src/drivers/drivers.mak Normal file
View file

@ -0,0 +1,177 @@
##### COMMON DRIVERS
ifdef CONFIG_DRIVER_HOSTAP
DRV_CFLAGS += -DCONFIG_DRIVER_HOSTAP
DRV_OBJS += ../src/drivers/driver_hostap.o
CONFIG_WIRELESS_EXTENSION=y
NEED_AP_MLME=y
endif
ifdef CONFIG_DRIVER_WIRED
DRV_CFLAGS += -DCONFIG_DRIVER_WIRED
DRV_OBJS += ../src/drivers/driver_wired.o
endif
ifdef CONFIG_DRIVER_MADWIFI
DRV_CFLAGS += -DCONFIG_DRIVER_MADWIFI
DRV_OBJS += ../src/drivers/driver_madwifi.o
CONFIG_WIRELESS_EXTENSION=y
CONFIG_L2_PACKET=linux
endif
ifdef CONFIG_DRIVER_PRISM54
DRV_CFLAGS += -DCONFIG_DRIVER_PRISM54
DRV_OBJS += ../src/drivers/driver_prism54.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_NL80211
DRV_CFLAGS += -DCONFIG_DRIVER_NL80211
DRV_OBJS += ../src/drivers/driver_nl80211.o
ifdef CONFIG_CLIENT_MLME
DRV_OBJS += ../src/utils/radiotap.o
else
DRV_AP_OBJS += ../src/utils/radiotap.o
endif
NEED_SME=y
NEED_AP_MLME=y
DRV_LIBS += -lnl
ifdef CONFIG_LIBNL20
DRV_LIBS += -lnl-genl
DRV_CFLAGS += -DCONFIG_LIBNL20
endif
endif
ifdef CONFIG_DRIVER_BSD
ifndef CONFIG_L2_PACKET
CONFIG_L2_PACKET=freebsd
endif
DRV_CFLAGS += -DCONFIG_DRIVER_BSD
DRV_OBJS += ../src/drivers/driver_bsd.o
CONFIG_L2_FREEBSD=y
CONFIG_DNET_PCAP=y
endif
ifdef CONFIG_DRIVER_TEST
DRV_CFLAGS += -DCONFIG_DRIVER_TEST
DRV_OBJS += ../src/drivers/driver_test.o
NEED_AP_MLME=y
endif
##### PURE AP DRIVERS
ifdef CONFIG_DRIVER_ATHEROS
DRV_AP_CFLAGS += -DCONFIG_DRIVER_ATHEROS
DRV_AP_OBJS += ../src/drivers/driver_atheros.o
CONFIG_L2_PACKET=linux
endif
ifdef CONFIG_DRIVER_NONE
DRV_AP_CFLAGS += -DCONFIG_DRIVER_NONE
DRV_AP_OBJS += ../src/drivers/driver_none.o
endif
##### PURE CLIENT DRIVERS
ifdef CONFIG_DRIVER_WEXT
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_HERMES
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_HERMES
DRV_WPA_OBJS += ../src/drivers/driver_hermes.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_ATMEL
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_ATMEL
DRV_WPA_OBJS += ../src/drivers/driver_atmel.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_NDISWRAPPER
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_NDISWRAPPER
DRV_WPA_OBJS += ../src/drivers/driver_ndiswrapper.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_RALINK
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_RALINK
DRV_WPA_OBJS += ../src/drivers/driver_ralink.o
endif
ifdef CONFIG_DRIVER_BROADCOM
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_BROADCOM
DRV_WPA_OBJS += ../src/drivers/driver_broadcom.o
endif
ifdef CONFIG_DRIVER_IPW
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_IPW
DRV_WPA_OBJS += ../src/drivers/driver_ipw.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_NDIS
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_NDIS
DRV_WPA_OBJS += ../src/drivers/driver_ndis.o
ifdef CONFIG_NDIS_EVENTS_INTEGRATED
DRV_WPA_OBJS += ../src/drivers/driver_ndis_.o
endif
ifndef CONFIG_L2_PACKET
CONFIG_L2_PACKET=pcap
endif
CONFIG_WINPCAP=y
ifdef CONFIG_USE_NDISUIO
DRV_WPA_CFLAGS += -DCONFIG_USE_NDISUIO
endif
endif
ifdef CONFIG_DRIVER_OSX
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_OSX
DRV_WPA_OBJS += ../src/drivers/driver_osx.o
DRV_WPA_LDFLAGS += -framework CoreFoundation
DRV_WPA_LDFLAGS += -F/System/Library/PrivateFrameworks -framework Apple80211
endif
ifdef CONFIG_DRIVER_PS3
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_PS3 -m64
DRV_WPA_OBJS += ../src/drivers/driver_ps3.o
DRV_WPA_LDFLAGS += -m64
endif
ifdef CONFIG_DRIVER_IPHONE
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_IPHONE
DRV_WPA_OBJS += ../src/drivers/driver_iphone.o
DRV_WPA_OBJS += ../src/drivers/MobileApple80211.o
DRV_WPA_LDFLAGS += -framework CoreFoundation
endif
ifdef CONFIG_DRIVER_ROBOSWITCH
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH
DRV_WPA_OBJS += ../src/drivers/driver_roboswitch.o
endif
ifdef CONFIG_WIRELESS_EXTENSION
DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
DRV_WPA_OBJS += ../src/drivers/driver_wext.o
endif
##### COMMON VARS
DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS)
DRV_WPA_CFLAGS += $(DRV_CFLAGS)
DRV_AP_CFLAGS += $(DRV_CFLAGS)
DRV_BOTH_LIBS := $(DRV_LIBS) $(DRV_WPA_LIBS) $(DRV_AP_LIBS)
DRV_WPA_LIBS += $(DRV_LIBS)
DRV_AP_LIBS += $(DRV_LIBS)
DRV_BOTH_OBJS := $(DRV_OBJS) $(DRV_WPA_OBJS) $(DRV_AP_OBJS)
DRV_WPA_OBJS += $(DRV_OBJS)
DRV_AP_OBJS += $(DRV_OBJS)
DRV_BOTH_LDFLAGS := $(DRV_LDFLAGS) $(DRV_WPA_LDFLAGS) $(DRV_AP_LDFLAGS)
DRV_WPA_LDFLAGS += $(DRV_LDFLAGS)
DRV_AP_LDFLAGS += $(DRV_LDFLAGS)

View file

@ -118,134 +118,18 @@ ifdef CONFIG_NO_SCAN_PROCESSING
CFLAGS += -DCONFIG_NO_SCAN_PROCESSING CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
endif endif
ifdef CONFIG_DRIVER_HOSTAP include ../src/drivers/drivers.mak
CFLAGS += -DCONFIG_DRIVER_HOSTAP ifdef CONFIG_AP
OBJS_d += ../src/drivers/driver_hostap.o OBJS_d += $(DRV_BOTH_OBJS)
CONFIG_WIRELESS_EXTENSION=y CFLAGS += $(DRV_BOTH_CFLAGS)
endif LDFLAGS += $(DRV_BOTH_LDFLAGS)
LIBS += $(DRV_BOTH_LIBS)
ifdef CONFIG_DRIVER_WEXT else
CFLAGS += -DCONFIG_DRIVER_WEXT NEED_AP_MLME=
CONFIG_WIRELESS_EXTENSION=y OBJS_d += $(DRV_WPA_OBJS)
endif CFLAGS += $(DRV_WPA_CFLAGS)
LDFLAGS += $(DRV_WPA_LDFLAGS)
ifdef CONFIG_DRIVER_NL80211 LIBS += $(DRV_WPA_LIBS)
CFLAGS += -DCONFIG_DRIVER_NL80211
OBJS_d += ../src/drivers/driver_nl80211.o
LIBS += -lnl
ifdef CONFIG_LIBNL20
LIBS += -lnl-genl
CFLAGS += -DCONFIG_LIBNL20
endif
ifdef CONFIG_CLIENT_MLME
OBJS_d += ../src/utils/radiotap.o
endif
NEED_SME=y
NEED_AP_MLME=y
endif
ifdef CONFIG_DRIVER_PRISM54
CFLAGS += -DCONFIG_DRIVER_PRISM54
OBJS_d += ../src/drivers/driver_prism54.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_HERMES
CFLAGS += -DCONFIG_DRIVER_HERMES
OBJS_d += ../src/drivers/driver_hermes.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_MADWIFI
CFLAGS += -DCONFIG_DRIVER_MADWIFI
OBJS_d += ../src/drivers/driver_madwifi.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_ATMEL
CFLAGS += -DCONFIG_DRIVER_ATMEL
OBJS_d += ../src/drivers/driver_atmel.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_NDISWRAPPER
CFLAGS += -DCONFIG_DRIVER_NDISWRAPPER
OBJS_d += ../src/drivers/driver_ndiswrapper.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_RALINK
CFLAGS += -DCONFIG_DRIVER_RALINK
OBJS_d += ../src/drivers/driver_ralink.o
endif
ifdef CONFIG_DRIVER_BROADCOM
CFLAGS += -DCONFIG_DRIVER_BROADCOM
OBJS_d += ../src/drivers/driver_broadcom.o
endif
ifdef CONFIG_DRIVER_IPW
CFLAGS += -DCONFIG_DRIVER_IPW
OBJS_d += ../src/drivers/driver_ipw.o
CONFIG_WIRELESS_EXTENSION=y
endif
ifdef CONFIG_DRIVER_BSD
CFLAGS += -DCONFIG_DRIVER_BSD
OBJS_d += ../src/drivers/driver_bsd.o
ifndef CONFIG_L2_PACKET
CONFIG_L2_PACKET=freebsd
endif
endif
ifdef CONFIG_DRIVER_NDIS
CFLAGS += -DCONFIG_DRIVER_NDIS
OBJS_d += ../src/drivers/driver_ndis.o
ifdef CONFIG_NDIS_EVENTS_INTEGRATED
OBJS_d += ../src/drivers/driver_ndis_.o
endif
ifndef CONFIG_L2_PACKET
CONFIG_L2_PACKET=pcap
endif
CONFIG_WINPCAP=y
ifdef CONFIG_USE_NDISUIO
CFLAGS += -DCONFIG_USE_NDISUIO
endif
endif
ifdef CONFIG_DRIVER_WIRED
CFLAGS += -DCONFIG_DRIVER_WIRED
OBJS_d += ../src/drivers/driver_wired.o
endif
ifdef CONFIG_DRIVER_TEST
CFLAGS += -DCONFIG_DRIVER_TEST
OBJS_d += ../src/drivers/driver_test.o
endif
ifdef CONFIG_DRIVER_OSX
CFLAGS += -DCONFIG_DRIVER_OSX
OBJS_d += ../src/drivers/driver_osx.o
LDFLAGS += -framework CoreFoundation
LDFLAGS += -F/System/Library/PrivateFrameworks -framework Apple80211
endif
ifdef CONFIG_DRIVER_PS3
CFLAGS += -DCONFIG_DRIVER_PS3 -m64
OBJS_d += ../src/drivers/driver_ps3.o
LDFLAGS += -m64
endif
ifdef CONFIG_DRIVER_IPHONE
CFLAGS += -DCONFIG_DRIVER_IPHONE
OBJS_d += ../src/drivers/driver_iphone.o
OBJS_d += ../src/drivers/MobileApple80211.o
LIBS += -framework CoreFoundation
endif
ifdef CONFIG_DRIVER_ROBOSWITCH
CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH
OBJS_d += ../src/drivers/driver_roboswitch.o
endif endif
ifndef CONFIG_L2_PACKET ifndef CONFIG_L2_PACKET
@ -947,10 +831,6 @@ endif
endif endif
OBJS += $(SHA256OBJS) OBJS += $(SHA256OBJS)
ifdef CONFIG_WIRELESS_EXTENSION
OBJS_d += ../src/drivers/driver_wext.o
endif
ifdef CONFIG_CTRL_IFACE ifdef CONFIG_CTRL_IFACE
ifeq ($(CONFIG_CTRL_IFACE), y) ifeq ($(CONFIG_CTRL_IFACE), y)
ifdef CONFIG_NATIVE_WINDOWS ifdef CONFIG_NATIVE_WINDOWS