#/* #********************************************************************************************************* #* MELIS #* the Easy Portable/Player Develop Kits #* makefile Module #* #* (c) Copyright 2006-2010, kevin.z China #* All Rights Reserved #* #* File : make.cfg #* By : kevin.z #* Version : v1.0 #* Date : 2010-9-3 9:39 #* Descript: #* Update : date auther ver notes #********************************************************************************************************* #*/ ROOT = . SDKROOT = $(ROOT)/.. #导入交叉编译器通用配置 include $(SDKROOT)/config/${ARM_CROSS_TOOL}.CFG include $(SDKROOT)/bsp/$(BSP_PATH)/include/run_addr.cfg #头文件路径列表 INCLUDES = -I$(ROOT) \ -I$(SDKROOT)/config \ -I$(SDKROOT)/bsp \ -I$(SDKROOT)/bsp/$(BSP_PATH) \ -I$(SDKROOT)/bsp/$(BSP_PATH)/include \ -I$(SDKROOT)/bsp/$(BSP_PATH)/include/interinc \ -I$(SDKROOT)/bsp/$(BSP_PATH)/common \ -I$(SDKROOT)/bsp/$(BSP_PATH)/init_dram \ -I$(SDKROOT)/bsp/$(BSP_PATH)/uart \ -I$(SDKROOT)/bsp/$(BSP_PATH)/gpio ifeq ($(STORAGE_MEDIA_TYPE) , STORAGE_SPINOR) INCLUDES += -I$(SDKROOT)/bsp/$(BSP_PATH)/spi endif LINK_SCT = --scatter=$(ROOT)/config/config.sct #库文件列表 ifeq ($(STORAGE_MEDIA_TYPE), STORAGE_NAND) LIBS = STORAGE_TYPE = -I$(SDKROOT)/config/storage_media_cfg/nand SRCDIRS = $(shell find $(ROOT)/load_Boot1_from_nand -maxdepth 5 -type d) \ $(shell find $(SDKROOT)/bsp/$(BSP_PATH)/nand -maxdepth 5 -type d) TARGET = $(LICHEEPATH)/bin/boot0_nand_$(ARCH).bin ifneq ($(ARCH1), ) LICHEEOLDPATH = $(SDKROOT)/../../tools/pack/chips/$(ARCH1) TARGET1 = $(LICHEEOLDPATH)/bin/boot0_nand_$(ARCH1).bin endif LOCALTARGET = __boot0_nand_$(ARCH).axf else ifeq ($(STORAGE_MEDIA_TYPE), STORAGE_SDMMC) LIBS = STORAGE_TYPE = -I$(SDKROOT)/config/storage_media_cfg/sdcard SRCDIRS = $(shell find $(ROOT)/load_Boot1_from_sdmmc -maxdepth 3 -type d) TARGET = $(LICHEEPATH)/bin/boot0_sdcard_$(ARCH).bin ifneq ($(ARCH1), ) LICHEEOLDPATH = $(SDKROOT)/../../tools/pack/chips/$(ARCH1) TARGET1 = $(LICHEEOLDPATH)/bin/boot0_sdcard_$(ARCH1).bin endif LOCALTARGET = __boot0_sdmmc_$(ARCH).axf else ifeq ($(STORAGE_MEDIA_TYPE), STORAGE_SPINOR) LIBS = STORAGE_TYPE = -I$(SDKROOT)/config/storage_media_cfg/spinor SRCDIRS = $(shell find $(ROOT)/load_Boot1_from_spinor -maxdepth 3 -type d) \ $(shell find $(SDKROOT)/bsp/$(BSP_PATH)/spi -maxdepth 5 -type d) TARGET = $(LICHEEPATH)/bin/boot0_spinor_$(ARCH).bin ifneq ($(ARCH1), ) LICHEEOLDPATH = $(SDKROOT)/../../tools/pack/chips/$(ARCH1) TARGET1 = $(LICHEEOLDPATH)/bin/boot0_spinor_$(ARCH1).bin endif LOCALTARGET = __boot0_spinor_$(ARCH).axf else error: $(error STORAGE_MEDIA_TYPE is invalid now!!!) endif endif endif #定义生成的目标文件(输出/本地) TMPTARGET = $(ROOT)/boot0_origin.bin #列出该工程下的所有包含源程序的子目录 SRCDIRS := $(SRCDIRS) \ $(ROOT) \ $(shell find $(ROOT)/drv -maxdepth 3 -type d) \ $(shell find $(ROOT)/lib -maxdepth 3 -type d) \ $(shell find $(ROOT)/sys_op -maxdepth 3 -type d)\ $(SDKROOT)/bsp/$(BSP_PATH)/common \ $(SDKROOT)/bsp/$(BSP_PATH)/init_dram \ $(SDKROOT)/bsp/$(BSP_PATH)/uart \ $(SDKROOT)/bsp/$(BSP_PATH)/gpio INCLUDES := $(INCLUDES) \ $(STORAGE_TYPE) \ $(foreach dir,$(SRCDIRS),-I$(dir)) ifeq ($(CROSSTOOL), ARMRVDS) #=============================================================================== #使用RVDS编译器 #=============================================================================== #程序链接脚本 LINK_SCT := $(LINK_SCT) #编译器扩展参数 CFLAGS := $(CFLAGS) -O2 --debug CFLAGS := $(CFLAGS) $(INCLUDES) ifeq ($(FLAGS) , SUN7I_HOMLET) CFLAGS :=$(CFLAGS) -D$(FLAGS) endif #汇编器扩展参数 ASFLAGS := $(ASFLAGS) --debug --keep ASFLAGS := $(ASFLAGS) $(INCLUDES) #链接器扩展参数 LKFLAGS := $(LKFLAGS) --pd="-DRUN_ADDR=$(BOOT0_RUN_ADDR)" $(LINK_SCT) #加载器扩展参数 LDFLAGS := $(LDFLAGS) --bin --output else #=============================================================================== #使用GNU-GCC编译器 #=============================================================================== error: $(error GNU Cross-tool is invalid now!!!) endif