Makefile
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:4k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. # BK Id: SCCS/s.Makefile 1.19 01/16/02 11:08:07 trini
  2. #
  3. # Makefile for making XCOFF bootable images for booting on PowerMacs
  4. # using Open Firmware.
  5. #
  6. # Paul Mackerras January 1997
  7. #
  8. # Cleaned up, moved into arch/ppc/boot/pmac
  9. # Tom Rini January 2001
  10. OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
  11. COFF_LD_ARGS = -T ../ld.script -e _start -Ttext 0x00500000 -Bstatic
  12. CHRP_LD_ARGS = -T ../ld.script -Ttext 0x01000000
  13. COMMONOBJS = start.o misc.o ../common/string.o ../common/ofcommon.o
  14. COFFOBJS = ../common/coffcrt0.o $(COMMONOBJS) coffmain.o
  15. CHRPOBJS = ../common/crt0.o $(COMMONOBJS) chrpmain.o
  16. LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
  17. MKNOTE := ../utils/mknote
  18. SIZE := ../utils/size
  19. OFFSET := ../utils/offset
  20. HACKCOFF := ../utils/hack-coff
  21. ifdef CONFIG_SMP
  22. END := .smp
  23. endif
  24. ifdef CONFIG_PPC64BRIDGE
  25. END += .64
  26. endif
  27. TFTPIMAGE=/tftpboot/zImage.pmac$(END)
  28. AFLAGS_../common/crt0.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
  29. ../common/coffcrt0.o:
  30. $(MAKE) -C ../common coffcrt0.o
  31. image.o: ../images/vmlinux.gz ../common/dummy.o
  32. $(OBJCOPY) ../common/dummy.o $@ -R .comment 
  33. --add-section=.image=../images/vmlinux.gz 
  34. --set-section-flags=.image=contents,alloc,load,readonly,data
  35. ifdef CONFIG_XMON
  36. $(OBJCOPY) $@ $@ 
  37. --add-section=.sysmap=$(TOPDIR)/System.map 
  38. --set-section-flags=.sysmap=contents,alloc,load,readonly,data
  39. endif
  40. znetboot: vmlinux.coff vmlinux.elf-pmac zImage
  41. cp ../images/vmlinux.coff $(TFTPIMAGE)
  42. cp ../images/vmlinux.elf-pmac $(TFTPIMAGE).elf
  43. znetboot.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac
  44. cp ../images/vmlinux.initrd.coff $(TFTPIMAGE)
  45. cp ../images/vmlinux.initrd.elf-pmac $(TFTPIMAGE).elf
  46. miboot.image: ../common/dummy.o ../images/vmlinux.gz
  47. $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=../images/vmlinux.gz 
  48. ../common/dummy.o ../images/$@
  49. miboot.initrd.image: miboot.image ../images/ramdisk.image.gz
  50. $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=../images/ramdisk.image.gz 
  51. ../images/miboot.image ../images/$@
  52. coffboot: $(COFFOBJS) image.o $(LIBS) ../ld.script
  53. $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) image.o $(LIBS)
  54. $(OBJCOPY) $@ $@ -R .comment
  55. coffboot.initrd: $(COFFOBJS) image.o $(LIBS) ../ld.script 
  56. ../images/ramdisk.image.gz
  57. $(OBJCOPY) image.o image-coff.o 
  58. --add-section=.ramdisk=../images/ramdisk.image.gz 
  59. --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
  60. $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) image-coff.o $(LIBS)
  61. $(OBJCOPY) $@ $@ -R .comment
  62. rm -f image-coff.o
  63. vmlinux.coff: coffboot $(HACKCOFF)
  64. $(OBJCOPY) $(OBJCOPY_ARGS) coffboot ../images/$@
  65. $(HACKCOFF) ../images/$@
  66. rm -f coffboot
  67. ln -sf vmlinux.coff ../images/zImage.pmac
  68. vmlinux.initrd.coff: coffboot.initrd $(HACKCOFF)
  69. $(OBJCOPY) $(OBJCOPY_ARGS) coffboot.initrd ../images/$@
  70. $(HACKCOFF) ../images/$@
  71. rm -f coffboot.initrd
  72. ln -sf vmlinux.initrd.coff ../images/zImage.initrd.pmac
  73. vmlinux.elf-pmac: $(CHRPOBJS) $(LIBS) $(MKNOTE) image.o
  74. $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) $(LIBS) image.o
  75. $(MKNOTE) > note
  76. $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note 
  77. -R .comment -R .ramdisk
  78. rm -f note
  79. vmlinux.initrd.elf-pmac: $(CHRPOBJS) $(LIBS) $(MKNOTE) image.o 
  80. ../images/ramdisk.image.gz
  81. $(OBJCOPY) image.o image-elf.o 
  82. --add-section=.ramdisk=../images/ramdisk.image.gz 
  83. --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
  84. $(LD) $(CHRP_LD_ARGS) -o ../images/$@ $(CHRPOBJS) $(LIBS) image-elf.o
  85. $(MKNOTE) > note
  86. $(OBJCOPY) ../images/$@ ../images/$@ --add-section=.note=note 
  87. -R .comment
  88. rm -f note image-elf.o
  89. zImage: vmlinux.coff vmlinux.elf-pmac miboot.image
  90. zImage.initrd: vmlinux.initrd.coff vmlinux.initrd.elf-pmac miboot.initrd.image
  91. include $(TOPDIR)/Rules.make