MT7688 Uboot Makefile 分析

1.指定包含文件

ifeq (include/config.mk,$(wildcard include/config.mk))

# load ARCH, BOARD, and CPU configuration
include include/config.mk
export  ARCH CPU BOARD VENDOR SOC
# load other configuration

include $(TOPDIR)/config.mk

2. 指定交叉编译工具的路径

ifeq ($(ARCH),mips)
CROSS_COMPILE = $(CONFIG_CROSS_COMPILER_PATH)/mipsel-linux-
endif

3. 指定DDR类型


ifeq ($(ON_BOARD_DDR2),y)
DRAM_TYPE=DDR2

endif

4. 指定DRAM大小

ifeq ($(ON_BOARD_512M_DRAM_COMPONENT),y)
DRAM_SIZE=64

endif

5. 指定编译目标和源文件

ifeq ($(MT7621_MP), y)
OBJS  = cpu/$(CPU)/start_1004k.o
else
OBJS  = cpu/$(CPU)/start.o
endif


ifeq ($(CPU),i386)
OBJS += cpu/$(CPU)/start16.o
OBJS += cpu/$(CPU)/reset.o
endif
ifeq ($(CPU),ppc4xx)
OBJS += cpu/$(CPU)/resetvec.o
endif
ifeq ($(CPU),mpc85xx)
OBJS += cpu/$(CPU)/resetvec.o

endif


LIBS  = lib_generic/libgeneric.a
LIBS += board/$(BOARDDIR)/lib$(BOARD).a
LIBS += cpu/$(CPU)/lib$(CPU).a
ifdef SOC
LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
endif
LIBS += lib_$(ARCH)/lib$(ARCH).a
LIBS += net/libnet.a
LIBS += httpd/libhttpd.a
#LIBS += rtc/librtc.a
LIBS += drivers/libdrivers.a


ifeq ($(RALINK_USB),ON)
LIBS += fs/fat/libfat.a
LIBS += disk/libdisk.a
feq ($(ON_BOARD_512M_DRAM_COMPONENT),y)
DRAM_SIZE=64
endif

endif

6. 指定库文件

#LIBS += post/libpost.a post/cpu/libcpu.a
LIBS += common/libcommon.a
.PHONY : $(LIBS)


# Add GCC lib

PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)  -print-libgcc-file-name`)


你可能感兴趣的:(Mt7688,Uboot,Makefile)