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