Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # linux/arch/i386/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinux image from the original vmlinux
  5. #
  6. targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o \
  7. vmlinux.bin.all vmlinux.relocs
  8. EXTRA_AFLAGS := -traditional
  9. LDFLAGS_vmlinux := -T
  10. CFLAGS_misc.o += -fPIC
  11. hostprogs-y := relocs
  12. $(obj)/vmlinux: $(src)/vmlinux.lds $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE
  13. $(call if_changed,ld)
  14. @:
  15. $(obj)/vmlinux.bin: vmlinux FORCE
  16. $(call if_changed,objcopy)
  17. quiet_cmd_relocs = RELOCS $@
  18. cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $<
  19. $(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE
  20. $(call if_changed,relocs)
  21. vmlinux.bin.all-y := $(obj)/vmlinux.bin
  22. vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs
  23. quiet_cmd_relocbin = BUILD $@
  24. cmd_relocbin = cat $(filter-out FORCE,$^) > $@
  25. $(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
  26. $(call if_changed,relocbin)
  27. ifdef CONFIG_RELOCATABLE
  28. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
  29. $(call if_changed,gzip)
  30. else
  31. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  32. $(call if_changed,gzip)
  33. endif
  34. LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
  35. $(obj)/piggy.o: $(src)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
  36. $(call if_changed,ld)