Files

78 lines
1.5 KiB
Makefile
Raw Permalink Normal View History

# SPDX-License-Identifier: GPL-2.0-only
2018-09-05 14:25:06 +08:00
OBJCOPYFLAGS :=-O binary
GZFLAGS :=-9
ifdef CONFIG_CPU_HAS_FPU
FPUEXT = f
endif
ifdef CONFIG_CPU_HAS_VDSP
VDSPEXT = v
endif
ifdef CONFIG_CPU_HAS_TEE
TEEEXT = t
endif
ifdef CONFIG_CPU_CK610
CPUTYPE = ck610
CSKYABI = abiv1
endif
ifdef CONFIG_CPU_CK810
CPUTYPE = ck810
CSKYABI = abiv2
endif
ifdef CONFIG_CPU_CK807
CPUTYPE = ck807
CSKYABI = abiv2
endif
ifdef CONFIG_CPU_CK860
CPUTYPE = ck860
CSKYABI = abiv2
endif
ifneq ($(CSKYABI),)
MCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEEXT)
2019-02-19 12:32:41 +08:00
KBUILD_CFLAGS += -mcpu=$(CPUTYPE) -Wa,-mcpu=$(MCPU_STR)
2018-09-05 14:25:06 +08:00
KBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_STR)\"
KBUILD_CFLAGS += -msoft-float -mdiv
KBUILD_CFLAGS += -fno-tree-vectorize
endif
KBUILD_CFLAGS += -pipe
ifeq ($(CSKYABI),abiv2)
KBUILD_CFLAGS += -mno-stack-size
endif
2020-05-13 15:15:25 +08:00
ifdef CONFIG_FRAME_POINTER
2018-12-09 14:18:05 +08:00
KBUILD_CFLAGS += -mbacktrace
endif
2018-09-05 14:25:06 +08:00
abidirs := $(patsubst %,arch/csky/%/,$(CSKYABI))
KBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%inc,$(abidirs))
KBUILD_CPPFLAGS += -mlittle-endian
LDFLAGS += -EL
KBUILD_AFLAGS += $(KBUILD_CFLAGS)
core-y += arch/csky/$(CSKYABI)/
libs-y += arch/csky/lib/ \
$(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
boot := arch/csky/boot
all: zImage
2018-10-30 18:46:47 +08:00
zImage Image uImage: vmlinux
2018-09-05 14:25:06 +08:00
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
define archhelp
echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
echo ' uImage - U-Boot wrapped zImage'
endef