xref: /openbmc/linux/arch/csky/Makefile (revision 0ea2dc7c)
1c32e64e8SGuo RenOBJCOPYFLAGS		:=-O binary
2c32e64e8SGuo RenGZFLAGS			:=-9
3c32e64e8SGuo RenKBUILD_DEFCONFIG	:= defconfig
4c32e64e8SGuo Ren
5c32e64e8SGuo Renifdef CONFIG_CPU_HAS_FPU
6c32e64e8SGuo RenFPUEXT = f
7c32e64e8SGuo Renendif
8c32e64e8SGuo Ren
9c32e64e8SGuo Renifdef CONFIG_CPU_HAS_VDSP
10c32e64e8SGuo RenVDSPEXT = v
11c32e64e8SGuo Renendif
12c32e64e8SGuo Ren
13c32e64e8SGuo Renifdef CONFIG_CPU_HAS_TEE
14c32e64e8SGuo RenTEEEXT = t
15c32e64e8SGuo Renendif
16c32e64e8SGuo Ren
17c32e64e8SGuo Renifdef CONFIG_CPU_CK610
18c32e64e8SGuo RenCPUTYPE	= ck610
19c32e64e8SGuo RenCSKYABI	= abiv1
20c32e64e8SGuo Renendif
21c32e64e8SGuo Ren
22c32e64e8SGuo Renifdef CONFIG_CPU_CK810
23c32e64e8SGuo RenCPUTYPE = ck810
24c32e64e8SGuo RenCSKYABI	= abiv2
25c32e64e8SGuo Renendif
26c32e64e8SGuo Ren
27c32e64e8SGuo Renifdef CONFIG_CPU_CK807
28c32e64e8SGuo RenCPUTYPE = ck807
29c32e64e8SGuo RenCSKYABI	= abiv2
30c32e64e8SGuo Renendif
31c32e64e8SGuo Ren
32c32e64e8SGuo Renifdef CONFIG_CPU_CK860
33c32e64e8SGuo RenCPUTYPE = ck860
34c32e64e8SGuo RenCSKYABI	= abiv2
35c32e64e8SGuo Renendif
36c32e64e8SGuo Ren
37c32e64e8SGuo Renifneq ($(CSKYABI),)
38c32e64e8SGuo RenMCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEEXT)
39c32e64e8SGuo RenKBUILD_CFLAGS += -mcpu=$(MCPU_STR)
40c32e64e8SGuo RenKBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_STR)\"
41c32e64e8SGuo RenKBUILD_CFLAGS += -msoft-float -mdiv
42c32e64e8SGuo RenKBUILD_CFLAGS += -fno-tree-vectorize
43c32e64e8SGuo Renendif
44c32e64e8SGuo Ren
45c32e64e8SGuo RenKBUILD_CFLAGS += -pipe
46c32e64e8SGuo Renifeq ($(CSKYABI),abiv2)
47c32e64e8SGuo RenKBUILD_CFLAGS += -mno-stack-size
48c32e64e8SGuo Renendif
49c32e64e8SGuo Ren
500ea2dc7cSGuo Renifdef CONFIG_STACKTRACE
510ea2dc7cSGuo RenKBUILD_CFLAGS += -mbacktrace
520ea2dc7cSGuo Renendif
530ea2dc7cSGuo Ren
54c32e64e8SGuo Renabidirs := $(patsubst %,arch/csky/%/,$(CSKYABI))
55c32e64e8SGuo RenKBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%inc,$(abidirs))
56c32e64e8SGuo Ren
57c32e64e8SGuo RenKBUILD_CPPFLAGS += -mlittle-endian
58c32e64e8SGuo RenLDFLAGS += -EL
59c32e64e8SGuo Ren
60c32e64e8SGuo RenKBUILD_AFLAGS += $(KBUILD_CFLAGS)
61c32e64e8SGuo Ren
62c32e64e8SGuo Renhead-y := arch/csky/kernel/head.o
63c32e64e8SGuo Ren
64c32e64e8SGuo Rencore-y += arch/csky/kernel/
65c32e64e8SGuo Rencore-y += arch/csky/mm/
66c32e64e8SGuo Rencore-y += arch/csky/$(CSKYABI)/
67c32e64e8SGuo Ren
68c32e64e8SGuo Renlibs-y += arch/csky/lib/ \
69c32e64e8SGuo Ren	$(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
70c32e64e8SGuo Ren
71c32e64e8SGuo Renboot := arch/csky/boot
72c32e64e8SGuo Rencore-y += $(boot)/dts/
73c32e64e8SGuo Ren
74c32e64e8SGuo Renall: zImage
75c32e64e8SGuo Ren
76e8d0c9a7SGuo RenzImage Image uImage: vmlinux
77c32e64e8SGuo Ren	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
78c32e64e8SGuo Ren
79c32e64e8SGuo Renarchclean:
80c32e64e8SGuo Ren	$(Q)$(MAKE) $(clean)=$(boot)
81c32e64e8SGuo Ren
82c32e64e8SGuo Rendefine archhelp
83c32e64e8SGuo Ren  echo  '* zImage       - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
84c32e64e8SGuo Ren  echo  '  Image        - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
85c32e64e8SGuo Ren  echo  '  uImage       - U-Boot wrapped zImage'
86c32e64e8SGuo Renendef
87