Makefile 3.8 KB

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