Blame view

config.mk 2.21 KB
e22117437   wdenk   Initial revision
1
  #
eca3aeb35   Wolfgang Denk   Licenses: introdu...
2
  # (C) Copyright 2000-2013
e22117437   wdenk   Initial revision
3
4
  # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  #
eca3aeb35   Wolfgang Denk   Licenses: introdu...
5
  # SPDX-License-Identifier:	GPL-2.0+
e22117437   wdenk   Initial revision
6
  #
e22117437   wdenk   Initial revision
7
  #########################################################################
026f9cf24   Masahiro Yamada   kbuild: improve K...
8
9
10
11
12
13
14
15
16
17
18
19
  # 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 :=
5b3ee386f   Masahiro Yamada   kbuild: clear VEN...
20
21
  # clear VENDOR for tcsh
  VENDOR :=
e22117437   wdenk   Initial revision
22
  #########################################################################
c4e5f52a5   Wolfgang Denk   config.mk: use co...
23

51148790f   Masahiro Yamada   kconfig: switch t...
24
25
  ARCH := $(CONFIG_SYS_ARCH:"%"=%)
  CPU := $(CONFIG_SYS_CPU:"%"=%)
e02ee2548   Masahiro Yamada   kconfig: switch t...
26
27
28
29
30
  ifdef CONFIG_SPL_BUILD
  ifdef CONFIG_TEGRA
  CPU := arm720t
  endif
  endif
51148790f   Masahiro Yamada   kconfig: switch t...
31
32
33
34
35
36
37
  BOARD := $(CONFIG_SYS_BOARD:"%"=%)
  ifneq ($(CONFIG_SYS_VENDOR),)
  VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
  endif
  ifneq ($(CONFIG_SYS_SOC),)
  SOC := $(CONFIG_SYS_SOC:"%"=%)
  endif
03b7004dd   Peter Tyser   Create CPUDIR var...
38
39
  # Some architecture config.mk files need to know what CPUDIR is set to,
  # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
8d1f26820   Peter Tyser   ppc: Move cpu/$CP...
40
41
  # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
  # CPU-specific code.
a8b0f9b68   Masahiro Yamada   build: define CPU...
42
  CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
03b7004dd   Peter Tyser   Create CPUDIR var...
43

4379ac614   Masahiro Yamada   kbuild: rename TO...
44
45
  sinclude $(srctree)/arch/$(ARCH)/config.mk	# include architecture dependend rules
  sinclude $(srctree)/$(CPUDIR)/config.mk		# include  CPU	specific rules
03b7004dd   Peter Tyser   Create CPUDIR var...
46

c4e5f52a5   Wolfgang Denk   config.mk: use co...
47
  ifdef	SOC
4379ac614   Masahiro Yamada   kbuild: rename TO...
48
  sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk	# include  SoC	specific rules
c4e5f52a5   Wolfgang Denk   config.mk: use co...
49
  endif
33a02da0f   Masahiro Yamada   kbuild: allow emp...
50
  ifneq ($(BOARD),)
c4e5f52a5   Wolfgang Denk   config.mk: use co...
51
52
53
54
55
  ifdef	VENDOR
  BOARDDIR = $(VENDOR)/$(BOARD)
  else
  BOARDDIR = $(BOARD)
  endif
33a02da0f   Masahiro Yamada   kbuild: allow emp...
56
  endif
c4e5f52a5   Wolfgang Denk   config.mk: use co...
57
  ifdef	BOARD
4379ac614   Masahiro Yamada   kbuild: rename TO...
58
  sinclude $(srctree)/board/$(BOARDDIR)/config.mk	# include board specific rules
c4e5f52a5   Wolfgang Denk   config.mk: use co...
59
  endif
b84505210   Simon Glass   Reactivate the tr...
60
61
62
  ifdef FTRACE
  PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
  endif
0d296cc2d   Gabe Black   Provide option to...
63
64
65
66
  # Allow use of stdint.h if available
  ifneq ($(USE_STDINT),)
  PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT
  endif
c4e5f52a5   Wolfgang Denk   config.mk: use co...
67
  #########################################################################
026f9cf24   Masahiro Yamada   kbuild: improve K...
68
  RELFLAGS := $(PLATFORM_RELFLAGS)
83b7e2a7f   Scott Wood   Handle most LDSCR...
69

026f9cf24   Masahiro Yamada   kbuild: improve K...
70
71
  PLATFORM_CPPFLAGS += $(RELFLAGS)
  PLATFORM_CPPFLAGS += -pipe
4a30f1e87   Tom Rini   config.mk: Check ...
72

8aba9dcee   Nobuhiro Iwamatsu   Divides variable ...
73
  LDFLAGS += $(PLATFORM_LDFLAGS)
6dc1eceb9   Haiying Wang   Introduce a new l...
74
  LDFLAGS_FINAL += -Bstatic
026f9cf24   Masahiro Yamada   kbuild: improve K...
75
76
77
78
79
  
  export PLATFORM_CPPFLAGS
  export RELFLAGS
  export LDFLAGS_FINAL
  export CONFIG_STANDALONE_LOAD_ADDR