makefile

来自「linux-2.4.29操作系统的源码」· 代码 · 共 201 行

TXT
201
字号
# This is far from simple, but I couldn't think of a good name.  This is# for making the 'zImage' or 'zImage.initrd' on a number of targets.## Author: Tom Rini <trini@mvista.com>## 2001-2002 (c) MontaVista, Software, Inc.  This file is licensed under# the terms of the GNU General Public License version 2.  This program# is licensed "as is" without any warranty of any kind, whether express# or implied.## Notes:# (1) All machines must set the END variable to the suffix of the preferred# final image (i.e. would be copied in 'make znetboot'.# (2) For machine targets which use the mktree program you can optionally# set ENTRYPOINT which the image should be loaded at.  The optimal setting# for ENTRYPOINT is the link address.USE_STANDARD_AS_RULE		:= true# Normally, we use the 'misc-simple.c' file for decompress_kernel and# whatnot.  Sometimes we need to override this however.MISC				:= ../common/misc-simple.oifeq ($(CONFIG_EMBEDDEDBOOT),y)ZIMAGE				:= zImage-EMBEDDEDZIMAGEINITRD			:= zImage.initrd-EMBEDDEDMISC				:= misc-embedded.oEND				:= embeddedendififeq ($(CONFIG_IBM_OPENBIOS),y)ZIMAGE				:= zImage-TREEZIMAGEINITRD			:= zImage.initrd-TREEEND				:= treebootTFTPIMAGE			:= /tftpboot/zImage.embeddedMISC				:= misc-embedded.oendififeq ($(CONFIG_EBONY),y)ZIMAGE				:= zImage-TREEZIMAGEINITRD			:= zImage.initrd-TREEEND				:= ebonyENTRYPOINT			:= 0x00800000EXTRA				:= misc-44x.oendififeq ($(CONFIG_OCOTEA),y)ZIMAGE				:= zImage-TREEZIMAGEINITRD			:= zImage.initrd-TREEEND				:= ocoteaENTRYPOINT			:= 0x00800000EXTRA				:= misc-44x.oendififeq ($(CONFIG_GEMINI),y)ZIMAGE				:= zImage-SMONZIMAGEINITRD			:= zImage.initrd-SMONEND				:= geminiendif# kbuild-2.4 'feature', only one of these will ever by 'y' at a time.# The rest will be unset.ifeq ($(CONFIG_LOPEC)$(CONFIG_PPLUS)$(CONFIG_PRPMC750),y)ZIMAGE				:= zImage-PPLUSZIMAGEINITRD			:= zImage.initrd-PPLUSEXTRA				:= ../common/mpc10x_memory.oTFTPIMAGE			:= /tftpboot/zImage.pplusEND				:= pplusendififeq ($(CONFIG_PPLUS),y)EXTRA				:= legacy.oendififeq ($(CONFIG_PAL4),y)ZIMAGE				:= zImage-PAL4ZIMAGEINITRD			:= zImage.initrd-PAL4END				:= pal4endififeq ($(CONFIG_SANDPOINT),y)ZIMAGE				:= zImage-SPZIMAGEINITRD			:= zImage.initrd-SPCACHEFLAG			:= -include clear.STFTPIMAGE			:= /tftpboot/zImage.sandpointEND				:= sandpointendififeq ($(CONFIG_SPRUCE),y)ZIMAGE				:= zImage-TREEZIMAGEINITRD			:= zImage.initrd-TREEENTRYPOINT			:= 0x00800000MISC				:= misc-spruce.oEND				:= spruceendifTFTPIMAGE			?= /tftpboot/zImage.$(END)ifeq ($(CONFIG_SMP),y)TFTPIMAGE			+= .smpendif# Setup a default address to put ourselves, change it as needed.LD_ARGS				= -T ../ld.script -Ttext 0x00800000 -Bstaticifdef CONFIG_8xxLD_ARGS				:= -T ../ld.script -Ttext 0x00180000 -Bstaticendififeq ($(CONFIG_8260)$(CONFIG_40x),y)LD_ARGS				:= -T ../ld.script -Ttext 0x00400000 -BstaticendifOBJCOPY_ARGS			:= -O elf32-powerpc# head.o and ../common/relocate.o must be at the start.obj-y				:= head.o ../common/relocate.o $(EXTRA) \				$(MISC) ../common/misc-common.o \				../common/string.o ../common/util.o \				../common/serial_stub.oobj-$(CONFIG_40x)		+= embed_config.oobj-$(CONFIG_8xx)		+= embed_config.oobj-$(CONFIG_8260)		+= embed_config.oobj-$(CONFIG_BSEIP)		+= iic.oobj-$(CONFIG_MBX)		+= iic.oobj-$(CONFIG_RPXCLASSIC)	+= iic.oobj-$(CONFIG_RPXLITE)		+= iic.o# Different boards need different serial implementations.ifeq ($(CONFIG_SERIAL_CONSOLE),y)obj-$(CONFIG_8xx)		+= m8xx_tty.oobj-$(CONFIG_8260)		+= m8260_tty.oobj-$(CONFIG_SERIAL)		+= ../common/ns16550.oendifLIBS				:= ../lib/zlib.a# ToolsMKBUGBOOT			:= ../utils/mkbugbootMKPREP				:= ../utils/mkprepMKTREE				:= ../utils/mktreezvmlinux: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o	$(OBJCOPY) $(OBJCOPY_ARGS) \		--add-section=.image=../images/vmlinux.gz \		--set-section-flags=.image=contents,alloc,load,readonly,data \		../common/dummy.o image.o	$(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)	$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \		-R .ramdisk -R .sysmapzvmlinux.initrd: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz \		../common/dummy.o	$(OBJCOPY) $(OBJCOPY_ARGS) \		--add-section=.ramdisk=../images/ramdisk.image.gz \		--set-section-flags=.ramdisk=contents,alloc,load,readonly,data \		--add-section=.image=../images/vmlinux.gz \		--set-section-flags=.image=contents,alloc,load,readonly,data \		../common/dummy.o image.o	$(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)	$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr \		-R .sysmap# Sort-of dummy rules, that let us format the image we want.zImage: $(ZIMAGE)	rm -f zvmlinuxzImage.initrd: $(ZIMAGEINITRD)	rm -f zvmlinux.initrdznetboot: zImage	cp ../images/zImage.$(END) $(TFTPIMAGE)znetboot.initrd: zImage.initrd	cp ../images/zImage.initrd.$(END) $(TFTPIMAGE)zImage-EMBEDDED: zvmlinux	mv zvmlinux ../images/zImage.$(END)zImage.initrd-EMBEDDED: zvmlinux.initrd	mv zvmlinux.initrd ../images/zImage.initrd.$(END)zImage-PAL4: zvmlinux	mv zvmlinux ../images/zImage.$(END)zImage.initrd-PAL4: zvmlinux.initrd	mv zvmlinux.initrd ../images/zImage.initrd.$(END)zImage-PPLUS: zvmlinux $(MKPREP) $(MKBUGBOOT)	$(MKPREP) -pbp zvmlinux ../images/zImage.pplus	$(MKBUGBOOT) zvmlinux ../images/zImage.bugbootzImage.initrd-PPLUS: zvmlinux.initrd $(MKPREP) $(MKBUGBOOT)	$(MKPREP) -pbp zvmlinux.initrd ../images/zImage.initrd.pplus	$(MKBUGBOOT) zvmlinux.initrd ../images/zImage.initrd.bugbootzImage-SP: zvmlinux	mv zvmlinux ../images/zImage.sandpointzImage.initrd-SP: zvmlinux.initrd	mv zvmlinux.initrd ../images/zImage.initrd.sandpointzImage-SMON: zvmlinux	dd if=zvmlinux of=../images/zImage.$(END) skip=64 bs=1kzImage.initrd-SMON: zvmlinux.initrd	dd if=zvmlinux.initrd of=../images/zImage.initrd.$(END) skip=64 bs=1kzImage-TREE: zvmlinux	$(MKTREE) zvmlinux ../images/zImage.$(END) $(ENTRYPOINT)zImage.initrd-TREE: zvmlinux.initrd	$(MKTREE) zvmlinux.initrd ../images/zImage.initrd.$(END) $(ENTRYPOINT)include $(TOPDIR)/Rules.make

⌨️ 快捷键说明

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