config.mk 1.96 KB
Newer Older
wdenk's avatar
wdenk committed
1
#
2
# (C) Copyright 2000-2013
wdenk's avatar
wdenk committed
3 4
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
5
# SPDX-License-Identifier:	GPL-2.0+
wdenk's avatar
wdenk committed
6 7 8
#
#########################################################################

9 10 11 12 13 14 15 16 17 18 19 20
# This file is included from ./Makefile and spl/Makefile.
# Clean the state to avoid the same flags added twice.
#
# (Tegra needs different flags for SPL.
#  That's the reason why this file must be included from spl/Makefile too.
#  If we did not have Tegra SoCs, build system would be much simpler...)
PLATFORM_RELFLAGS :=
PLATFORM_CPPFLAGS :=
PLATFORM_LDFLAGS :=
LDFLAGS :=
LDFLAGS_FINAL :=
OBJCOPYFLAGS :=
21 22
#########################################################################

23 24 25 26 27 28 29 30 31 32
ARCH := $(CONFIG_SYS_ARCH:"%"=%)
CPU := $(CONFIG_SYS_CPU:"%"=%)
BOARD := $(CONFIG_SYS_BOARD:"%"=%)
ifneq ($(CONFIG_SYS_VENDOR),)
VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
endif
ifneq ($(CONFIG_SYS_SOC),)
SOC := $(CONFIG_SYS_SOC:"%"=%)
endif

Peter Tyser's avatar
Peter Tyser committed
33 34
# Some architecture config.mk files need to know what CPUDIR is set to,
# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
35 36
# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
# CPU-specific code.
37
CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
Peter Tyser's avatar
Peter Tyser committed
38

39 40
sinclude $(srctree)/arch/$(ARCH)/config.mk	# include architecture dependend rules
sinclude $(srctree)/$(CPUDIR)/config.mk		# include  CPU	specific rules
Peter Tyser's avatar
Peter Tyser committed
41

42
ifdef	SOC
43
sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk	# include  SoC	specific rules
44
endif
45
ifneq ($(BOARD),)
46 47 48 49 50
ifdef	VENDOR
BOARDDIR = $(VENDOR)/$(BOARD)
else
BOARDDIR = $(BOARD)
endif
51
endif
52
ifdef	BOARD
53
sinclude $(srctree)/board/$(BOARDDIR)/config.mk	# include board specific rules
54 55 56 57
endif

#########################################################################

58
RELFLAGS := $(PLATFORM_RELFLAGS)
59

60
OBJCOPYFLAGS += --gap-fill=0xff
wdenk's avatar
wdenk committed
61

62 63
PLATFORM_CPPFLAGS += $(RELFLAGS)
PLATFORM_CPPFLAGS += -pipe
64

65
LDFLAGS += $(PLATFORM_LDFLAGS)
66
LDFLAGS_FINAL += -Bstatic
67 68 69 70 71

export PLATFORM_CPPFLAGS
export RELFLAGS
export LDFLAGS_FINAL
export CONFIG_STANDALONE_LOAD_ADDR