summaryrefslogtreecommitdiff
path: root/arch/kvx/Makefile
blob: 643ef28553fbf00f3baa725acbef3b16512c6cf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
KBUILD_DEFCONFIG := generic_defconfig

KBUILD_CPPFLAGS += -fno-strict-aliasing

board-$(CONFIG_GENERIC) := generic

KALLSYMS += --symbol-prefix=_

ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE    := kvx-elf-
endif

DEFAULT_CFLAGS := -nostdlib -fno-builtin -fstrict-align -g
DEFAULT_CFLAGS += -DTEXT_BASE=$(CONFIG_TEXT_BASE)

LIBGCC_PATH = $(dir $(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name))

KBUILD_CFLAGS += $(DEFAULT_CFLAGS)
KBUILD_AFLAGS += $(DEFAULT_CFLAGS)

KBUILD_LDFLAGS += -m elf64kvx

archprepare: maketools

PHONY += maketools

common-y += arch/kvx/lib/
common-y += arch/kvx/cpu/
common-$(CONFIG_OFTREE) += arch/kvx/dts/

lds-y += arch/kvx/cpu/barebox.lds

cmd_barebox__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_barebox) -o $@ \
      -T $(BAREBOX_LDS) \
      --whole-archive $(BAREBOX_OBJS) --no-while-archive \
      -L$(LIBGCC_PATH) -lgcc \
      $(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^)