Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # linux/arch/m32r/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinux image from the original vmlinux
  5. #
  6. targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
  7. vmlinux.bin.lzma head.o misc.o piggy.o vmlinux.lds
  8. OBJECTS = $(obj)/head.o $(obj)/misc.o
  9. #
  10. # IMAGE_OFFSET is the load offset of the compression loader
  11. #
  12. #IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x2000])
  13. #IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x00400000])
  14. LDFLAGS_vmlinux := -T
  15. $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/piggy.o FORCE
  16. $(call if_changed,ld)
  17. @:
  18. $(obj)/vmlinux.bin: vmlinux FORCE
  19. $(call if_changed,objcopy)
  20. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  21. $(call if_changed,gzip)
  22. $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
  23. $(call if_changed,bzip2)
  24. $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
  25. $(call if_changed,lzma)
  26. CFLAGS_misc.o += -fpic
  27. ifdef CONFIG_MMU
  28. LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r-linux -T
  29. else
  30. LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r -T
  31. endif
  32. OBJCOPYFLAGS += -R .empty_zero_page
  33. suffix-$(CONFIG_KERNEL_GZIP) = gz
  34. suffix-$(CONFIG_KERNEL_BZIP2) = bz2
  35. suffix-$(CONFIG_KERNEL_LZMA) = lzma
  36. $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
  37. $(call if_changed,ld)