1OBJCOPYFLAGS :=-O binary 2GZFLAGS :=-9 3KBUILD_DEFCONFIG := defconfig 4 5ifdef CONFIG_CPU_HAS_FPU 6FPUEXT = f 7endif 8 9ifdef CONFIG_CPU_HAS_VDSP 10VDSPEXT = v 11endif 12 13ifdef CONFIG_CPU_HAS_TEE 14TEEEXT = t 15endif 16 17ifdef CONFIG_CPU_CK610 18CPUTYPE = ck610 19CSKYABI = abiv1 20endif 21 22ifdef CONFIG_CPU_CK810 23CPUTYPE = ck810 24CSKYABI = abiv2 25endif 26 27ifdef CONFIG_CPU_CK807 28CPUTYPE = ck807 29CSKYABI = abiv2 30endif 31 32ifdef CONFIG_CPU_CK860 33CPUTYPE = ck860 34CSKYABI = abiv2 35endif 36 37ifneq ($(CSKYABI),) 38MCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEEXT) 39KBUILD_CFLAGS += -mcpu=$(MCPU_STR) 40KBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_STR)\" 41KBUILD_CFLAGS += -msoft-float -mdiv 42KBUILD_CFLAGS += -fno-tree-vectorize 43endif 44 45KBUILD_CFLAGS += -pipe 46ifeq ($(CSKYABI),abiv2) 47KBUILD_CFLAGS += -mno-stack-size 48endif 49 50abidirs := $(patsubst %,arch/csky/%/,$(CSKYABI)) 51KBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%inc,$(abidirs)) 52 53KBUILD_CPPFLAGS += -mlittle-endian 54LDFLAGS += -EL 55 56KBUILD_AFLAGS += $(KBUILD_CFLAGS) 57 58head-y := arch/csky/kernel/head.o 59 60core-y += arch/csky/kernel/ 61core-y += arch/csky/mm/ 62core-y += arch/csky/$(CSKYABI)/ 63 64libs-y += arch/csky/lib/ \ 65 $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) 66 67boot := arch/csky/boot 68ifneq '$(CONFIG_CSKY_BUILTIN_DTB)' '""' 69core-y += $(boot)/dts/ 70endif 71 72all: zImage 73 74 75dtbs: scripts 76 $(Q)$(MAKE) $(build)=$(boot)/dts 77 78%.dtb %.dtb.S %.dtb.o: scripts 79 $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ 80 81zImage Image uImage: vmlinux dtbs 82 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 83 84archclean: 85 $(Q)$(MAKE) $(clean)=$(boot) 86 $(Q)$(MAKE) $(clean)=$(boot)/dts 87 rm -rf arch/csky/include/generated 88 89define archhelp 90 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 91 echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' 92 echo ' uImage - U-Boot wrapped zImage' 93endef 94