⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 u-boot-1.1.6 源码包
💻
📖 第 1 页 / 共 5 页
字号:
## (C) Copyright 2000-2006# Wolfgang Denk, DENX Software Engineering, wd@denx.de.## See file CREDITS for list of people who contributed to this# project.## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License as# published by the Free Software Foundatio; either version 2 of# the License, or (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place, Suite 330, Boston,# MA 02111-1307 USA#VERSION = 1PATCHLEVEL = 1SUBLEVEL = 6EXTRAVERSION =U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)VERSION_FILE = $(obj)include/version_autogenerated.hHOSTARCH := $(shell uname -m | \	sed -e s/i.86/i386/ \	    -e s/sun4u/sparc64/ \	    -e s/arm.*/arm/ \	    -e s/sa110/arm/ \	    -e s/powerpc/ppc/ \	    -e s/macppc/ppc/)HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \	    sed -e 's/\(cygwin\).*/cygwin/')export	HOSTARCH HOSTOS# Deal with colliding definitions from tcsh etc.VENDOR=########################################################################### U-boot build supports producing a object files to the separate external# directory. Two use cases are supported:## 1) Add O= to the make command line# 'make O=/tmp/build all'## 2) Set environement variable BUILD_DIR to point to the desired location# 'export BUILD_DIR=/tmp/build'# 'make'## The second approach can also be used with a MAKEALL script# 'export BUILD_DIR=/tmp/build'# './MAKEALL'## Command line 'O=' setting overrides BUILD_DIR environent variable.## When none of the above methods is used the local build is performed and# the object files are placed in the source directory.#ifdef Oifeq ("$(origin O)", "command line")BUILD_DIR := $(O)endifendififneq ($(BUILD_DIR),)saved-output := $(BUILD_DIR)# Attempt to create a output directory.$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})# Verify if it was successful.BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))endif # ifneq ($(BUILD_DIR),)OBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))SRCTREE		:= $(CURDIR)TOPDIR		:= $(SRCTREE)LNDIR		:= $(OBJTREE)export	TOPDIR SRCTREE OBJTREEMKCONFIG	:= $(SRCTREE)/mkconfigexport MKCONFIGifneq ($(OBJTREE),$(SRCTREE))REMOTE_BUILD 	:= 1export REMOTE_BUILDendif# $(obj) and (src) are defined in config.mk but here in main Makefile# we also need them before config.mk is included which is the case for# some targets like unconfig, clean, clobber, distclean, etc.ifneq ($(OBJTREE),$(SRCTREE))obj := $(OBJTREE)/src := $(SRCTREE)/elseobj :=src :=endifexport obj src#########################################################################ifeq ($(OBJTREE)/include/config.mk,$(wildcard $(OBJTREE)/include/config.mk))# load ARCH, BOARD, and CPU configurationinclude $(OBJTREE)/include/config.mkexport	ARCH CPU BOARD VENDOR SOCifndef CROSS_COMPILEifeq ($(HOSTARCH),ppc)CROSS_COMPILE =elseifeq ($(ARCH),ppc)CROSS_COMPILE = powerpc-linux-endififeq ($(ARCH),arm)CROSS_COMPILE = arm-linux-endififeq ($(ARCH),i386)ifeq ($(HOSTARCH),i386)CROSS_COMPILE =elseCROSS_COMPILE = i386-linux-endifendififeq ($(ARCH),mips)CROSS_COMPILE = mips_4KC-endififeq ($(ARCH),nios)CROSS_COMPILE = nios-elf-endififeq ($(ARCH),nios2)CROSS_COMPILE = nios2-elf-endififeq ($(ARCH),m68k)CROSS_COMPILE = m68k-elf-endififeq ($(ARCH),microblaze)CROSS_COMPILE = mb-endififeq ($(ARCH),blackfin)CROSS_COMPILE = bfin-elf-endififeq ($(ARCH),avr32)CROSS_COMPILE = avr32-endifendifendifexport	CROSS_COMPILE# load other configurationinclude $(TOPDIR)/config.mk########################################################################## U-Boot objects....order is important (i.e. start must be first)OBJS  = cpu/$(CPU)/start.oifeq ($(CPU),i386)OBJS += cpu/$(CPU)/start16.oOBJS += cpu/$(CPU)/reset.oendififeq ($(CPU),ppc4xx)OBJS += cpu/$(CPU)/resetvec.oendififeq ($(CPU),mpc83xx)OBJS += cpu/$(CPU)/resetvec.oendififeq ($(CPU),mpc85xx)OBJS += cpu/$(CPU)/resetvec.oendififeq ($(CPU),mpc86xx)OBJS += cpu/$(CPU)/resetvec.oendififeq ($(CPU),bf533)OBJS += cpu/$(CPU)/start1.o	cpu/$(CPU)/interrupt.o	cpu/$(CPU)/cache.oOBJS += cpu/$(CPU)/cplbhdlr.o	cpu/$(CPU)/cplbmgr.o	cpu/$(CPU)/flush.oendifOBJS := $(addprefix $(obj),$(OBJS))LIBS  = lib_generic/libgeneric.aLIBS += board/$(BOARDDIR)/lib$(BOARD).aLIBS += cpu/$(CPU)/lib$(CPU).aifdef SOCLIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).aendifLIBS += lib_$(ARCH)/lib$(ARCH).aLIBS += fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a \	fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.aLIBS += net/libnet.aLIBS += disk/libdisk.aLIBS += rtc/librtc.aLIBS += dtt/libdtt.aLIBS += drivers/libdrivers.aLIBS += drivers/nand/libnand.aLIBS += drivers/nand_legacy/libnand_legacy.aLIBS += drivers/sk98lin/libsk98lin.aLIBS += post/libpost.a post/cpu/libcpu.aLIBS += common/libcommon.aLIBS += $(BOARDLIBS)LIBS := $(addprefix $(obj),$(LIBS)).PHONY : $(LIBS)# Add GCC libPLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc# The "tools" are needed early, so put this first# Don't include stuff already done in $(LIBS)SUBDIRS	= tools \	  examples \	  post \	  post/cpu.PHONY : $(SUBDIRS)ifeq ($(CONFIG_NAND_U_BOOT),y)NAND_SPL = nand_splU_BOOT_NAND = $(obj)u-boot-nand.binendif__OBJS := $(subst $(obj),,$(OBJS))__LIBS := $(subst $(obj),,$(LIBS))##################################################################################################################################################ALL = $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND)all:		$(ALL)$(obj)u-boot.hex:	$(obj)u-boot		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@$(obj)u-boot.srec:	$(obj)u-boot		$(OBJCOPY) ${OBJCFLAGS} -O srec $< $@$(obj)u-boot.bin:	$(obj)u-boot		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@$(obj)u-boot.img:	$(obj)u-boot.bin		./tools/mkimage -A $(ARCH) -T firmware -C none \		-a $(TEXT_BASE) -e 0 \		-n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \			sed -e 's/"[	 ]*$$/ for $(BOARD) board"/') \		-d $< $@$(obj)u-boot.dis:	$(obj)u-boot		$(OBJDUMP) -d $< > $@$(obj)u-boot:		depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)		UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\		cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \			--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \			-Map u-boot.map -o u-boot$(OBJS):		$(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))$(LIBS):		$(MAKE) -C $(dir $(subst $(obj),,$@))$(SUBDIRS):		$(MAKE) -C $@ all$(NAND_SPL):	version		$(MAKE) -C nand_spl/board/$(BOARDDIR) all$(U_BOOT_NAND):	$(NAND_SPL) $(obj)u-boot.bin		cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.binversion:		@echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE); \		echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE); \		echo -n $(shell $(CONFIG_SHELL) $(TOPDIR)/tools/setlocalversion \			 $(TOPDIR)) >> $(VERSION_FILE); \		echo "\"" >> $(VERSION_FILE)gdbtools:		$(MAKE) -C tools/gdb all || exit 1updater:		$(MAKE) -C tools/updater all || exit 1env:		$(MAKE) -C tools/env all || exit 1depend dep:		for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; donetags ctags:		ctags -w -o $(OBJTREE)/ctags `find $(SUBDIRS) include \				lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \				fs/cramfs fs/fat fs/fdos fs/jffs2 \				net disk rtc dtt drivers drivers/sk98lin common \			\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`etags:		etags -a -o $(OBJTREE)/etags `find $(SUBDIRS) include \				lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \				fs/cramfs fs/fat fs/fdos fs/jffs2 \				net disk rtc dtt drivers drivers/sk98lin common \			\( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`$(obj)System.map:	$(obj)u-boot		@$(NM) $< | \		grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \		sort > $(obj)System.map#########################################################################elseall $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \$(SUBDIRS) version gdbtools updater env depend \dep tags ctags etags $(obj)System.map:	@echo "System not configured - see README" >&2	@ exit 1endif.PHONY : CHANGELOGCHANGELOG:	git log --no-merges U-Boot-1_1_5.. | \	unexpand -a | sed -e 's/\s\s*$$//' > $@#########################################################################unconfig:	@rm -f $(obj)include/config.h $(obj)include/config.mk \		$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp#========================================================================# PowerPC#========================================================================########################################################################### MPC5xx Systems#########################################################################canmb_config:	unconfig	@$(MKCONFIG) -a canmb ppc mpc5xxx canmbcmi_mpc5xx_config:	unconfig	@$(MKCONFIG) $(@:_config=) ppc mpc5xx cmiPATI_config:		unconfig	@$(MKCONFIG) $(@:_config=) ppc mpc5xx pati mpl########################################################################### MPC5xxx Systems#########################################################################aev_config: unconfig	@$(MKCONFIG) -a aev ppc mpc5xxx tqm5200BC3450_config:	unconfig	@$(MKCONFIG) -a BC3450 ppc mpc5xxx bc3450cpci5200_config:  unconfig	@$(MKCONFIG) -a cpci5200  ppc mpc5xxx cpci5200 esdhmi1001_config:         unconfig	@$(MKCONFIG) hmi1001 ppc mpc5xxx hmi1001Lite5200_config				\Lite5200_LOWBOOT_config			\Lite5200_LOWBOOT08_config		\icecube_5200_config			\icecube_5200_LOWBOOT_config		\icecube_5200_LOWBOOT08_config		\icecube_5200_DDR_config 		\icecube_5200_DDR_LOWBOOT_config 	\icecube_5200_DDR_LOWBOOT08_config	\icecube_5100_config:			unconfig	@mkdir -p $(obj)include	@mkdir -p $(obj)board/icecube	@ >$(obj)include/config.h	@[ -z "$(findstring LOWBOOT_,$@)" ] || \		{ if [ "$(findstring DDR,$@)" ] ; \			then echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \			else echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \		  fi ; \		  echo "... with LOWBOOT configuration" ; \		}	@[ -z "$(findstring LOWBOOT08,$@)" ] || \		{ echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \		  echo "... with 8 MB flash only" ; \		  echo "... with LOWBOOT configuration" ; \		}	@[ -z "$(findstring DDR,$@)" ] || \		{ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h ; \		  echo "... DDR memory revision" ; \		}	@[ -z "$(findstring 5200,$@)" ] || \		{ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h ; \		  echo "... with MPC5200 processor" ; \		}	@[ -z "$(findstring 5100,$@)" ] || \		{ echo "#define CONFIG_MGT5100"		>>$(obj)include/config.h ; \		  echo "... with MGT5100 processor" ; \		}	@$(MKCONFIG) -a IceCube ppc mpc5xxx icecubev38b_config: unconfig	@./mkconfig -a V38B ppc mpc5xxx v38binka4x0_config:	unconfig	@$(MKCONFIG) inka4x0 ppc mpc5xxx inka4x0lite5200b_config	\lite5200b_LOWBOOT_config:	unconfig	@mkdir -p $(obj)include	@mkdir -p $(obj)board/icecube	@ >$(obj)include/config.h	@ echo "#define CONFIG_MPC5200_DDR"	>>$(obj)include/config.h	@ echo "... DDR memory revision"	@ echo "#define CONFIG_MPC5200"		>>$(obj)include/config.h	@ echo "#define CONFIG_LITE5200B"	>>$(obj)include/config.h	@[ -z "$(findstring LOWBOOT_,$@)" ] || \		{ echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \		  echo "... with LOWBOOT configuration" ; \		}	@ echo "... with MPC5200B processor"	@$(MKCONFIG) -a IceCube  ppc mpc5xxx icecube

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -