config.mk 2.21 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
# clear VENDOR for tcsh
VENDOR :=
23 24
#########################################################################

25 26
ARCH := $(CONFIG_SYS_ARCH:"%"=%)
CPU := $(CONFIG_SYS_CPU:"%"=%)
27 28 29 30 31
ifdef CONFIG_SPL_BUILD
ifdef CONFIG_TEGRA
CPU := arm720t
endif
endif
32 33 34 35 36 37 38 39
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
40 41
# Some architecture config.mk files need to know what CPUDIR is set to,
# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
42 43
# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
# CPU-specific code.
44
CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
Peter Tyser's avatar
Peter Tyser committed
45

46 47
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
48

49
ifdef	SOC
50
sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk	# include  SoC	specific rules
51
endif
52
ifneq ($(BOARD),)
53 54 55 56 57
ifdef	VENDOR
BOARDDIR = $(VENDOR)/$(BOARD)
else
BOARDDIR = $(BOARD)
endif
58
endif
59
ifdef	BOARD
60
sinclude $(srctree)/board/$(BOARDDIR)/config.mk	# include board specific rules
61 62
endif

63 64 65 66
ifdef FTRACE
PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
endif

67 68 69 70 71
# Allow use of stdint.h if available
ifneq ($(USE_STDINT),)
PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT
endif

72 73
#########################################################################

74
RELFLAGS := $(PLATFORM_RELFLAGS)
75

76 77
PLATFORM_CPPFLAGS += $(RELFLAGS)
PLATFORM_CPPFLAGS += -pipe
78

79
LDFLAGS += $(PLATFORM_LDFLAGS)
80
LDFLAGS_FINAL += -Bstatic
81 82 83 84 85

export PLATFORM_CPPFLAGS
export RELFLAGS
export LDFLAGS_FINAL
export CONFIG_STANDALONE_LOAD_ADDR