makefile

来自「是关于linux2.5.1的完全源码」· 代码 · 共 262 行

TXT
262
字号
# 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>## Copyright 2001 MontaVista Software Inc.## Notes: For machine targets which produce more than one image, define# ZNETBOOT and ZNETBOOTRD to the image which should be available for# 'znetboot' and 'znetboot.initrd`## 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.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_TREEBOOT),y)ZIMAGE				:= zImage-TREEZIMAGEINITRD			:= zImage.initrd-TREETFTPIMAGE			:= /tftpboot/zImage.embeddedMISC				:= misc-embedded.oendififeq ($(CONFIG_EMBEDDEDBOOT),y)ZIMAGE				:= zImage-EMBEDDEDZIMAGEINITRD			:= zImage.initrd-EMBEDDEDTFTPIMAGE			:= /tftpboot/zImage.embeddedMISC				:= misc-embedded.oendififeq ($(CONFIG_EV64260),y)ZIMAGE				:= zImage-EV64260ZIMAGEINITRD			:= zImage.initrd-EV64260HEADHELP			:= direct.o misc-ev64260.oTFTPIMAGE			:= /tftpboot/zImage.ev64260endififeq ($(CONFIG_GEMINI),y)ZIMAGE				:= zImage-SMONZIMAGEINITRD			:= zImage.initrd-SMONHEADHELP			:= direct.oTFTPIMAGE			:= /tftpboot/zImage.geminiendififeq ($(CONFIG_MENF1),y)ZIMAGE				:= zImage-MENF1ZIMAGEINITRD			:= zImage.initrd-MENF1HEADHELP			:= chrpmap.oTFTPIMAGE			:= /tftpboot/zImage.menf1endififeq ($(CONFIG_K2),y)ZIMAGE				:= zImage-K2ZIMAGEINITRD			:= zImage.initrd-K2HEADHELP			:= legacy.oTFTPIMAGE			:= /tftpboot/zImage.k2endif# kbuild-2.4 'feature', only one of these will ever by 'y' at a time.# The rest will be unset.ifeq ($(CONFIG_MCPN765)$(CONFIG_MVME5100)$(CONFIG_PRPMC750)$(CONFIG_PRPMC800)$(CONFIG_LOPEC)$(CONFIG_PPLUS),y)ZIMAGE				:= zImage-PPLUSZIMAGEINITRD			:= zImage.initrd-PPLUSHEADHELP			:= direct.oTFTPIMAGE			:= /tftpboot/zImage.pplusZNETBOOT			:= zImage.pplusZNETBOOTRD			:= zImage.initrd.pplusendififeq ($(CONFIG_PPLUS),y)HEADHELP			:= legacy.oendififeq ($(CONFIG_PCORE),y)ZIMAGE				:= zImage-PCOREZIMAGEINITRD			:= zImage.initrd-PCOREHEADHELP			:= chrpmap.oTFTPIMAGE			:= /tftpboot/zImage.pcoreendif#Ugh, should come up with a better nameing convention..ifeq ($(CONFIG_POWERPMC250),y)ZIMAGE				:= zImage-PCOREZIMAGEINITRD			:= zImage.initrd-PCOREHEADHELP			:= direct.oTFTPIMAGE			:= /tftpboot/zImage.pcoreendififeq ($(CONFIG_SANDPOINT),y)ZIMAGE				:= zImage-SPZIMAGEINITRD			:= zImage.initrd-SPHEADHELP			:= direct.oTFTPIMAGE			:= /tftpboot/zImage.sandpointendififeq ($(CONFIG_SPRUCE),y)ZIMAGE				:= zImage-SPRUCEZIMAGEINITRD			:= zImage.initrd-SPRUCEHEADHELP			:= direct.oMISC				:= misc-spruce.oTFTPIMAGE			:= /tftpboot/zImage.spruceendififeq ($(CONFIG_ZX4500),y)ZIMAGE				:= zImage-ZX4500ZIMAGEINITRD			:= zImage.initrd-ZX4500HEADHELP			:= direct.oTFTPIMAGE			:= /tftpboot/zImage.zx4500endififeq ($(CONFIG_SMP),y)TFTPIMAGE			+= .smpendififeq ($(CONFIG_REDWOOD_4),y)# This is a treeboot that needs init functions until the# boot rom is sorted out (i.e. this is short lived)EXTRA_AFLAGS			:= -Wa,-m405HEADHELP			:= rw4/rw4_init.o rw4/rw4_init_brd.oendif# Default linker args.  Link at 0x00800000 or 0x00400000 by default, but# allow it to be overridden.ifeq ($(CONFIG_BOOT_LOAD_BOOL),y)LD_ARGS				:= -T ../ld.script -Ttext $(CONFIG_BOOT_LOAD) \					-BstaticelseLD_ARGS				= -T ../ld.script -Ttext 0x00800000 -Bstaticifeq ($(CONFIG_8260)$(CONFIG_4xx)$(CONFIG_8xx),y)LD_ARGS				:= -T ../ld.script -Ttext 0x00400000 -BstaticendifendifOBJCOPY_ARGS			:= -O elf32-powerpc# head.o and ../common/relocate.o must be at the start.obj-y				:= head.o ../common/relocate.o $(HEADHELP) \				$(MISC) ../common/misc-common.o \				../common/string.o ../common/util.oobj-$(CONFIG_4xx)		+= embed_config.oobj-$(CONFIG_8xx)		+= embed_config.oobj-$(CONFIG_8260)		+= embed_config.oobj-$(CONFIG_BSEIP)		+= iic.oobj-$(CONFIG_MBX)		+= iic.o pci.o qspan_pci.oobj-$(CONFIG_RPXCLASSIC)	+= iic.o pci.o qspan_pci.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_GT64260_CONSOLE)   += gt64260_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: zImageifneq ($(ZNETBOOT),)	cp ../images/$(ZNETBOOT) $(TFTPIMAGE)else	cp ../images/zImage.* $(TFTPIMAGE)endifznetboot.initrd: zImage.initrdifneq ($(ZNETBOOTRD),)	cp ../images/$(ZNETBOOTRD) $(TFTPIMAGE)else	cp ../images/zImage.* $(TFTPIMAGE)endifzImage-EMBEDDED: zvmlinux	mv zvmlinux ../images/zImage.embeddedzImage.initrd-EMBEDDED: zvmlinux.initrd	mv zvmlinux.initrd ../images/zImage.initrd.embeddedzImage-K2: zvmlinux 	mv zvmlinux ../images/zImage.k2zImage.initrd-K2: zvmlinux.initrd 	mv zvmlinux.initrd ../images/zImage.initrd.k2zImage-EV64260: zvmlinux	mv zvmlinux ../images/zImage.ev64260zImage.initrd-EV64260: zvmlinux.initrd	mv zvmlinux.initrd ../images/zImage.initrd.ev64260zImage-MENF1: zvmlinux	$(MKPREP) -pbp zvmlinux ../images/zImage.menf1zImage.initrd-MENF1: zvmlinux.initrd	$(MKPREP) -pbp zvmlinux.initrd ../images/zImage.initrd.menf1zImage-PCORE: zvmlinux	dd if=zvmlinux of=../images/zImage.pcore skip=64 bs=1kzImage.initrd-PCORE: zvmlinux.initrd	dd if=zvmlinux.initrd of=../images/zImage.initrd.pcore skip=64 bs=1kzImage-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-SMON: zvmlinux	dd if=zvmlinux of=../images/zImage.gemini skip=64 bs=1kzImage.initrd-SMON: zvmlinux.initrd	dd if=zvmlinux.initrd of=../images/zImage.initrd.gemini skip=64 bs=1kzImage-SP: zvmlinux	mv zvmlinux ../images/zImage.sandpointzImage.initrd-SP: zvmlinux.initrd	mv zvmlinux.initrd ../images/zImage.initrd.sandpointzImage-SPRUCE: zvmlinux	$(MKTREE) zvmlinux ../images/zImage.spruce 0x800000zImage.initrd-SPRUCE: zvmlinux.initrd	$(MKTREE) zvmlinux.initrd ../images/zImage.initrd.spruce 0x800000zImage-TREE: zvmlinux	$(MKTREE) zvmlinux ../images/zImage.treebootzImage.initrd-TREE: zvmlinux.initrd	$(MKTREE) zvmlinux.initrd ../images/zImage.initrd.treebootzImage-ZX4500: zvmlinux	dd if=zvmlinux of=../images/zImage.zx4500 skip=64 bs=1kzImage.initrd-ZX4500: zvmlinux.initrd	dd if=zvmlinux.initrd of=../images/zImage.initrd.zx4500 skip=64 bs=1kinclude $(TOPDIR)/Rules.make

⌨️ 快捷键说明

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