Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 head.o misc.o piggy.o
  7. OBJECTS = $(obj)/head.o $(obj)/misc.o
  8. #
  9. # IMAGE_OFFSET is the load offset of the compression loader
  10. # Assign dummy values if these 2 variables are not defined,
  11. # in order to suppress error message.
  12. #
  13. CONFIG_MEMORY_START ?= 0x00400000
  14. CONFIG_BOOT_LINK_OFFSET ?= 0x00280000
  15. IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET))))
  16. LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  17. LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup -T $(obj)/vmlinux.lds \
  18. --defsym output=$(CONFIG_MEMORY_START)
  19. $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
  20. $(call if_changed,ld)
  21. $(obj)/vmlinux.bin: vmlinux FORCE
  22. $(call if_changed,objcopy)
  23. suffix-$(CONFIG_KERNEL_GZIP) := gzip
  24. suffix-$(CONFIG_KERNEL_LZO) := lzo
  25. $(obj)/vmlinux.bin.$(suffix-y): $(obj)/vmlinux.bin FORCE
  26. $(call if_changed,$(suffix-y))
  27. LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T
  28. OBJCOPYFLAGS := -O binary
  29. $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
  30. $(call if_changed,ld)
  31. CFLAGS_misc.o = -O0