xref: /openbmc/linux/arch/hexagon/Makefile (revision 171f1bc7)
1#  Makefile for the Hexagon arch
2
3KBUILD_DEFCONFIG = comet_defconfig
4
5# Do not use GP-relative jumps
6KBUILD_CFLAGS += -G0
7LDFLAGS_vmlinux += -G0
8
9# Do not use single-byte enums; these will overflow.
10KBUILD_CFLAGS += -fno-short-enums
11
12# Modules must use either long-calls, or use pic/plt.
13# Use long-calls for now, it's easier.  And faster.
14# CFLAGS_MODULE += -fPIC
15# LDFLAGS_MODULE += -shared
16CFLAGS_MODULE += -mlong-calls
17
18cflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
19cflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
20cflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
21cflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)
22
23aflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
24aflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
25aflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
26aflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)
27
28ldflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
29ldflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
30ldflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
31ldflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)
32
33KBUILD_CFLAGS += $(cflags-y)
34KBUILD_AFLAGS += $(aflags-y)
35
36#  no KBUILD_LDFLAGS?
37LDFLAGS += $(ldflags-y)
38
39# Thread-info register will be r19.  This value is not configureable;
40# it is hard-coded in several files.
41TIR_NAME := r19
42KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
43KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
44
45LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
46libs-y += $(LIBGCC)
47
48head-y := arch/hexagon/kernel/head.o \
49	arch/hexagon/kernel/init_task.o
50
51core-y += arch/hexagon/kernel/ \
52	arch/hexagon/mm/ \
53	arch/hexagon/lib/
54
55#	arch/hexagon/platform/common/
56#
57#core-$(CONFIG_HEXAGON_COMET)		+= arch/hexagon/platform/comet/
58#machine-$(CONFIG_HEXAGON_COMET)		:= comet
59