Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # arch/sh/boot/Makefile
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License. See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. # Copyright (C) 1999 Stuart Menefy
  9. #
  10. MKIMAGE := $(srctree)/scripts/mkuboot.sh
  11. #
  12. # Assign safe dummy values if these variables are not defined,
  13. # in order to suppress error message.
  14. #
  15. CONFIG_PAGE_OFFSET ?= 0x80000000
  16. CONFIG_MEMORY_START ?= 0x0c000000
  17. CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
  18. CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
  19. export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
  20. CONFIG_ZERO_PAGE_OFFSET
  21. targets := zImage vmlinux.srec uImage uImage.srec
  22. subdir- := compressed
  23. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  24. $(call if_changed,objcopy)
  25. @echo ' Kernel: $@ is ready'
  26. $(obj)/compressed/vmlinux: FORCE
  27. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  28. KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
  29. $$[$(CONFIG_PAGE_OFFSET) + \
  30. $(CONFIG_MEMORY_START) + \
  31. $(CONFIG_ZERO_PAGE_OFFSET)]')
  32. KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
  33. $$[$(CONFIG_PAGE_OFFSET) + \
  34. $(CONFIG_MEMORY_START) + \
  35. $(CONFIG_ZERO_PAGE_OFFSET)+0x1000]')
  36. quiet_cmd_uimage = UIMAGE $@
  37. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
  38. -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
  39. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  40. $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
  41. $(call if_changed,uimage)
  42. @echo ' Image $@ is ready'
  43. $(obj)/vmlinux.bin: vmlinux FORCE
  44. $(call if_changed,objcopy)
  45. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  46. $(call if_changed,gzip)
  47. OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
  48. $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
  49. $(call if_changed,objcopy)
  50. OBJCOPYFLAGS_uImage.srec := -I binary -O srec
  51. $(obj)/uImage.srec: $(obj)/uImage
  52. $(call if_changed,objcopy)
  53. clean-files += uImage uImage.srec vmlinux.srec \
  54. vmlinux.bin vmlinux.bin.gz