Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #
  2. # arch/alpha/boot/Makefile
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License. See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. # Copyright (C) 1994 by Linus Torvalds
  9. #
  10. hostprogs-y := tools/mkbb tools/objstrip
  11. targets := vmlinux.gz vmlinux \
  12. vmlinux.nh tools/lxboot tools/bootlx tools/bootph \
  13. tools/bootpzh bootloader bootpheader bootpzheader
  14. OBJSTRIP := $(obj)/tools/objstrip
  15. # SRM bootable image. Copy to offset 512 of a partition.
  16. $(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh
  17. ( cat $(obj)/tools/lxboot $(obj)/tools/bootlx $(obj)/vmlinux.nh ) > $@
  18. $(obj)/tools/mkbb $@ $(obj)/tools/lxboot
  19. @echo ' Bootimage $@ is ready'
  20. # BOOTP bootable image. Define INITRD during make to append initrd image.
  21. $(obj)/bootpfile: $(obj)/tools/bootph $(obj)/vmlinux.nh
  22. cat $(obj)/tools/bootph $(obj)/vmlinux.nh > $@
  23. ifdef INITRD
  24. cat $(INITRD) >> $@
  25. endif
  26. # Compressed kernel BOOTP bootable image.
  27. # Define INITRD during make to append initrd image.
  28. $(obj)/bootpzfile: $(obj)/tools/bootpzh $(obj)/vmlinux.nh.gz
  29. cat $(obj)/tools/bootpzh $(obj)/vmlinux.nh.gz > $@
  30. ifdef INITRD
  31. cat $(INITRD) >> $@
  32. endif
  33. # Compressed kernel image
  34. $(obj)/vmlinux.gz: $(obj)/vmlinux FORCE
  35. $(call if_changed,gzip)
  36. @echo ' Kernel $@ is ready'
  37. $(obj)/main.o: $(obj)/ksize.h
  38. $(obj)/bootp.o: $(obj)/ksize.h
  39. $(obj)/bootpz.o: $(obj)/kzsize.h
  40. $(obj)/ksize.h: $(obj)/vmlinux.nh FORCE
  41. echo "#define KERNEL_SIZE `ls -l $(obj)/vmlinux.nh | awk '{print $$5}'`" > $@T
  42. ifdef INITRD
  43. [ -f $(INITRD) ] || exit 1
  44. echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T
  45. endif
  46. cmp -s $@T $@ || mv -f $@T $@
  47. rm -f $@T
  48. $(obj)/kzsize.h: $(obj)/vmlinux.nh.gz FORCE
  49. echo "#define KERNEL_SIZE `ls -l $(obj)/vmlinux.nh | awk '{print $$5}'`" > $@T
  50. echo "#define KERNEL_Z_SIZE `ls -l $(obj)/vmlinux.nh.gz | awk '{print $$5}'`" >> $@T
  51. ifdef INITRD
  52. [ -f $(INITRD) ] || exit 1
  53. echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T
  54. endif
  55. cmp -s $@T $@ || mv -f $@T $@
  56. rm -f $@T
  57. quiet_cmd_strip = STRIP $@
  58. cmd_strip = $(STRIP) -o $@ $<
  59. $(obj)/vmlinux: vmlinux FORCE
  60. $(call if_changed,strip)
  61. quiet_cmd_objstrip = OBJSTRIP $@
  62. cmd_objstrip = $(OBJSTRIP) $(OSFLAGS_$(@F)) $< $@
  63. OSFLAGS_vmlinux.nh := -v
  64. OSFLAGS_lxboot := -p
  65. OSFLAGS_bootlx := -vb
  66. OSFLAGS_bootph := -vb
  67. OSFLAGS_bootpzh := -vb
  68. $(obj)/vmlinux.nh: vmlinux $(OBJSTRIP) FORCE
  69. $(call if_changed,objstrip)
  70. $(obj)/vmlinux.nh.gz: $(obj)/vmlinux.nh FORCE
  71. $(call if_changed,gzip)
  72. $(obj)/tools/lxboot: $(obj)/bootloader $(OBJSTRIP) FORCE
  73. $(call if_changed,objstrip)
  74. $(obj)/tools/bootlx: $(obj)/bootloader $(OBJSTRIP) FORCE
  75. $(call if_changed,objstrip)
  76. $(obj)/tools/bootph: $(obj)/bootpheader $(OBJSTRIP) FORCE
  77. $(call if_changed,objstrip)
  78. $(obj)/tools/bootpzh: $(obj)/bootpzheader $(OBJSTRIP) FORCE
  79. $(call if_changed,objstrip)
  80. LDFLAGS_bootloader := -static -uvsprintf -T #-N -relax
  81. LDFLAGS_bootpheader := -static -uvsprintf -T #-N -relax
  82. LDFLAGS_bootpzheader := -static -uvsprintf -T #-N -relax
  83. OBJ_bootlx := $(obj)/head.o $(obj)/main.o
  84. OBJ_bootph := $(obj)/head.o $(obj)/bootp.o
  85. OBJ_bootpzh := $(obj)/head.o $(obj)/bootpz.o $(obj)/misc.o
  86. $(obj)/bootloader: $(obj)/bootloader.lds $(OBJ_bootlx) $(LIBS_Y) FORCE
  87. $(call if_changed,ld)
  88. $(obj)/bootpheader: $(obj)/bootloader.lds $(OBJ_bootph) $(LIBS_Y) FORCE
  89. $(call if_changed,ld)
  90. $(obj)/bootpzheader: $(obj)/bootloader.lds $(OBJ_bootpzh) $(LIBS_Y) FORCE
  91. $(call if_changed,ld)
  92. $(obj)/misc.o: lib/inflate.c