Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #
  2. # linux/arch/sh/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinux image from the original vmlinux
  5. #
  6. targets := vmlinux vmlinux.bin vmlinux.bin.gz \
  7. vmlinux.bin.bz2 vmlinux.bin.lzma \
  8. vmlinux.bin.xz vmlinux.bin.lzo \
  9. head_$(BITS).o misc.o piggy.o
  10. OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
  11. GCOV_PROFILE := n
  12. #
  13. # IMAGE_OFFSET is the load offset of the compression loader
  14. #
  15. ifeq ($(CONFIG_32BIT),y)
  16. IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
  17. $$[$(CONFIG_MEMORY_START) + \
  18. $(CONFIG_BOOT_LINK_OFFSET)]')
  19. else
  20. IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
  21. $$[$(CONFIG_PAGE_OFFSET) + \
  22. $(KERNEL_MEMORY) + \
  23. $(CONFIG_BOOT_LINK_OFFSET)]')
  24. endif
  25. ifeq ($(CONFIG_MCOUNT),y)
  26. ORIG_CFLAGS := $(KBUILD_CFLAGS)
  27. KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
  28. endif
  29. LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
  30. -T $(obj)/../../kernel/vmlinux.lds
  31. #
  32. # Pull in the necessary libgcc bits from the in-kernel implementation.
  33. #
  34. lib1funcs-$(CONFIG_SUPERH32) := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S \
  35. lshrsi3.S
  36. lib1funcs-obj := \
  37. $(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
  38. lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib
  39. ifeq ($(BITS),64)
  40. lib1funcs-dir := $(addsuffix $(BITS), $(lib1funcs-dir))
  41. endif
  42. KBUILD_CFLAGS += -I$(lib1funcs-dir)
  43. $(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
  44. $(call cmd,shipped)
  45. $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
  46. $(call if_changed,ld)
  47. @:
  48. $(obj)/vmlinux.bin: vmlinux FORCE
  49. $(call if_changed,objcopy)
  50. vmlinux.bin.all-y := $(obj)/vmlinux.bin
  51. $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
  52. $(call if_changed,gzip)
  53. $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
  54. $(call if_changed,bzip2)
  55. $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
  56. $(call if_changed,lzma)
  57. $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
  58. $(call if_changed,xzkern)
  59. $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
  60. $(call if_changed,lzo)
  61. OBJCOPYFLAGS += -R .empty_zero_page
  62. LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
  63. $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
  64. $(call if_changed,ld)