Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. CONFIG_ENTRY_OFFSET ?= 0x00001000
  20. export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
  21. CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET
  22. targets := zImage vmlinux.srec uImage uImage.srec
  23. subdir- := compressed
  24. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  25. $(call if_changed,objcopy)
  26. @echo ' Kernel: $@ is ready'
  27. $(obj)/compressed/vmlinux: FORCE
  28. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  29. KERNEL_MEMORY := 0x00000000
  30. ifeq ($(CONFIG_PMB_FIXED),y)
  31. KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
  32. $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
  33. endif
  34. ifeq ($(CONFIG_29BIT),y)
  35. KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
  36. $$[$(CONFIG_MEMORY_START)]')
  37. endif
  38. KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
  39. $$[$(CONFIG_PAGE_OFFSET) + \
  40. $(KERNEL_MEMORY) + \
  41. $(CONFIG_ZERO_PAGE_OFFSET)]')
  42. KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
  43. $$[$(CONFIG_PAGE_OFFSET) + \
  44. $(KERNEL_MEMORY) + \
  45. $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
  46. quiet_cmd_uimage = UIMAGE $@
  47. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
  48. -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
  49. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  50. $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
  51. $(call if_changed,uimage)
  52. @echo ' Image $@ is ready'
  53. $(obj)/vmlinux.bin: vmlinux FORCE
  54. $(call if_changed,objcopy)
  55. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  56. $(call if_changed,gzip)
  57. OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
  58. $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
  59. $(call if_changed,objcopy)
  60. OBJCOPYFLAGS_uImage.srec := -I binary -O srec
  61. $(obj)/uImage.srec: $(obj)/uImage
  62. $(call if_changed,objcopy)
  63. clean-files += uImage uImage.srec vmlinux.srec \
  64. vmlinux.bin vmlinux.bin.gz