blob: 4ea5a14a094582c90e114608fb60cadd99d77bb0 [file] [log] [blame]
#
# Copyright Statement:
# --------------------
# This software is protected by Copyright and the information contained
# herein is confidential. The software may not be copied and the information
# contained herein may not be used or disclosed except with the written
# permission of MediaTek Inc. (C) 2005
#
# BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
# NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
# SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
#
# BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
# LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
#
# THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
# WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
# LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
# RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
# THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
SHELL:=/bin/bash
# *************************************************************************
# Build path, directories
# *************************************************************************
ifndef MODIS_CONFIG
MODIS_CONFIG := FALSE
endif
FIXPATH := .
BUILDDIR := $(strip $(FIXPATH))/build
RELDIR := $(strip $(FIXPATH))/mtk_rel
UNIVERSAL_COMMON := ../common
MAKE_COMMON := make/common
CCACHE := ./mtk_tools/ccache/3.7.5/linux/ccache
PROJDIR := $(strip $(BUILDDIR))/$(strip $(PROJECT_NAME))/$(strip $(FLAVOR))
CUS_MTK_REL := $(strip $(RELDIR))/$(strip $(ORIGINAL_PROJECT_NAME))/$(strip $(ORIGINAL_FLAVOR))/TARGET
ifeq ($(strip $(MODIS_CONFIG)),TRUE)
ifeq ($(strip $(call uc,$(UE_SIMULATOR))),TRUE)
MODIS_UESIM := UESim
CUS_MTK_REL := $(strip $(RELDIR))/$(strip $(ORIGINAL_PROJECT_NAME))/$(strip $(ORIGINAL_FLAVOR))/UESIM
else
MODIS_UESIM := MoDIS
CUS_MTK_REL := $(strip $(RELDIR))/$(strip $(ORIGINAL_PROJECT_NAME))/$(strip $(ORIGINAL_FLAVOR))/MODIS
endif
TARGET_MODIS_UESIM := $(MODIS_UESIM)
else
TARGET_MODIS_UESIM := target
endif
DSP_MTK_REL := $(strip $(RELDIR))/$(strip $(ORIGINAL_PROJECT_NAME))/$(strip $(ORIGINAL_FLAVOR))
PROJ_INTERNAL_DIR := $(subst build/,build_internal/,$(PROJDIR))
include $(strip $(PROJDIR))/Custom.bld
TARGDIR := $(strip $(PROJDIR))/bin
TMPDIR := $(strip $(PROJDIR))/tmp
CUSTPACKDIR := $(strip $(PROJDIR))/custpack
BUILD_RELDIR := $(strip $(PROJDIR))/rel
OBJSDIR := $(strip $(TARGDIR))/obj
RULESDIR := $(strip $(TARGDIR))/dep
COMPLIBDIR := $(strip $(TARGDIR))/lib
COMPLOGDIR := $(strip $(TARGDIR))/log
MODULEINFODIR := $(strip $(TARGDIR))/module
GEN_MCDDIR := $(strip $(PROJDIR))/modem/mcd
GEN_SCSIDIR := $(strip $(PROJDIR))/modem/scsi
GEN_L4DIR := $(strip $(BUILD_RELDIR))/L4
GEN_MMIDIR := $(strip $(BUILD_RELDIR))/BASIC
CUS_MTK_LIB := $(strip $(CUS_MTK_REL))/lib
REL_L4DIR := $(strip $(CUS_MTK_REL))/L4
REL_MMIDIR := $(strip $(CUS_MTK_REL))/BASIC
REL_MCDDIR := $(strip $(CUS_MTK_REL))/modem/mcd
REL_SCSIDIR := $(strip $(CUS_MTK_REL))/modem/scsi
BUILD_L4DIR := $(strip $(GEN_L4DIR))
PRE_CODEGEN_DIR := $(strip $(TMPDIR))/pre_codegen
ALL_MOD_DIR := $(strip $(TARGDIR))
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
ALL_MOD_DIR := $(strip $(CUS_MTK_REL))/BASIC
BUILD_L4DIR := $(strip $(REL_L4DIR))
endif
GEN_ASDIR := $(strip $(PROJDIR))
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
GEN_ASDIR := $(strip $(CUS_MTK_REL))
endif
GEN_SSDIR := $(strip $(PROJDIR))/rel/L4/csm/ss
REL_SSDIR := $(strip $(CUS_MTK_REL))/L4/csm/ss
BUILD_SSDIR := $(strip $(GEN_SSDIR))
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
BUILD_SSDIR := $(strip $(REL_SSDIR))
endif
TARGNAME := $(strip $(PROJECT_NAME))_$(strip $(SUB_BOARD_VER))_$(strip $(PLATFORM))_$(strip $(CHIP_VER))
TSTDIR := service/dhl
TSTDIR_SEC := protocol/lte_sec/dhl
LOGGING_DATABASE := interface/service/logging_database
BUILD_TSTDIR := $(strip $(PROJDIR))/dhl
BUILD_TSTDIR_SEC := $(strip $(PROJDIR))/dhl/lte_sec
BUILD_TSTDIR_4G := $(strip $(PROJDIR))/dhl/4g
TST_DB := $(strip $(TSTDIR))/database
TST_DB_SEC := $(strip $(TSTDIR_SEC))/database
CODE_GEN_LOG := $(strip $(COMPLOGDIR))/codegen.log
BUILD_TST_DB := $(BUILD_TSTDIR)/database
BUILD_TST_DB_SEC := $(BUILD_TSTDIR_SEC)/database
BUILD_TST_DB_4G := $(BUILD_TSTDIR_4G)/database
MDDBINFOCUSTOMPREFIX := MDDB_$(strip $(PLATFORM))_$(strip $(CHIP_VER))
MODIS_TST_DB := $(strip $(TST_DB))
MODIS_TST_DB_SEC := $(strip $(TST_DB_SEC))
MODISBUILD_TST_DB := $(strip $(BUILD_TST_DB))
MODISBUILD_TST_DB_SEC := $(strip $(BUILD_TST_DB_SEC))
MODISBUILD_TST_DB_4G := $(strip $(BUILD_TST_DB_4G))
CUSTOMIZATION := $(LOGGING_DATABASE)/XDD/Customization
DBFINI_DIR := $(LOGGING_DATABASE)/XDD/DSP
ICDINI_DIR := $(LOGGING_DATABASE)/XDD/ICD
DBF_INPUT_PATH := $(strip $(MODISBUILD_TST_DB))/dbf
MODIS_RULESDIR := $(strip $(RULESDIR))
ADT_RULESDIR := $(strip $(PROJ_INTERNAL_DIR))/l1ADT
CGEN_L1_OUTDIR := $(strip $(PROJ_INTERNAL_DIR))/l1trace
CODEGEN_DEP := $(MODIS_RULESDIR)/codegen_dep
PREGEN_DEP := $(MODIS_RULESDIR)/pregen_dep
POSTGEN_DEP := $(MODIS_RULESDIR)/postgen_dep
DBG_INFO_VERNO := $(call uc,$(subst .,_,$(VERNO)))
ifeq ($(strip $(COMPILER)),GCC)
CGEN_DEF_FILE = Tgt_Cnf_GCC
else
CGEN_DEF_FILE = Tgt_Cnf
endif
BUILD_SYSDIR := $(strip $(PROJDIR))/custom/system
BUILD_CODEGENDIR := $(strip $(PROJDIR))/custom/driver/drv_gen
NOT_REMOVAL_DIR_FILE := $(strip $(MAKE_COMMON))/NotRemovalCodeDir.def
# Settings for emigen
FLASH_OPTIONS_HDR := custom/driver/common/flash_opt.h
CUSTOM_FLASH_C := custom/driver/common/custom_flash.c
CUSTOM_EMI_H := $(strip $(BUILD_SYSDIR))/custom_EMI.h
CUSTOM_EMI_RELEASE_H := $(strip $(BUILD_SYSDIR))/custom_EMI_release.h
CUSTOM_EMI_C := $(strip $(BUILD_SYSDIR))/custom_EMI.c
CUSTOM_FLASH_NORFDM5_C := $(strip $(BUILD_SYSDIR))/custom_flash_norfdm5.c
MEMORY_DEVICE_HDR := $(strip $(BUILD_SYSDIR))/custom_MemoryDevice.h
EMI_GENERATOR := ./tools/emigenMD.pl
FLASHFILE := $(strip $(TMPDIR))/~flash_cfg_tmp.c
# Setting for MK IMAGE
MCU_DRDI_MK_IMAGE_CFG := ./tools/MKImage/img_hdr_md1drdi.cfg
MCU_MK_IMAGE_CFG := ./tools/MKImage/img_hdr_md1rom.cfg
MCU_MK_IMAGE_TOOL := ./tools/MKImage/mkimage
EAS_FOLDER := protocol/eas
NRAS_FOLDER := protocol/nras
UAS_FDD_FOLDER := protocol/3g/urr/urr_fdd
UAS_TDD_FOLDER := protocol/3g/urr/urr_tdd
LAS_FOLDER := protocol/2g/las
GAS_FDD_FOLDER := protocol/2g/gas
GAS_TDD_FOLDER := protocol/2g/gas_tdd
FLC_FOLDER := protocol/l2_utility/flc2_v2
PPP_FOLDER := middleware/ppp_v2
SCSI_FOLDER := protocol/as_utility/scsi
SLEEPDRV_FOLDER := driver/sleep_drv
DVFSDRV_FOLDER := driver/dvfs_drv
ifeq ($(strip $(call uc,$(UE_SIMULATOR))),TRUE)
ifeq ($(strip $(U4G_ADAPTOR_SUPPORT)),TRUE)
EL1_FOLDER := protocol/lte_sec/smt/u4gHlAdaptor/el1b
else
EL1_FOLDER := l1/el1/el1c
endif
else
EL1_FOLDER := l1/el1/el1c
endif
# Do not support new mmi feature file architecture
PURE_VERNO := $(subst .,_, $(call uc,$(VERNO)))
MDDBMETA := MDDB.META_$(strip $(PLATFORM))_$(strip $(CHIP_VER))_$(strip $(PURE_VERNO)).EDB
MDDBMETA_V12 := Internal_meta_db_v12_for_Debug.EDB
MDDBMETADATABASEXML := MDDB.META.ODB_$(strip $(PLATFORM))_$(strip $(CHIP_VER))_$(strip $(PURE_VERNO)).XML
MDDBINFOCUSTOMSRCP := MDDB_InfoCustomAppSrcP_$(strip $(PLATFORM))_$(strip $(CHIP_VER))_$(strip $(PURE_VERNO)).EDB
NEWTARGNAME := $(strip $(PROJECT_NAME))_MDBIN_$(strip $(SUB_BOARD_VER))_$(strip $(PLATFORM))_$(strip $(CHIP_VER)).$(strip $(PURE_VERNO))
CHECKBINFILE := $(strip $(PROJECT_NAME))_MDBIN_$(strip $(SUB_BOARD_VER))_$(strip $(PLATFORM))_$(strip $(CHIP_VER))
VERNODIR := $(strip $(PROJDIR))/verno
LOG := $(strip $(TARGDIR))/link.log
COMPLOGDIR := $(strip $(TARGDIR))/log
INFOLOG := $(strip $(COMPLOGDIR))/info.log
INFOMAKELOG := $(strip $(COMPLOGDIR))/infomake.log
MCDDLL_INFOLOG := $(strip $(COMPLOGDIR))/mcddll_info.log
MCDDLL_UPDATE_LOG := $(strip $(COMPLOGDIR))/mcddll_update.log
LTE_SRC_FDR := lte_src
ifneq ($(wildcard $(LTE_SRC_FDR)),)
LTE_SRC_PATH := $(strip $(LTE_SRC_FDR))
else
LTE_SRC_PATH := .
endif
ifeq ($(strip $(DEMO_PROJECT)),TRUE)
VERNOFILE := $(strip $(MAKE_COMMON))/Verno.bld
else
VERNOFILE :=
endif
SLIM_BRANCH := $(call uc,$(strip $(BRANCH)))
BRANCH += $(call uc,$(strip $(PROJECT_NAME)))
# *************************************************************************
# Set defaul value to eliminate "option not define" warning
# *************************************************************************
BM_NEW = FALSE
INSIDE_MTK = 0
ifeq ($(strip $(call uc,$(MTK_INTERNAL))),TRUE)
INSIDE_MTK = 1
endif
DEFAULT_CUSTOMER = MTK MTK_RF PLUTO
ifneq ($(filter $(call uc,$(strip $(PROJECT_NAME))),$(strip $(DEFAULT_CUSTOMER))),)
SCATTERNAME = scat$(strip $(PLATFORM)).txt
else
SCATTERNAME = scat$(strip $(PROJECT_NAME)).txt
endif
SCATTERFILE := $(subst scat,lds,$(strip $(BUILD_SYSDIR))/$(strip $(SCATTERNAME)))
SCATTERFILE_PATH := $(subst scat,lds,$(strip $(FIXPATH))/custom/system/Specific_LDS)
COPRO_SCATTERFILE := $(subst scat,lds,$(strip $(COPRO_SYSDIR))/$(strip $(SCATTERNAME)))
BL_SCATTERFILE := $(subst scat,lds,$(strip $(BUILD_SYSDIR))/scatBL_$(strip $(PLATFORM)).txt)
SCATTERFILE_FLASHTOOL := $(subst .txt,_flashtool.txt,$(strip $(SCATTERFILE)))
SCATTERFILE_FLASHTOOL_NAME := $(filter %.txt,$(subst /, ,$(SCATTERFILE_FLASHTOOL)))
# *************************************************************************
# Implicit Rules and Compiler Options
# *************************************************************************
BIN_FILE = $(strip $(NEWTARGNAME)).bin
IMG_FILE = $(strip $(TARGNAME)).elf
GDB_TMP_FILE = $(strip $(TARGNAME)).elf.gdb-index
GDB_FILE = $(strip $(TARGNAME)).elf.gdb-index.elf
SYM_FILE = $(strip $(TARGNAME)).sym
MAP_FILE = $(strip $(TARGNAME)).map
ifeq ($(strip $(COMPILER)),GCC)
LIS_FILE = $(strip $(TARGNAME)).map
else
LIS_FILE = $(strip $(TARGNAME)).lis
endif
DRDI_BIN_FILE := DRDI.bin
# *************************************************************************
# Settings for DSP
# *************************************************************************
DSPDIR := $(strip $(RELDIR))/$(strip $(ORIGINAL_PROJECT_NAME))/$(strip $(ORIGINAL_FLAVOR))/dsp_rel
BUILD_DSPDIR := $(strip $(TARGDIR))/dsp
ifeq ($(strip $(RELEASE_PACKAGE)),REL_INTERNAL)
DSP_DEFAULT_DBF := DSP_Default.dbf
else
DSP_DEFAULT_DBF := DSP_Default_external.dbf
endif
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
DSP_DBF := $(DSPDIR)/$(strip $(DSP_PROJECT))/$(strip $(DSP_FLAVOR))/final_bin/xml/$(strip $(DSP_DEFAULT_DBF))
else
DSP_DBF := $(strip $(MODISBUILD_TST_DB))/dbf/$(strip $(DSP_DEFAULT_DBF))
endif
DSP_INFO_FILE := label.ini
DSP_VER := $(strip $(PLATFORM))_$(subst .,_,$(call uc,$(strip $(VERNO))))
BUILD_DSPDIR := $(strip $(TARGDIR))/dsp
DSP_REL_DIR := dsp_rel
DSP_FINAL_BIN_NAME := $(strip $(DSP_PROJECT))_$(strip $(DSP_FLAVOR))_DSP_FINAL_BIN.zip
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
DBF_INPUT_PATH := $(DSPDIR)/$(strip $(DSP_PROJECT))/$(strip $(DSP_FLAVOR))/final_bin/xml
endif
# *************************************************************************
# Settings for Guardian
# *************************************************************************
ifndef PARTIAL_SOURCE
PARTIAL_SOURCE := FALSE
endif
# *************************************************************************
# File setting for linux/win
# *************************************************************************
ifeq ($(strip $(OS_VERSION)),MSWin32)
CGEN := $(strip $(FIXPATH))\tools\CGenTool\Cgen.exe
POSTGEN := $(strip $(FIXPATH))\tools\PostGen\PostGen.exe
DB_CONVERTER := $(strip $(FIXPATH))\tools\PostGen\Converter\DBv12_Converter.exe
DRV_GEN := $(FIXPATH)\custom\driver\drv\Drv_Tool\DrvGen.exe
MBL_COMPOSER := .\tools\MBL_Composer.exe
DBG_INFOGEN := .\tools\DbgInfoGen.exe
UPDATE_IMG := .\tools\update_img.exe
HEADER_TEMP := $(subst /,\,$(strip $(PROJDIR)))\header_temp
HTOGETHER := .\tools\hTogether\htogether_list.bat
MinGWDir := .\mtk_tools\MinGW\win
else
CGEN := $(strip $(FIXPATH))/tools/CGenTool/Cgen
POSTGEN := $(strip $(FIXPATH))/tools/PostGen/PostGen
DB_CONVERTER := $(strip $(FIXPATH))/tools/PostGen/Converter/DBv12_Converter
DRV_GEN := $(FIXPATH)/custom/driver/drv/Drv_Tool/DrvGen
MBL_COMPOSER := ./tools/MBL_Composer
DBG_INFOGEN := ./tools/DbgInfo/DbgInfoGen
UPDATE_IMG := ./tools/update_img
HEADER_TEMP := $(strip $(PROJDIR))/header_temp
HTOGETHER := ./tools/hTogether/htogether_list.sh
MinGWDir := /mtkoss/mingw/6.2.1
endif
# *************************************************************************
# MD_OFFLOAD_COPRO settings
# *************************************************************************
L1CORE_SCATTERFILE := $(strip $(L1CORE_SYSDIR))/lds$(strip $(PROJECT_NAME))_$(strip $(FLAVOR)).txt
L1CORE_MAP_FILE := $(strip $(L1CORE_TARGDIR))/$(strip $(L1CORE_TARGNAME_L)).map
L1CORE_SYM_FILE := $(strip $(L1CORE_TARGDIR))/$(strip $(L1CORE_TARGNAME_L)).sym