📄 makefile
字号:
## (C) Copyright 2000, 2001, 2002# 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# load other configurationinclude $(TOPDIR)/config.mkifndef CROSS_COMPILEifeq ($(HOSTARCH),ppc)CROSS_COMPILE = elseifeq ($(ARCH),ppc)CROSS_COMPILE = ppc_8xx-endififeq ($(ARCH),arm)CROSS_COMPILE = $(TOPDIR)/../bin/arm-linux-endififeq ($(ARCH),i386)ifeq ($(HOSTARCH),i386)CROSS_COMPILE =elseCROSS_COMPILE = i386-linux-endifendififeq ($(ARCH),mips)CROSS_COMPILE = mips_4KC-endifendifendifexport CROSS_COMPILE# The "tools" are needed early, so put this firstSUBDIRS = tools \ lib_generic \ lib_$(ARCH) \ cpu/$(CPU) \ board/$(BOARDDIR) \ common \ disk \ fs \ net \ rtc \ dtt \ drivers \ post \ post/cpu \ examples########################################################################## 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.oendifLIBS = board/$(BOARDDIR)/lib$(BOARD).aLIBS += cpu/$(CPU)/lib$(CPU).aLIBS += lib_$(ARCH)/lib$(ARCH).aLIBS += fs/jffs2/libjffs2.a fs/fdos/libfdos.a fs/fat/libfat.aLIBS += net/libnet.aLIBS += disk/libdisk.aLIBS += rtc/librtc.aLIBS += dtt/libdtt.aLIBS += drivers/libdrivers.aLIBS += post/libpost.a post/cpu/libcpu.aLIBS += common/libcommon.aLIBS += lib_generic/libgeneric.a#########################################################################all: u-boot.srec u-boot.bin System.mapinstall: all -cp u-boot.bin /tftpboot/u-boot.bin -cp u-boot.bin /net/denx/tftpboot/u-boot.binu-boot.srec: u-boot $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@u-boot.bin: u-boot $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@ gzip -c u-boot.bin >u-boot.gz cp u-boot.bin /tftpboot/ cp u-boot.gz /tftpboot/u-boot.dis: u-boot $(OBJDUMP) -d $< > $@u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT) $(LD) $(LDFLAGS) $(OBJS) \ --start-group $(LIBS) --end-group \ -Map u-boot.map -o u-bootsubdirs: @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir || exit 1 ; donedepend dep: @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; donetags: ctags -w `find $(SUBDIRS) include \ \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`etags: etags -a `find $(SUBDIRS) include \ \( -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#========================================================================# PowerPC#========================================================================########################################################################### MPC5xx Systems#########################################################################cmi_mpc5xx_config: unconfig @./mkconfig $(@:_config=) ppc mpc5xx cmi########################################################################### MPC8xx Systems#########################################################################ADS860_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 etx094FADS823_config \FADS850SAR_config \FADS860T_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx fadsFLAGADM_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 genietvGTH_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx gthhermes_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx hermesIAD210_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemensxtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))ICU862_100MHz_config \ICU862_config: unconfig @ >include/config.h @[ -z "$(findstring _100MHz,$@)" ] || \ { echo "#define CONFIG_100MHz" >>include/config.h ; \ echo "... with 100MHz system clock" ; \ } @./mkconfig -a $(call xtract_ICU862,$@) ppc mpc8xx icu862IP860_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx ip860IVML24_256_config \IVML24_128_config \IVML24_config: unconfig @ >include/config.h @[ -z "$(findstring IVML24_config,$@)" ] || \ { echo "#define CONFIG_IVML24_16M" >>include/config.h ; \ } @[ -z "$(findstring IVML24_128_config,$@)" ] || \ { echo "#define CONFIG_IVML24_32M" >>include/config.h ; \ } @[ -z "$(findstring IVML24_256_config,$@)" ] || \ { echo "#define CONFIG_IVML24_64M" >>include/config.h ; \ } @./mkconfig -a IVML24 ppc mpc8xx ivmIVMS8_256_config \IVMS8_128_config \IVMS8_config: unconfig @ >include/config.h @[ -z "$(findstring IVMS8_config,$@)" ] || \ { echo "#define CONFIG_IVMS8_16M" >>include/config.h ; \ } @[ -z "$(findstring IVMS8_128_config,$@)" ] || \ { echo "#define CONFIG_IVMS8_32M" >>include/config.h ; \ } @[ -z "$(findstring IVMS8_256_config,$@)" ] || \ { echo "#define CONFIG_IVMS8_64M" >>include/config.h ; \ } @./mkconfig -a IVMS8 ppc mpc8xx ivmKUP4K_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx kup4kLANTEC_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx lanteclwmon_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx lwmonMBX_config \MBX860T_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx mbx8xxMHPC_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx mhpc eltecMVS1_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx mvs1xtract_NETVIA = $(subst _V2,,$(subst _config,,$1))NETVIA_V2_config \NETVIA_config: unconfig @ >include/config.h @[ -z "$(findstring NETVIA_config,$@)" ] || \ { echo "#define CONFIG_NETVIA_VERSION 1" >>include/config.h ; \ echo "... Version 1" ; \ } @[ -z "$(findstring NETVIA_V2_config,$@)" ] || \ { echo "#define CONFIG_NETVIA_VERSION 2" >>include/config.h ; \ echo "... Version 2" ; \ } @./mkconfig -a $(call xtract_NETVIA,$@) ppc mpc8xx netviaNX823_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx nx823pcu_e_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx pcu_e siemensR360MPI_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx r360mpiRBC823_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx rbc823RPXClassic_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx RPXClassicRPXlite_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx RPXlitermu_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx rmuRRvision_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx RRvisionRRvision_LCD_config: unconfig @echo "#define CONFIG_LCD" >include/config.h @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h @./mkconfig -a RRvision ppc mpc8xx RRvisionSM850_config : unconfig @./mkconfig $(@:_config=) ppc mpc8xx tqm8xxSPD823TS_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx spd8xxsvm_sc8xx_config: unconfig @ >include/config.h @./mkconfig $(@:_config=) ppc mpc8xx svm_sc8xxSXNI855T_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx sixnet# EMK MPC8xx based modulesTOP860_config: unconfig @./mkconfig $(@:_config=) ppc mpc8xx top860 emk# Play some tricks for configuration selection# All boards can come with 50 MHz (default), 66MHz, 80MHz or 100 MHz clock,# but only 855 and 860 boards may come with FEC# and 823 boards may have LCD supportxtract_8xx = $(subst _66MHz,,$(subst _80MHz,,$(subst _100MHz,,$(subst _LCD,,$(subst _config,,$1)))))FPS850L_config \FPS860L_config \TQM823L_config \TQM823L_66MHz_config \TQM823L_80MHz_config \TQM823L_LCD_config \TQM823L_LCD_66MHz_config \TQM823L_LCD_80MHz_config \TQM850L_config \TQM850L_66MHz_config \TQM850L_80MHz_config \TQM855L_config \TQM855L_66MHz_config \TQM855L_80MHz_config \TQM860L_config \TQM860L_66MHz_config \TQM860L_80MHz_config \TQM862L_config \TQM862L_66MHz_config \TQM862L_80MHz_config \TQM862M_100MHz_config: unconfig @ >include/config.h @[ -z "$(findstring _66MHz,$@)" ] || \ { echo "#define CONFIG_66MHz" >>include/config.h ; \ echo "... with 66MHz system clock" ; \ } @[ -z "$(findstring _80MHz,$@)" ] || \ { echo "#define CONFIG_80MHz" >>include/config.h ; \ echo "... with 80MHz system clock" ; \ } @[ -z "$(findstring _100MHz,$@)" ] || \ { echo "#define CONFIG_100MHz" >>include/config.h ; \ echo "... with 100MHz system clock" ; \ } @[ -z "$(findstring _LCD,$@)" ] || \ { echo "#define CONFIG_LCD" >>include/config.h ; \ echo "#define CONFIG_NEC_NL6648BC20" >>include/config.h ; \ echo "... with LCD display" ; \ } @./mkconfig -a $(call xtract_8xx,$@) ppc mpc8xx tqm8xxTTTech_config: unconfig
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -