Files
Tplink-xx230v/sdk/en7529/app_bsp/MakeFile_Main_BSP

227 lines
5.9 KiB
Plaintext
Executable File

include Project/release.chk
include Project/customer_release/c_release.chk
ifneq ($(strip $(CUSTOM)),)
include Project/profile/$(CUSTOM)/$(PROFILE)/$(PROFILE).profile
else
CUSTOM=RT
include Project/profile/$(CUSTOM)/$(PROFILE)/$(PROFILE).profile
endif
include Project/dir.mak
include Project/rule.mak
include Project/make_inc/toolchain.mk
export CFG_CFLAGS = -msoft-float -fomit-frame-pointer
ifneq ($(strip $(MSDK)),)
ifneq ($(strip $(MPLATFORM)),)
TCPLATFORM=$(MPLATFORM)
else
TCPLATFORM=$(PROFILE)
endif
endif
ifneq ($(strip $(BAK_PATH)),)
export BIN_BAK_PATH=$(BAK_PATH)
else
export BIN_BAK_PATH=$(TRUNK_DIR)
endif
ifneq ($(strip $(TCSUPPORT_CODE_SHRINK)),)
CFG_CFLAGS += -Os
else
CFG_CFLAGS += -O2
endif
ifneq ($(strip $(VP_MEGACO)),)
TCSUPPORT_VOIP_IMSSIP=
CFG_CFLAGS += -DVP_MEGACO
endif
#if/*TCSUPPORT_COMPILE*/ defined(TCSUPPORT_C1_NEW_GUI)
ifneq ($(strip $(TCSUPPORT_C1_NEW_GUI)),)
CFG_CFLAGS += -DTCSUPPORT_C1_NEW_GUI
endif
#endif/*TCSUPPORT_COMPILE*/
ifneq ($(strip $(TCSUPPORT_ZEBRA_WORKAROUND)),)
CFG_CFLAGS += -DTCSUPPORT_ZEBRA_WORKAROUND
endif
ifneq ($(strip $(TCSUPPORT_FON)),)
#if defined(TCSUPPORT_FON_MODEL_B)
ifneq ($(strip $(TCSUPPORT_FON_MODEL_B)),)
FON_CFLAGS += -DTCSUPPORT_FON_MODEL_B
endif
#if/*TCSUPPORT_COMPILE*/ defined(TCSUPPORT_OI_C9)
ifneq ($(strip $(TCSUPPORT_OI_C9)),)
FON_CFLAGS += -DTCSUPPORT_OI_C9
endif
#endif/*TCSUPPORT_COMPILE*/
#if/*TCSUPPORT_COMPILE*/ defined(TCSUPPORT_OI_C7)
ifneq ($(strip $(TCSUPPORT_OI_C7)),)
FON_CFLAGS += -DTCSUPPORT_OI_C7
endif
#endif/*TCSUPPORT_COMPILE*/
FON_CFLAGS += -Os
FON_CFLAGS += -Wall
FON_CFLAGS += -mips1
#endif
endif
TC3262_DRIVERS := $(TCSUPPORT_CPU_TC3262) $(TCSUPPORT_CPU_TC3182) $(TCSUPPORT_CPU_RT63165) $(TCSUPPORT_CPU_RT65168)
#Detect Release Code
ifneq ($(strip $(RELEASEBSP)),)
ifeq ($(strip $(TCSUPPORT_CPU_EN7512) $(TCSUPPORT_CPU_EN7521)),)
#unexport Compile Env of SDRAM Size
unexport 8M
unexport 16M
unexport 32M
unexport 64M
unexport TCSUPPORT_SDRAM_8M
unexport TCSUPPORT_SDRAM_16M
unexport TCSUPPORT_SDRAM_32M
unexport TCSUPPORT_SDRAM_64M
endif
include Project/release_bsp.mak
ifeq ("$(IS_APPS_DIR_EXIST)", "Y")
include $(APP_PRIVATE_DIR)/release_app.mak
endif
endif
#for customer release
ifneq ($(strip $(CUSTOMERRELEASE)),)
include Project/customer_release/customer_release
endif
#begin for parallel build
ifeq ($(strip $(TCSUPPORT_PARALLEL_BUILD_CUSTOM_JOB_NUM_ENABLE)),) #no custom job number
TCSUPPORT_PARALLEL_BUILD_JOB_NUM = 16
endif
TC_PARALLEL_BUILD_PARAM = -j $(TCSUPPORT_PARALLEL_BUILD_JOB_NUM)
ifneq ($(strip $(TCSUPPORT_PARALLEL_BUILD_KERNEL_OFF)),)
TC_PARALLEL_BUILD_PARAM_KERNEL =
else
TC_PARALLEL_BUILD_PARAM_KERNEL = $(TC_PARALLEL_BUILD_PARAM)
endif
#end for parallel build
include $(APP_BSP_DIR)/MakeFile_BSP
menuconfig:pre_profile
echo "Project menuconfig"
chmod -R 777 $(PROJECT_DIR)
cp $(PROFILE_DIR)/$(PROFILE).profile $(PROJECT_MENUCONFIG_DIR)/.config
ifneq ($(strip $(CUSTOM)),)
echo "#Custom menuconfig" > $(PROJECT_MENUCONFIG_DIR)/CustomConfig;
if test -e $(PROJECT_MENUCONFIG_DIR)/$(CUSTOM).config; \
then cat $(PROJECT_MENUCONFIG_DIR)/$(CUSTOM).config > $(PROJECT_MENUCONFIG_DIR)/CustomConfig; \
fi
endif
$(MAKE) -C $(PROJECT_MENUCONFIG_DIR) menuconfig
cp $(PROJECT_MENUCONFIG_DIR)/.config $(PROFILE_DIR)/$(PROFILE).profile
pre_profile:
ifneq ($(strip $(VENDOR)),)
cp $(PROFILE_DIR)/custom/$(VENDOR)/* $(PROFILE_DIR)
endif
ifeq ("$(IS_APPS_DIR_EXIST)", "N")
else
include $(APP_PRIVATE_DIR)/make_build_sdk_fw
endif
devkitgen:
ifeq ("$(IS_APPS_DIR_EXIST)", "Y")
ifeq ($(strip $(RELEASEBSP)),)
ifeq ($(strip $(CUSTOMERRELEASE)),)
rm -rf ../evo_dk
mkdir ../evo_dk
mkdir -p ../evo_dk/apps/private
mkdir ../evo_dk/linux-3.18.21
cp $(KERNEL_DIR)/linux.7z ../evo_dk/linux-3.18.21/.
cp -rf $(FILESYSTEM_DIR) ../evo_dk/
cp -rf $(TRUNK_DIR)/Makefile ../evo_dk/
cp -rf $(TRUNK_DIR)/Project ../evo_dk/
cp -rf $(TOOLS_DIR) ../evo_dk/
cp -rf $(APP_TCLINUXBUILDER_DIR) ../evo_dk/apps/private/
cp -rf $(APP_PRIVATE_DIR)/make* ../evo_dk/apps/private
cp -rf $(APP_PRIVATE_DIR)/release* ../evo_dk/apps/private
ifneq ("$(wildcard $(BOOTROM_DIR))", "")
mkdir ../evo_dk/bootrom
cp -rf $(BOOTROM_DIR)/make_bootbase ../evo_dk/bootrom/
endif
mkdir ../evo_dk/modules
cp -rf $(MODULE_DIR)/make_modules ../evo_dk/modules/
mkdir -p ../evo_dk/app_bsp/bsp_exclusive
mkdir -p ../evo_dk/app_bsp/private/API
mkdir -p ../evo_dk/app_bsp/private/API/hw_driver
cp -rf $(APP_BSP_DIR)/make_app_bsp ../evo_dk/app_bsp/
cp -rf $(APP_BSP_EXCLUSIVE_PRIVATE_DIR)/make_bsp_exclusive ../evo_dk/app_bsp/bsp_exclusive
cp -rf $(BSP_API_DIR)/make_api ../evo_dk/app_bsp/private/API
echo -n "osbnq fakeroot make PROFILE=" > ../evo_dk/build.sh
echo -n $(PROFILE) >> ../evo_dk/build.sh
ifneq ($(strip $(TCSUPPORT_CT)),)
echo " CUSTOM=CT TCSUPPORT_CUSKITBUILD=y fwgen" >> ../evo_dk/build.sh
else
echo " fwgen" >> ../evo_dk/build.sh
endif
else
echo " fwgen" >> ../evo_dk/build.sh
echo "mtkbuild -s -o Project/images" >> ../evo_dk/build.sh
chmod a+x ../evo_dk/build.sh
# remove files
rm ../evo_dk/Project/images/tclinux*
rm ../evo_dk/apps/private/tclinux_builder/tclinux*
find ../evo_dk/ -name ".git" | xargs rm -rf
tar -czvf ../devkit_$(TCPLATFORM)_`date +%Y%m%d`.tgz ../evo_dk/
rm -rf ../evo_dk/
endif
endif
endif
ifneq ($(strip $(PACK)),)
packer:
echo "make ELF packer"
make -C $(TOOLS_DIR)/Packer/ clean
make -C $(TOOLS_DIR)/Packer/
else
packer:
echo "Not make ELF packer,please add compile option"
endif
ifneq ($(strip $(PACK)),)
pack:
echo "Pack executables"
for file1 in `find $(FILESYSTEM_DIR)/userfs/bin -type f -perm -111` ; \
do \
echo $${file1}; \
$(TOOLS_DIR)/Packer/packer $${file1}; \
done ; \
for file2 in `find $(FILESYSTEM_DIR)/lib -type f -perm -111` ; \
do \
echo $${file2}; \
$(TOOLS_DIR)/Packer/packer $${file2}; \
done ; \
for file3 in `find $(FILESYSTEM_DIR)/lib/modules -type f -name "*.ko"` ; \
do \
echo $${file3}; \
$(TOOLS_DIR)/Packer/packer $${file3};\
done
else
pack:
echo "Not Pack"
endif
include $(TOOLS_DIR)/make_tools