Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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/arch-$(arch-y) -Iarch/cris/include/arch-$(arch-y)/arch
  23. else
  24. SARCH :=
  25. inc :=
  26. endif
  27. ifneq ($(mach-y),)
  28. MACH := mach-$(mach-y)
  29. inc += -Iarch/cris/include/$(SARCH)/$(MACH)/
  30. inc += -Iarch/cris/include/$(SARCH)/$(MACH)/mach
  31. else
  32. MACH :=
  33. endif
  34. LD = $(CROSS_COMPILE)ld -mcrislinux
  35. OBJCOPYFLAGS := -O binary -R .note -R .comment -S
  36. CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
  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/$(ARCH)/$(SARCH)/kernel/head.o
  45. LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a)
  46. core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
  47. core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/
  48. ifdef CONFIG_ETRAX_ARCH_V32
  49. core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/
  50. endif
  51. drivers-y += arch/$(ARCH)/$(SARCH)/drivers/
  52. libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC)
  53. # cris source path
  54. SRC_ARCH = $(srctree)/arch/$(ARCH)
  55. # cris object files path
  56. OBJ_ARCH = $(objtree)/arch/$(ARCH)
  57. boot := arch/$(ARCH)/boot
  58. MACHINE := arch/$(ARCH)/$(SARCH)
  59. all: zImage
  60. zImage Image: vmlinux
  61. $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
  62. archprepare: $(SRC_ARCH)/.links FORCE
  63. # Create some links to make all tools happy
  64. $(SRC_ARCH)/.links:
  65. @rm -rf $(SRC_ARCH)/drivers
  66. @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers
  67. @rm -rf $(SRC_ARCH)/boot
  68. @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot
  69. @rm -rf $(SRC_ARCH)/lib
  70. @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib
  71. @rm -f $(SRC_ARCH)/arch/mach
  72. @rm -rf $(SRC_ARCH)/arch
  73. @ln -sfn $(SARCH) $(SRC_ARCH)/arch
  74. ifdef CONFIG_ETRAX_ARCH_V32
  75. @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach
  76. endif
  77. @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S
  78. @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S
  79. @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c
  80. @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c
  81. @touch $@
  82. archclean:
  83. $(Q)if [ -e arch/$(ARCH)/boot ]; then \
  84. $(MAKE) $(clean)=arch/$(ARCH)/boot; \
  85. fi
  86. CLEAN_FILES += \
  87. $(MACHINE)/boot/zImage \
  88. $(MACHINE)/boot/compressed/decompress.bin \
  89. $(MACHINE)/boot/compressed/piggy.gz \
  90. $(MACHINE)/boot/rescue/rescue.bin \
  91. $(SRC_ARCH)/.links
  92. MRPROPER_FILES += \
  93. $(SRC_ARCH)/drivers \
  94. $(SRC_ARCH)/boot \
  95. $(SRC_ARCH)/lib \
  96. $(SRC_ARCH)/arch \
  97. $(SRC_ARCH)/kernel/vmlinux.lds.S \
  98. $(SRC_ARCH)/kernel/asm-offsets.c
  99. define archhelp
  100. echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
  101. echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
  102. endef