blob: 8fb6cfe1f932523b3b9a8f032672831a0c0f1826 [file] [log] [blame]
# File: Makefile
#
# Copyright (C) 2008-2012, 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.
CC= $(CROSS_COMPILE)gcc
LD= $(CROSS_COMPILE)ld
BACKUP= /root/backup
YMD= `date +%Y%m%d%H%M`
#############################################################################
# Configuration Options
#############################################################################
# Debug Option
# DEBUG LEVEL n/1/2:
# n: NO DEBUG
# 1: PRINTM(MSG,...), PRINTM(FATAL,...), PRINTM(WARN,...) and PRINTM(INFO,...)
# 2: All PRINTM()
CONFIG_DEBUG=1
# SDIO suspend/resume
CONFIG_SDIO_SUSPEND_RESUME=y
#############################################################################
# Select Platform Tools
#############################################################################
MODEXT = ko
ifeq ($(CONFIG_64BIT), y)
EXTRA_CFLAGS += -DMBT_64BIT
endif
EXTRA_CFLAGS += -I$(M)/bt
LD += -S
#ifdef SD8xxx
BINDIR = ../bin_sd8xxx_bt
#endif
#############################################################################
# Compiler Flags
#############################################################################
EXTRA_CFLAGS += -DFPNUM='"29"'
ifeq ($(CONFIG_DEBUG),1)
EXTRA_CFLAGS += -DDEBUG_LEVEL1
endif
ifeq ($(CONFIG_DEBUG),2)
EXTRA_CFLAGS += -DDEBUG_LEVEL1
EXTRA_CFLAGS += -DDEBUG_LEVEL2
DBG= -dbg
endif
ifeq ($(CONFIG_SDIO_SUSPEND_RESUME),y)
EXTRA_CFLAGS += -DSDIO_SUSPEND_RESUME
endif
#############################################################################
# Make Targets
#############################################################################
ifneq ($(KERNELRELEASE),)
ifeq ($(CONFIG_BERLIN_SDIO_BT_8887_CHAR_DRV),y)
BTOBJS = bt_char/bt_main.o bt_char/bt_sdiommc.o bt_char/bt_proc.o bt_char/mbt_char.o
BTOBJS += bt_char/bt_init.o
else
BTOBJS = bt/bt_main.o bt/bt_sdiommc.o bt/bt_proc.o bt/mbt_char.o
BTOBJS += bt/bt_init.o
endif
obj-$(CONFIG_BERLIN_SDIO_WLAN_8887) := bt8xxx.o
bt8xxx-objs := $(BTOBJS)
# Otherwise we were called directly from the command line; invoke the kernel build system.
else
KERNEL_VERSION_HOST := $(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNEL_VERSION_HOST)/build
EXTRA_CFLAGS += -I$(KERNELDIR)/include
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
###############################################################
export CC LD EXTRA_CFLAGS KERNELDIR
.PHONY: app/fm_app clean distclean
app/fm_app:
$(MAKE) -C $@
echo:
build: echo default
@if [ ! -d $(BINDIR) ]; then \
mkdir $(BINDIR); \
fi
cp -f bt8xxx.$(MODEXT) $(BINDIR)/bt8xxx$(DBG).$(MODEXT)
cp -r config $(BINDIR)
cp -f script/sdio_mmc/* $(BINDIR)/
cp -f README $(BINDIR)
$(MAKE) -C app/fm_app $@ INSTALLDIR=$(BINDIR);
cp -f app/fm_app/fmapp $(BINDIR);
clean:
-find . -name "*.o" -exec rm {} \;
-find . -name "*.ko" -exec rm {} \;
-find . -name ".*.cmd" -exec rm {} \;
-find . -name "*.mod.c" -exec rm {} \;
-find . -name "*.symvers" -exec rm {} \;
-find . -name "modules.order" -exec rm {} \;
-rm -rf .tmp_versions
$(MAKE) -C app/fm_app $@
install: default
distclean:
-find . -name "*.o" -exec rm {} \;
-find . -name "*.orig" -exec rm {} \;
-find . -name "*.swp" -exec rm {} \;
-find . -name "*.*~" -exec rm {} \;
-find . -name "*~" -exec rm {} \;
-find . -name "*.d" -exec rm {} \;
-find . -name "*.a" -exec rm {} \;
-find . -name "tags" -exec rm {} \;
-find . -name ".*" -exec rm -rf 2> /dev/null \;
-find . -name "*.ko" -exec rm {} \;
-find . -name ".*.cmd" -exec rm {} \;
-find . -name "*.mod.c" -exec rm {} \;
-rm -rf .tmp_versions
$(MAKE) -C app/fm_app $@
# End of file;