Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # linux/arch/sh/boot/compressed/Makefile
  4. #
  5. # create a compressed vmlinux image from the original vmlinux
  6. #
  7. OBJECTS := head_32.o misc.o cache.o piggy.o \
  8. ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o
  9. # These were previously generated files. When you are building the kernel
  10. # with O=, make sure to remove the stale files in the output tree. Otherwise,
  11. # the build system wrongly compiles the stale ones.
  12. ifdef building_out_of_srctree
  13. $(shell rm -f $(addprefix $(obj)/, ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S))
  14. endif
  15. targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
  16. vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS)
  17. GCOV_PROFILE := n
  18. #
  19. # IMAGE_OFFSET is the load offset of the compression loader
  20. #
  21. ifeq ($(CONFIG_32BIT),y)
  22. IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
  23. $$[$(CONFIG_MEMORY_START) + \
  24. $(CONFIG_BOOT_LINK_OFFSET)]')
  25. else
  26. IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
  27. $$[$(CONFIG_PAGE_OFFSET) + \
  28. $(KERNEL_MEMORY) + \
  29. $(CONFIG_BOOT_LINK_OFFSET)]')
  30. endif
  31. ccflags-remove-$(CONFIG_MCOUNT) += -pg
  32. LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
  33. -T $(obj)/../../kernel/vmlinux.lds
  34. KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
  35. $(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE
  36. $(call if_changed,ld)
  37. $(obj)/vmlinux.bin: vmlinux FORCE
  38. $(call if_changed,objcopy)
  39. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  40. $(call if_changed,gzip)
  41. $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
  42. $(call if_changed,bzip2_with_size)
  43. $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
  44. $(call if_changed,lzma_with_size)
  45. $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
  46. $(call if_changed,xzkern_with_size)
  47. $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
  48. $(call if_changed,lzo_with_size)
  49. OBJCOPYFLAGS += -R .empty_zero_page
  50. LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
  51. $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
  52. $(call if_changed,ld)