Makefile_32 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #
  2. # linux/arch/x86/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinux image from the original vmlinux
  5. #
  6. targets := vmlinux vmlinux.bin vmlinux.bin.gz head_32.o misc_32.o piggy.o \
  7. vmlinux.bin.all vmlinux.relocs
  8. EXTRA_AFLAGS := -traditional
  9. LDFLAGS_vmlinux := -T
  10. hostprogs-y := relocs
  11. CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
  12. -fno-strict-aliasing -fPIC \
  13. $(call cc-option,-ffreestanding) \
  14. $(call cc-option,-fno-stack-protector)
  15. LDFLAGS := -m elf_i386
  16. $(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/misc_32.o $(obj)/piggy.o FORCE
  17. $(call if_changed,ld)
  18. @:
  19. $(obj)/vmlinux.bin: vmlinux FORCE
  20. $(call if_changed,objcopy)
  21. quiet_cmd_relocs = RELOCS $@
  22. cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $<
  23. $(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE
  24. $(call if_changed,relocs)
  25. vmlinux.bin.all-y := $(obj)/vmlinux.bin
  26. vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs
  27. quiet_cmd_relocbin = BUILD $@
  28. cmd_relocbin = cat $(filter-out FORCE,$^) > $@
  29. $(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
  30. $(call if_changed,relocbin)
  31. ifdef CONFIG_RELOCATABLE
  32. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
  33. $(call if_changed,gzip)
  34. else
  35. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  36. $(call if_changed,gzip)
  37. endif
  38. LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
  39. $(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.gz FORCE
  40. $(call if_changed,ld)