📄 makefile
字号:
# 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-2002 MontaVista Software Inc.## Notes:# (1) 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`# (2) For machine targets which use the mktree program, define END to be# the machine name you want in the image, and you can optionally set# ENTRYPOINT which the image should be loaded at. The optimal setting# for ENTRYPOINT is the link address.## 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_EMBEDDEDBOOT),y)ZIMAGE := zImage-EMBEDDEDZIMAGEINITRD := zImage.initrd-EMBEDDEDTFTPIMAGE := /tftpboot/zImage.embeddedMISC := misc-embedded.oendififeq ($(CONFIG_GEMINI),y)ZIMAGE := zImage-SMONZIMAGEINITRD := zImage.initrd-SMONEXTRA := direct.oTFTPIMAGE := /tftpboot/zImage.geminiendififeq ($(CONFIG_PAL4),y)ZIMAGE := zImage-PAL4ZIMAGEINITRD := zImage.initrd-PAL4EXTRA := direct.oTFTPIMAGE := /tftpboot/zImage.pal4endififeq ($(CONFIG_SPRUCE),y)ZIMAGE := zImage-TREEZIMAGEINITRD := zImage.initrd-TREEEXTRA := direct.oENTRYPOINT := 0x00800000MISC := misc-spruce.oEND := spruceTFTPIMAGE := /tftpboot/zImage.$(END)endififeq ($(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_4xx),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.oobj-$(CONFIG_4xx) += 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# ToolsMKPREP := ../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-PAL4: zvmlinux cp zvmlinux ../images/zImage.pal4zImage.initrd-PAL4: zvmlinux.initrd cp zvmlinux.initrd ../images/zImage.initrd.pal4zImage-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-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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -