Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # $Id: Makefile,v 1.28 2005/03/17 10:44:37 larsv Exp $
  2. # cris/Makefile
  3. #
  4. # This file is included by the global makefile so that you can add your own
  5. # architecture-specific flags and dependencies. Remember to do have actions
  6. # for "archclean" and "archdep" for cleaning up and making dependencies for
  7. # this architecture
  8. #
  9. # This file is subject to the terms and conditions of the GNU General Public
  10. # License. See the file "COPYING" in the main directory of this archive
  11. # for more details.
  12. # A bug in ld prevents us from having a (constant-value) symbol in a
  13. # "ORIGIN =" or "LENGTH =" expression.
  14. arch-y := v10
  15. arch-$(CONFIG_ETRAX_ARCH_V10) := v10
  16. arch-$(CONFIG_ETRAX_ARCH_V32) := v32
  17. # No config avaiable for make clean etc
  18. ifneq ($(arch-y),)
  19. SARCH := arch-$(arch-y)
  20. else
  21. SARCH :=
  22. endif
  23. LD = $(CROSS_COMPILE)ld -mcrislinux
  24. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  25. CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
  26. AFLAGS += -mlinux
  27. CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
  28. ifdef CONFIG_FRAME_POINTER
  29. CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
  30. CFLAGS += -fno-omit-frame-pointer
  31. endif
  32. head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
  33. LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
  34. core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
  35. core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
  36. drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
  37. libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
  38. # cris source path
  39. SRC_ARCH = $(srctree)/arch/$(ARCH)
  40. # cris object files path
  41. OBJ_ARCH = $(objtree)/arch/$(ARCH)
  42. target_boot_arch_dir = $(OBJ_ARCH)/$(SARCH)/boot
  43. target_boot_dir = $(OBJ_ARCH)/boot
  44. src_boot_dir = $(SRC_ARCH)/boot
  45. target_compressed_dir = $(OBJ_ARCH)/boot/compressed
  46. src_compressed_dir = $(SRC_ARCH)/boot/compressed
  47. target_rescue_dir = $(OBJ_ARCH)/boot/rescue
  48. src_rescue_dir = $(SRC_ARCH)/boot/rescue
  49. export target_boot_arch_dir target_boot_dir src_boot_dir target_compressed_dir src_compressed_dir target_rescue_dir src_rescue_dir
  50. vmlinux.bin: vmlinux
  51. $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
  52. timage: vmlinux.bin
  53. cat vmlinux.bin cramfs.img >timage
  54. simimage: timage
  55. cp vmlinux.bin simvmlinux.bin
  56. # the following will remake timage without compiling the kernel
  57. # it does of course require that all object files exist...
  58. cramfs:
  59. ## cramfs - Creates a cramfs image
  60. mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img
  61. cat vmlinux.bin cramfs.img >timage
  62. clinux: vmlinux.bin decompress.bin rescue.bin
  63. decompress.bin: $(target_boot_dir)
  64. @$(MAKE) -f $(src_compressed_dir)/Makefile $(target_compressed_dir)/decompress.bin
  65. $(target_rescue_dir)/rescue.bin: $(target_boot_dir)
  66. @$(MAKE) -f $(src_rescue_dir)/Makefile $(target_rescue_dir)/rescue.bin
  67. zImage: $(target_boot_dir) vmlinux.bin $(target_rescue_dir)/rescue.bin
  68. ## zImage - Compressed kernel (gzip)
  69. @$(MAKE) -f $(src_boot_dir)/Makefile zImage
  70. $(target_boot_dir): $(target_boot_arch_dir)
  71. ln -sfn $< $@
  72. $(target_boot_arch_dir):
  73. mkdir -p $@
  74. compressed: zImage
  75. archmrproper:
  76. archclean:
  77. @if [ -d arch/$(ARCH)/boot ]; then \
  78. $(MAKE) $(clean)=arch/$(ARCH)/boot ; \
  79. fi
  80. rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img
  81. rm -rf $(LD_SCRIPT).tmp
  82. archprepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch
  83. # Create some links to make all tools happy
  84. $(SRC_ARCH)/.links:
  85. @rm -rf $(SRC_ARCH)/drivers
  86. @ln -sfn $(SRC_ARCH)/$(SARCH)/drivers $(SRC_ARCH)/drivers
  87. @rm -rf $(SRC_ARCH)/boot
  88. @ln -sfn $(SRC_ARCH)/$(SARCH)/boot $(SRC_ARCH)/boot
  89. @rm -rf $(SRC_ARCH)/lib
  90. @ln -sfn $(SRC_ARCH)/$(SARCH)/lib $(SRC_ARCH)/lib
  91. @ln -sfn $(SRC_ARCH)/$(SARCH) $(SRC_ARCH)/arch
  92. @ln -sfn $(SRC_ARCH)/$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
  93. @ln -sfn $(SRC_ARCH)/$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
  94. @touch $@
  95. # Create link to sub arch includes
  96. $(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
  97. @echo ' Making $(srctree)/include/asm-$(ARCH)/arch -> $(srctree)/include/asm-$(ARCH)/$(SARCH) symlink'
  98. @rm -f include/asm-$(ARCH)/arch
  99. @ln -sf $(srctree)/include/asm-$(ARCH)/$(SARCH) $(srctree)/include/asm-$(ARCH)/arch
  100. @touch $@