Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #
  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. arch-y := v10
  13. arch-$(CONFIG_ETRAX_ARCH_V10) := v10
  14. arch-$(CONFIG_ETRAX_ARCH_V32) := v32
  15. # No config available for make clean etc
  16. mach-y := fs
  17. mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3
  18. mach-$(CONFIG_ETRAXFS) := fs
  19. ifneq ($(arch-y),)
  20. SARCH := arch-$(arch-y)
  21. else
  22. SARCH :=
  23. endif
  24. ifneq ($(mach-y),)
  25. MACH := mach-$(mach-y)
  26. else
  27. MACH :=
  28. endif
  29. LD = $(CROSS_COMPILE)ld -mcrislinux
  30. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  31. CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
  32. KBUILD_AFLAGS += -mlinux -march=$(arch-y) -Iinclude/asm/arch/mach -Iinclude/asm/arch
  33. KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe -Iinclude/asm/arch/mach -Iinclude/asm/arch
  34. ifdef CONFIG_FRAME_POINTER
  35. KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
  36. KBUILD_CFLAGS += -fno-omit-frame-pointer
  37. endif
  38. head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o
  39. LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
  40. core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
  41. core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
  42. ifdef CONFIG_ETRAX_ARCH_V32
  43. core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/
  44. endif
  45. drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
  46. libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
  47. # cris source path
  48. SRC_ARCH = $(srctree)/arch/$(ARCH)
  49. # cris object files path
  50. OBJ_ARCH = $(objtree)/arch/$(ARCH)
  51. boot := arch/$(ARCH)/boot
  52. MACHINE := arch/$(ARCH)/$(SARCH)
  53. all: zImage
  54. zImage Image: vmlinux
  55. $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
  56. archprepare: $(SRC_ARCH)/.links $(srctree)/include/asm-$(ARCH)/.arch FORCE
  57. # Create some links to make all tools happy
  58. $(SRC_ARCH)/.links:
  59. @rm -rf $(SRC_ARCH)/drivers
  60. @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers
  61. @rm -rf $(SRC_ARCH)/boot
  62. @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot
  63. @rm -rf $(SRC_ARCH)/lib
  64. @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib
  65. @rm -f $(SRC_ARCH)/arch/mach
  66. @rm -rf $(SRC_ARCH)/arch
  67. @ln -sfn $(SARCH) $(SRC_ARCH)/arch
  68. ifdef CONFIG_ETRAX_ARCH_V32
  69. @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach
  70. endif
  71. @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
  72. @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
  73. @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c
  74. @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
  75. @touch $@
  76. # Create link to sub arch includes
  77. $(srctree)/include/asm-$(ARCH)/.arch: $(wildcard include/config/arch/*.h)
  78. @echo ' SYMLINK include/asm-$(ARCH)/arch -> include/asm-$(ARCH)/$(SARCH)'
  79. @rm -f $(srctree)/include/asm-$(ARCH)/arch/mach
  80. @rm -f $(srctree)/include/asm-$(ARCH)/arch
  81. @ln -sf $(SARCH) $(srctree)/include/asm-$(ARCH)/arch
  82. ifdef CONFIG_ETRAX_ARCH_V32
  83. @ln -sf $(MACH) $(srctree)/include/asm-$(ARCH)/arch/mach
  84. endif
  85. @touch $@
  86. archclean:
  87. $(Q)if [ -e arch/$(ARCH)/boot ]; then \
  88. $(MAKE) $(clean)=arch/$(ARCH)/boot; \
  89. fi
  90. CLEAN_FILES += \
  91. $(MACHINE)/boot/zImage \
  92. $(MACHINE)/boot/compressed/decompress.bin \
  93. $(MACHINE)/boot/compressed/piggy.gz \
  94. $(MACHINE)/boot/rescue/rescue.bin \
  95. $(SRC_ARCH)/.links \
  96. $(srctree)/include/asm-$(ARCH)/.arch
  97. MRPROPER_FILES += \
  98. $(SRC_ARCH)/drivers \
  99. $(SRC_ARCH)/boot \
  100. $(SRC_ARCH)/lib \
  101. $(SRC_ARCH)/arch \
  102. $(SRC_ARCH)/kernel/vmlinux.lds.S \
  103. $(SRC_ARCH)/kernel/asm-offsets.c
  104. define archhelp
  105. echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
  106. echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
  107. endef