Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. EXTRA_AFLAGS := -traditional
  8. OBJECTS = $(obj)/head.o $(obj)/misc.o
  9. ifdef CONFIG_SH_STANDARD_BIOS
  10. OBJECTS += $(obj)/../../kernel/sh_bios.o
  11. endif
  12. #
  13. # IMAGE_OFFSET is the load offset of the compression loader
  14. #
  15. IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_PAGE_OFFSET) + \
  16. $(CONFIG_MEMORY_START) + \
  17. $(CONFIG_BOOT_LINK_OFFSET)])
  18. LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
  19. LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds
  20. $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
  21. $(call if_changed,ld)
  22. @:
  23. $(obj)/vmlinux.bin: vmlinux FORCE
  24. $(call if_changed,objcopy)
  25. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  26. $(call if_changed,gzip)
  27. LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T
  28. OBJCOPYFLAGS += -R .empty_zero_page
  29. $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
  30. $(call if_changed,ld)