Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # $Id: Makefile,v 1.23 2004/10/19 13:07:34 starvik 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. # No config avaiable for make clean etc
  17. ifneq ($(arch-y),)
  18. SARCH := arch-$(arch-y)
  19. else
  20. SARCH :=
  21. endif
  22. LD = $(CROSS_COMPILE)ld -mcrislinux
  23. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  24. CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
  25. AFLAGS += -mlinux
  26. CFLAGS := $(CFLAGS) -mlinux -march=$(arch-y) -pipe
  27. ifdef CONFIG_FRAME_POINTER
  28. CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) -g
  29. CFLAGS += -fno-omit-frame-pointer
  30. endif
  31. head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
  32. LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
  33. core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
  34. core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
  35. drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
  36. libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
  37. vmlinux.bin: vmlinux
  38. $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
  39. timage: vmlinux.bin
  40. cat vmlinux.bin cramfs.img >timage
  41. simimage: timage
  42. cp vmlinux.bin simvmlinux.bin
  43. # the following will remake timage without compiling the kernel
  44. # it does of course require that all object files exist...
  45. cramfs:
  46. ## cramfs - Creates a cramfs image
  47. mkcramfs -b 8192 -m romfs_meta.txt root cramfs.img
  48. cat vmlinux.bin cramfs.img >timage
  49. clinux: vmlinux.bin decompress.bin rescue.bin
  50. decompress.bin: FORCE
  51. @make -C arch/$(ARCH)/boot/compressed decompress.bin
  52. rescue.bin: FORCE
  53. @make -C arch/$(ARCH)/boot/rescue rescue.bin
  54. zImage: vmlinux.bin rescue.bin
  55. ## zImage - Compressed kernel (gzip)
  56. @make -C arch/$(ARCH)/boot/ zImage
  57. compressed: zImage
  58. archmrproper:
  59. archclean:
  60. $(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot
  61. rm -f timage vmlinux.bin decompress.bin rescue.bin cramfs.img
  62. rm -rf $(LD_SCRIPT).tmp
  63. prepare: arch/$(ARCH)/.links include/asm-$(ARCH)/.arch \
  64. include/asm-$(ARCH)/$(SARCH)/offset.h
  65. # Create some links to make all tools happy
  66. arch/$(ARCH)/.links:
  67. @rm -rf arch/$(ARCH)/drivers
  68. @ln -sfn $(SARCH)/drivers arch/$(ARCH)/drivers
  69. @rm -rf arch/$(ARCH)/boot
  70. @ln -sfn $(SARCH)/boot arch/$(ARCH)/boot
  71. @rm -rf arch/$(ARCH)/lib
  72. @ln -sfn $(SARCH)/lib arch/$(ARCH)/lib
  73. @ln -sfn $(SARCH) arch/$(ARCH)/arch
  74. @ln -sfn ../$(SARCH)/vmlinux.lds.S arch/$(ARCH)/kernel/vmlinux.lds.S
  75. @touch $@
  76. # Create link to sub arch includes
  77. include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
  78. @echo ' Making asm-$(ARCH)/arch -> asm-$(ARCH)/$(SARCH) symlink'
  79. @rm -f include/asm-$(ARCH)/arch
  80. @ln -sf $(SARCH) include/asm-$(ARCH)/arch
  81. @touch $@
  82. arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
  83. include/config/MARKER
  84. include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s
  85. $(call filechk,gen-asm-offsets)