📄 makefile
字号:
## (C) Copyright 2000-2004# 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 Foundation; 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#HOSTARCH := $(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 A-Z a-z | \ sed -e 's/\(cygwin\).*/cygwin/')export HOSTARCH# Deal with colliding definitions from tcsh etc.VENDOR=#########################################################################TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)export TOPDIRifeq (include/config.mk,$(wildcard include/config.mk))# load ARCH, BOARD, and CPU configurationinclude include/config.mkexport ARCH CPU BOARD VENDOR SOC# load other configurationinclude $(TOPDIR)/config.mkifndef CROSS_COMPILEifeq ($(HOSTARCH),ppc)CROSS_COMPILE =elseifeq ($(ARCH),ppc)CROSS_COMPILE = ppc_8xx-endififeq ($(ARCH),arm)#CROSS_COMPILE = /usr/local/arm/2.95.3/bin/arm-linux-CROSS_COMPILE = /home/west326/usr/local/arm/bin/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-endifendifendifexport CROSS_COMPILE########################################################################## 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),mpc85xx)OBJS += cpu/$(CPU)/resetvec.oendifLIBS = 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/sk98lin/libsk98lin.aLIBS += post/libpost.a post/cpu/libcpu.aLIBS += common/libcommon.a.PHONY : $(LIBS)# Add GCC libPLATFORM_LIBS += --no-warn-mismatch -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 \ post \ post/cpu.PHONY : $(SUBDIRS)##################################################################################################################################################ALL = u-boot.srec u-boot.bin System.mapall: $(ALL)u-boot.srec: u-boot $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@u-boot.bin: u-boot $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ cp ./u-boot.bin /tftpboot# dokdo is one of three thousand korean islandu-boot.img: 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' include/version.h | \ sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \ -d $< $@u-boot.dis: u-boot $(OBJDUMP) -d $< > $@u-boot: depend $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT) UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \ --start-group $(LIBS) $(PLATFORM_LIBS) --end-group \ -Map u-boot.map -o u-boot$(LIBS): $(MAKE) -C `dirname $@`$(SUBDIRS): $(MAKE) -C $@ allgdbtools: $(MAKE) -C tools/gdb || exit 1depend dep: @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; donetags: ctags -w `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 `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 \)`System.map: u-boot @$(NM) $< | \ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > System.map#########################################################################elseall install u-boot u-boot.srec depend dep: @echo "System not configured - see README" >&2 @ exit 1endif#########################################################################unconfig: @rm -f include/config.h include/config.mk board/*/config.tmp#========================================================================# PowerPC#========================================================================########################################################################### MPC5xx Systems#########################################################################cmi_mpc5xx_config: unconfig @./mkconfig $(@:_config=) ppc mpc5xx cmiPATI_config: unconfig @./mkconfig $(@:_config=) ppc mpc5xx pati mpl########################################################################### MPC5xxx Systems#########################################################################Lite5200_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 @ >include/config.h @[ -z "$(findstring LOWBOOT_,$@)" ] || \ { if [ "$(findstring DDR,$@)" ] ; \ then echo "TEXT_BASE = 0xFF800000" >board/icecube/config.tmp ; \ else echo "TEXT_BASE = 0xFF000000" >board/icecube/config.tmp ; \ fi ; \ echo "... with LOWBOOT configuration" ; \ } @[ -z "$(findstring LOWBOOT08,$@)" ] || \ { echo "TEXT_BASE = 0xFF800000" >board/icecube/config.tmp ; \ echo "... with 8 MB flash only" ; \ echo "... with LOWBOOT configuration" ; \ } @[ -z "$(findstring DDR,$@)" ] || \ { echo "#define CONFIG_MPC5200_DDR" >>include/config.h ; \ echo "... DDR memory revision" ; \ } @[ -z "$(findstring 5200,$@)" ] || \ { echo "#define CONFIG_MPC5200" >>include/config.h ; \ echo "... with MPC5200 processor" ; \ } @[ -z "$(findstring 5100,$@)" ] || \ { echo "#define CONFIG_MGT5100" >>include/config.h ; \ echo "... with MGT5100 processor" ; \ } @./mkconfig -a IceCube ppc mpc5xxx icecubeinka4x0_config: unconfig @./mkconfig inka4x0 ppc mpc5xxx inka4x0PM520_config \PM520_DDR_config \PM520_ROMBOOT_config \PM520_ROMBOOT_DDR_config: unconfig @ >include/config.h @[ -z "$(findstring DDR,$@)" ] || \ { echo "#define CONFIG_MPC5200_DDR" >>include/config.h ; \ echo "... DDR memory revision" ; \ } @[ -z "$(findstring ROMBOOT,$@)" ] || \ { echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \ echo "... booting from 8-bit flash" ; \ } @./mkconfig -a PM520 ppc mpc5xxx pm520MINI5200_config \EVAL5200_config \TOP5200_config: unconfig @ echo "#define CONFIG_$(@:_config=) 1" >include/config.h @./mkconfig -a TOP5200 ppc mpc5xxx top5200 emkTotal5100_config \Total5200_config \Total5200_lowboot_config \Total5200_Rev2_config \Total5200_Rev2_lowboot_config: unconfig @ >include/config.h @[ -z "$(findstring 5100,$@)" ] || \ { echo "#define CONFIG_MGT5100" >>include/config.h ; \ echo "... with MGT5100 processor" ; \ } @[ -z "$(findstring 5200,$@)" ] || \ { echo "#define CONFIG_MPC5200" >>include/config.h ; \ echo "... with MPC5200 processor" ; \ } @[ -n "$(findstring Rev,$@)" ] || \ { echo "#define CONFIG_TOTAL5200_REV 1" >>include/config.h ; \ echo "... revision 1 board" ; \ } @[ -z "$(findstring Rev2_,$@)" ] || \ { echo "#define CONFIG_TOTAL5200_REV 2" >>include/config.h ; \ echo "... revision 2 board" ; \ } @[ -z "$(findstring lowboot_,$@)" ] || \ { echo "TEXT_BASE = 0xFE000000" >board/total5200/config.tmp ; \ echo "... with lowboot configuration" ; \ } @./mkconfig -a Total5200 ppc mpc5xxx total5200TQM5200_auto_config \TQM5200_AA_config \TQM5200_AB_config \TQM5200_AC_config \MiniFAP_config: unconfig @ >include/config.h @[ -z "$(findstring MiniFAP,$@)" ] || \ { echo "#define CONFIG_MINIFAP" >>include/config.h ; \ echo "#define CONFIG_TQM5200_AC" >>include/config.h ; \ echo "... TQM5200_AC on MiniFAP" ; \ } @[ -z "$(findstring AA,$@)" ] || \ { echo "#define CONFIG_TQM5200_AA" >>include/config.h ; \ echo "... with 4 MB Flash, 16 MB SDRAM, 32 kB EEPROM" ; \ } @[ -z "$(findstring AB,$@)" ] || \ { echo "#define CONFIG_TQM5200_AB" >>include/config.h ; \ echo "... with 64 MB Flash, 64 MB SDRAM, 32 kB EEPROM, 512 kB SRAM" ; \ echo "... with Graphics Controller"; \ } @[ -z "$(findstring AC,$@)" ] || \ { echo "#define CONFIG_TQM5200_AC" >>include/config.h ; \ echo "... with 4 MB Flash, 128 MB SDRAM" ; \ echo "... with Graphics Controller"; \ } @[ -z "$(findstring auto,$@)" ] || \ { echo "#define CONFIG_CS_AUTOCONF" >>include/config.h ; \ echo "... with automatic CS configuration" ; \ } @./mkconfig -a TQM5200 ppc mpc5xxx tqm5200########################################################################### MPC8xx Systems#########################################################################Adder_config \Adder87x_config \AdderII_config \ : unconfig $(if $(findstring AdderII,$@), \ @echo "#define CONFIG_MPC852T" > include/config.h) @./mkconfig -a Adder ppc mpc8xx adderADS860_config \FADS823_config \FADS850SAR_config \MPC86xADS_config \MPC885ADS_config \FADS860T_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx fadsAMX860_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx amx860 westelc2mon_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx c2monCCM_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx CCM siemenscogent_mpc8xx_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx cogentELPT860_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx elpt860 LEOXESTEEM192E_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx esteem192eETX094_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx etx094FLAGADM_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx flagadmxtract_GEN860T = $(subst _SC,,$(subst _config,,$1))GEN860T_SC_config \GEN860T_config: unconfig @ >include/config.h @[ -z "$(findstring _SC,$@)" ] || \ { echo "#define CONFIG_SC" >>include/config.h ; \ echo "With reduced H/W feature set (SC)..." ; \ } @./mkconfig -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860tGENIETV_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx genietv
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -