Makefile 2.4 KB

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