# Makefile for the huawei drivers
#
unexport bhal_dir
bhal_dir = $(CHIP_NAME)

subdir-y = $(CHIP_NAME)

compile_path:=$(lastword $(MAKEFILE_LIST))
compile_path:=$(shell dirname $(compile_path))

$(obj)/atpflash.o:
	cp $(compile_path)/atpflash.o_save $(compile_path)/atpflash.o
	
$(obj)/atpnandparts.o:
	cp $(compile_path)/atpnandparts.o_save $(compile_path)/atpnandparts.o	

obj-y += atpflash.o atpnandparts.o
obj-$(CONFIG_SUPPORT_SPIFLASH_PROTECT) += spiflash_protect.o

######### suport brcm special
$(obj)/bhal.o:
	cp $(compile_path)/bhal.o_save $(compile_path)/bhal.o
	
$(obj)/$(bhal_dir)/boardparms.o:
	cp $(compile_path)/$(bhal_dir)/boardparms.o_save $(compile_path)/$(bhal_dir)/boardparms.o
$(obj)/$(bhal_dir)/bcm63xx_led.o:
	cp $(compile_path)/$(bhal_dir)/bcm63xx_led.o_save $(compile_path)/$(bhal_dir)/bcm63xx_led.o	
$(obj)/$(bhal_dir)/bhalplat.o:
	cp $(compile_path)/$(bhal_dir)/bhalplat.o_save $(compile_path)/$(bhal_dir)/bhalplat.o
$(obj)/$(bhal_dir)/boardparms_voice.o:
	cp $(compile_path)/$(bhal_dir)/boardparms_voice.o_save $(compile_path)/$(bhal_dir)/boardparms_voice.o		


ifeq ("$(strip $(CHIP_NAME))","bcm963268")  
obj-y += $(bhal_dir)/boardparms.o $(bhal_dir)/bcm63xx_led.o bhal.o $(bhal_dir)/bhalplat.o $(bhal_dir)/boardparms_voice.o
endif


ifneq ($(strip $(CONFIG_ATP_BOARDLED)),)
#obj-y += boardled.o
endif

EXTRA_CFLAGS += -I. -I$(DRIVER_HUAWEI_DIR)/include -I$(INC_DRIVER_VENDOR_DIR)  -I$(KERNEL_DIR)/include -I$(DRIVER_HUAWEI_DIR)/flash \
                -I$(DRIVER_HUAWEI_BHAL_ADAPTER_DIR) -I$(INC_FLASHCONF_DIR) -I$(STAGING_INC_DIR)


ifneq ($(BUILD_WLAN_APCLI),)
CFLAGS += -DSUPPORT_ATP_WLAN_APCLI
endif

ifneq ($(BUILD_WLAN_AP),)
	EXTRA_CFLAGS += -DSUPPORT_ATP_WLAN_AP
endif

ifneq ($(BUILD_EQUIP_WLAN_FLAG),)
CFLAGS += -DSUPPORT_ATP_EQUIP_WLAN_FLAG
endif

ifneq ($(BUILD_EQUIP_PORT_CHK_FLAG),)
CFLAGS += -DSUPPORT_ATP_EQUIP_PORT_CHK_FLAG
endif

clean:
	rm -f *.o *.cmd
