# File: Makefile
#
# Copyright (C) 2008-2016, Marvell International Ltd.
#
# This software file (the "File") is distributed by Marvell International
# Ltd. under the terms of the GNU General Public License Version 2, June 1991
# (the "License").  You may use, redistribute and/or modify this File in
# accordance with the terms and conditions of the License, a copy of which
# is available by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
# worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
#
# A copy of the GPL is available in file gpl-2.0.txt accompanying in this
# deliverables.
#
# THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
# IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
# ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
# this warranty disclaimer.

obj-$(CONFIG_MARVELL_MLAN) += mlan.o
mlan-y := \
	mlan/mlan_shim.o \
	mlan/mlan_init.o \
	mlan/mlan_txrx.o \
	mlan/mlan_cmdevt.o \
	mlan/mlan_misc.o \
	mlan/mlan_cfp.o \
	mlan/mlan_module.o \
	mlan/mlan_wmm.o \
	mlan/mlan_sdio.o \
	mlan/mlan_11n_aggr.o \
	mlan/mlan_11n_rxreorder.o \
	mlan/mlan_11n.o \
	mlan/mlan_11ac.o \
	mlan/mlan_11d.o \
	mlan/mlan_11h.o
mlan-$(CONFIG_MARVELL_STA) += \
	mlan/mlan_meas.o \
	mlan/mlan_scan.o \
	mlan/mlan_sta_ioctl.o \
	mlan/mlan_sta_rx.o \
	mlan/mlan_sta_tx.o \
	mlan/mlan_sta_event.o \
	mlan/mlan_sta_cmd.o \
	mlan/mlan_sta_cmdresp.o \
	mlan/mlan_join.o
mlan-$(CONFIG_MARVELL_UAP) += \
	mlan/mlan_uap_ioctl.o \
	mlan/mlan_uap_cmdevent.o \
	mlan/mlan_uap_txrx.o

obj-$(CONFIG_MARVELL_SD8XXX) += sd8xxx.o
sd8xxx-y := \
	mlinux/moal_main.o \
	mlinux/moal_ioctl.o \
	mlinux/moal_shim.o \
	mlinux/moal_eth_ioctl.o
sd8xxx-$(CONFIG_MARVELL_STA_WEXT) += \
	mlinux/moal_priv.o \
	mlinux/moal_wext.o
sd8xxx-$(CONFIG_MARVELL_UAP) += \
	mlinux/moal_uap.o
sd8xxx-$(CONFIG_MARVELL_UAP_WEXT) += \
	mlinux/moal_uap_priv.o \
	mlinux/moal_uap_wext.o
sd8xxx-$(CONFIG_MARVELL_STA_CFG80211) += \
	mlinux/moal_cfg80211.o \
	mlinux/moal_cfgvendor.o \
	mlinux/moal_sta_cfg80211.o
sd8xxx-$(CONFIG_MARVELL_UAP_CFG80211) += \
	mlinux/moal_cfg80211.o \
	mlinux/moal_cfgvendor.o \
	mlinux/moal_uap_cfg80211.o
sd8xxx-$(CONFIG_PROC_FS) += \
	mlinux/moal_proc.o \
	mlinux/moal_debug.o
sd8xxx-y += mlinux/moal_sdio_mmc.o

ccflags-y += -DLINUX
ccflags-y += -DFPNUM='"68"'
ccflags-y += -DDEBUG_LEVEL1
# ccflags-y += -DDEBUG_LEVEL2
ccflags-y += -DPROC_DEBUG
ccflags-$(CONFIG_64BIT) += -DMLAN_64BIT
ccflags-$(CONFIG_MARVELL_STA) += -DSTA_SUPPORT
ccflags-y += -DREASSOCIATION
ccflags-$(CONFIG_MARVELL_UAP) += -DUAP_SUPPORT
ccflags-$(CONFIG_MARVELL_WIFI_DIRECT) += -DWIFI_DIRECT_SUPPORT
ccflags-$(CONFIG_MARVELL_WIFI_DISPLAY) += -DWIFI_DISPLAY_SUPPORT
ccflags-y += -DMFG_CMD_SUPPORT
# ccflags-y += -DBIG_ENDIAN_SUPPORT
# ccflags-y += -DUSERSPACE_32BIT_OVER_KERNEL_64BIT
ccflags-y += -DSDIO_MULTI_PORT_TX_AGGR
ccflags-y += -DSDIO_MULTI_PORT_RX_AGGR
ccflags-y += -DSDIO_SUSPEND_RESUME
ccflags-y += -DMULTI_CHAN_SUPPORT
ccflags-y += -DDFS_TESTING_SUPPORT
# ccflags-y += -DANDROID_KERNEL
ccflags-$(CONFIG_MARVELL_STA_WEXT) += -DSTA_WEXT
ccflags-$(CONFIG_MARVELL_STA_CFG80211) += -DSTA_CFG80211
ccflags-$(CONFIG_MARVELL_UAP_WEXT) += -DUAP_WEXT
ccflags-$(CONFIG_MARVELL_UAP_CFG80211) += -DUAP_CFG80211

# add -Wno-packed-bitfield-compat when GCC version greater than 4.4
GCC_VERSION := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.4 | sed -e 's/\./*100+/g' | bc )
ifeq ($(GCC_VERSION),1)
	EXTRA_CFLAGS += -Wno-packed-bitfield-compat
endif

# End of file
