Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. KBUILD_DEFCONFIG := etrax-100lx_v2_defconfig
  13. arch-y := v10
  14. arch-$(CONFIG_ETRAX_ARCH_V10) := v10
  15. arch-$(CONFIG_ETRAX_ARCH_V32) := v32
  16. # No config available for make clean etc
  17. mach-y := fs
  18. mach-$(CONFIG_CRIS_MACH_ARTPEC3) := a3
  19. mach-$(CONFIG_ETRAXFS) := fs
  20. ifneq ($(arch-y),)
  21. SARCH := arch-$(arch-y)
  22. inc := -Iarch/cris/include/uapi/$(SARCH)
  23. inc += -Iarch/cris/include/$(SARCH)
  24. inc += -Iarch/cris/include/uapi/$(SARCH)/arch
  25. inc += -Iarch/cris/include/$(SARCH)/arch
  26. else
  27. SARCH :=
  28. inc :=
  29. endif
  30. ifneq ($(mach-y),)
  31. MACH := mach-$(mach-y)
  32. inc += -Iarch/cris/include/$(SARCH)/$(MACH)/
  33. inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach
  34. else
  35. MACH :=
  36. endif
  37. ifneq ($(CONFIG_BUILTIN_DTB),"")
  38. core-$(CONFIG_OF) += arch/cris/boot/dts/
  39. endif
  40. LD = $(CROSS_COMPILE)ld -mcrislinux
  41. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  42. KBUILD_AFLAGS += -mlinux -march=$(arch-y) $(inc)
  43. KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe $(inc)
  44. KBUILD_CPPFLAGS += $(inc)
  45. ifdef CONFIG_FRAME_POINTER
  46. KBUILD_CFLAGS := $(subst -fomit-frame-pointer,,$(KBUILD_CFLAGS)) -g
  47. KBUILD_CFLAGS += -fno-omit-frame-pointer
  48. endif
  49. head-y := arch/cris/$(SARCH)/kernel/head.o
  50. LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
  51. core-y += arch/cris/kernel/ arch/cris/mm/
  52. core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/
  53. ifdef CONFIG_ETRAX_ARCH_V32
  54. core-y += arch/cris/$(SARCH)/$(MACH)/
  55. endif
  56. drivers-y += arch/cris/$(SARCH)/drivers/
  57. libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC)
  58. # cris source path
  59. SRC_ARCH = $(srctree)/arch/cris
  60. # cris object files path
  61. OBJ_ARCH = $(objtree)/arch/cris
  62. boot := arch/cris/boot
  63. MACHINE := arch/cris/$(SARCH)
  64. all: zImage
  65. zImage Image: vmlinux
  66. $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
  67. archprepare:
  68. archclean:
  69. $(Q)if [ -e arch/cris/boot ]; then \
  70. $(MAKE) $(clean)=arch/cris/boot; \
  71. fi
  72. CLEAN_FILES += \
  73. $(boot)/zImage \
  74. $(boot)/compressed/decompress.bin \
  75. $(boot)/compressed/piggy.gz \
  76. $(boot)/rescue/rescue.bin
  77. # MRPROPER_FILES +=
  78. define archhelp
  79. echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)'
  80. echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)'
  81. endef