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