config.mk 1.81 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
#########################################################################

Peter Tyser's avatar
Peter Tyser committed
23 24
# Some architecture config.mk files need to know what CPUDIR is set to,
# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
25 26 27
# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
# CPU-specific code.
CPUDIR=arch/$(ARCH)/cpu/$(CPU)
28
ifneq ($(srctree)/$(CPUDIR),$(wildcard $(srctree)/$(CPUDIR)))
29 30
CPUDIR=arch/$(ARCH)/cpu
endif
Peter Tyser's avatar
Peter Tyser committed
31

32 33
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
34

35
ifdef	SOC
36
sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk	# include  SoC	specific rules
37
endif
38
ifneq ($(BOARD),)
39 40 41 42 43
ifdef	VENDOR
BOARDDIR = $(VENDOR)/$(BOARD)
else
BOARDDIR = $(BOARD)
endif
44
endif
45
ifdef	BOARD
46
sinclude $(srctree)/board/$(BOARDDIR)/config.mk	# include board specific rules
47 48 49 50
endif

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

51
RELFLAGS := $(PLATFORM_RELFLAGS)
52

53
OBJCOPYFLAGS += --gap-fill=0xff
wdenk's avatar
wdenk committed
54

55 56
PLATFORM_CPPFLAGS += $(RELFLAGS)
PLATFORM_CPPFLAGS += -pipe
57

58
LDFLAGS += $(PLATFORM_LDFLAGS)
59
LDFLAGS_FINAL += -Bstatic
60 61 62 63 64

export PLATFORM_CPPFLAGS
export RELFLAGS
export LDFLAGS_FINAL
export CONFIG_STANDALONE_LOAD_ADDR