Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
deba3873
Commit
deba3873
authored
9 years ago
by
Joakim Nohlgård
Browse files
Options
Downloads
Patches
Plain Diff
cortexm_common: Move toolchain settings to cpu dir
parent
6814f797
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boards/Makefile.include.cortexm_common
+0
-54
0 additions, 54 deletions
boards/Makefile.include.cortexm_common
cpu/Makefile.include.cortexm_common
+58
-0
58 additions, 0 deletions
cpu/Makefile.include.cortexm_common
with
58 additions
and
54 deletions
boards/Makefile.include.cortexm_common
+
0
−
54
View file @
deba3873
# Target triple for the build. Use arm-none-eabi if you are unsure.
export
TARGET_TRIPLE
?=
arm-none-eabi
# Use TOOLCHAIN environment variable to select the toolchain to use.
# Default: gnu
TOOLCHAIN
?=
gnu
# TOOLCHAIN = clang is an alias for TOOLCHAIN = llvm
ifeq
(clang,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override
TOOLCHAIN
:=
llvm
endif
# TOOLCHAIN = gcc is an alias for TOOLCHAIN = gnu
ifeq
(gcc,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override
TOOLCHAIN
:=
gnu
endif
export
TOOLCHAIN
# default toolchain prefix, defaults to target triple followed by a dash, you
# will most likely not need to touch this.
export
PREFIX
?=
$(
if
$(
TARGET_TRIPLE
)
,
$(
TARGET_TRIPLE
)
-
)
# define build specific options
export
CFLAGS_CPU
=
-mcpu
=
$(
MCPU
)
-mlittle-endian
-mthumb
$(
CFLAGS_FPU
)
ifneq
(llvm,$(TOOLCHAIN))
# Clang (observed with v3.7) does not understand -mno-thumb-interwork, only add if
# not building with LLVM
export
CFLAGS_CPU
+=
-mno-thumb-interwork
endif
export
CFLAGS_STYLE
=
-std
=
gnu99
-Wall
-Wstrict-prototypes
-Werror
=
implicit-function-declaration
export
CFLAGS_LINK
=
-ffunction-sections
-fdata-sections
-fno-builtin
-fshort-enums
export
CFLAGS_DBG
=
-ggdb
-g3
export
CFLAGS_OPT
?=
-Os
export
CFLAGS
+=
$(
CFLAGS_CPU
)
$(
CFLAGS_STYLE
)
$(
CFLAGS_LINK
)
$(
CFLAGS_DBG
)
$(
CFLAGS_OPT
)
export
ASFLAGS
+=
$(
CFLAGS_CPU
)
$(
CFLAGS_DEBUG
)
export
LINKFLAGS
+=
-L
$(
RIOTCPU
)
/
$(
CPU
)
/ldscripts
-L
$(
RIOTCPU
)
/cortexm_common/ldscripts
export
LINKFLAGS
+=
-T
$(
RIOTCPU
)
/
$(
CPU
)
/ldscripts/
$(
CPU_MODEL
)
.ld
-Wl
,--fatal-warnings
export
LINKFLAGS
+=
$(
CFLAGS_DEBUG
)
$(
CFLAGS_CPU
)
$(
CFLAGS_STYLE
)
-static
-lgcc
-nostartfiles
export
LINKFLAGS
+=
-Wl
,--gc-sections
# Import all toolchain settings
include
$(RIOTBOARD)/Makefile.include.$(TOOLCHAIN)
# use the nano-specs of Newlib when available
ifeq
($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
export
LINKFLAGS
+=
-specs
=
nano.specs
-lc
-lnosys
endif
# export board specific includes to the global includes-listing
# export board specific includes to the global includes-listing
export
INCLUDES
+=
-I
$(
RIOTBOARD
)
/
$(
BOARD
)
/include
export
INCLUDES
+=
-I
$(
RIOTBOARD
)
/
$(
BOARD
)
/include
This diff is collapsed.
Click to expand it.
cpu/Makefile.include.cortexm_common
+
58
−
0
View file @
deba3873
# Target triple for the build. Use arm-none-eabi if you are unsure.
export
TARGET_TRIPLE
?=
arm-none-eabi
# Use TOOLCHAIN environment variable to select the toolchain to use.
# Default: gnu
TOOLCHAIN
?=
gnu
# TOOLCHAIN = clang is an alias for TOOLCHAIN = llvm
ifeq
(clang,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override
TOOLCHAIN
:=
llvm
endif
# TOOLCHAIN = gcc is an alias for TOOLCHAIN = gnu
ifeq
(gcc,$(TOOLCHAIN))
# use override so that we can redefine a variable set on the command line (as
# opposed to one set in the environment)
override
TOOLCHAIN
:=
gnu
endif
ifeq
(,$(TOOLCHAIN))
override
TOOLCHAIN
:=
gnu
endif
export
TOOLCHAIN
# default toolchain prefix, defaults to target triple followed by a dash, you
# will most likely not need to touch this.
export
PREFIX
?=
$(
if
$(
TARGET_TRIPLE
)
,
$(
TARGET_TRIPLE
)
-
)
# define build specific options
export
CFLAGS_CPU
=
-mcpu
=
$(
MCPU
)
-mlittle-endian
-mthumb
$(
CFLAGS_FPU
)
ifneq
(llvm,$(TOOLCHAIN))
# Clang (observed with v3.7) does not understand -mno-thumb-interwork, only add if
# not building with LLVM
export
CFLAGS_CPU
+=
-mno-thumb-interwork
endif
export
CFLAGS_STYLE
=
-std
=
gnu99
-Wall
-Wstrict-prototypes
-Werror
=
implicit-function-declaration
export
CFLAGS_LINK
=
-ffunction-sections
-fdata-sections
-fno-builtin
-fshort-enums
export
CFLAGS_DBG
=
-ggdb
-g3
export
CFLAGS_OPT
?=
-Os
export
CFLAGS
+=
$(
CFLAGS_CPU
)
$(
CFLAGS_STYLE
)
$(
CFLAGS_LINK
)
$(
CFLAGS_DBG
)
$(
CFLAGS_OPT
)
export
ASFLAGS
+=
$(
CFLAGS_CPU
)
$(
CFLAGS_DEBUG
)
export
LINKFLAGS
+=
-L
$(
RIOTCPU
)
/
$(
CPU
)
/ldscripts
-L
$(
RIOTCPU
)
/cortexm_common/ldscripts
export
LINKFLAGS
+=
-T
$(
RIOTCPU
)
/
$(
CPU
)
/ldscripts/
$(
CPU_MODEL
)
.ld
-Wl
,--fatal-warnings
export
LINKFLAGS
+=
$(
CFLAGS_DEBUG
)
$(
CFLAGS_CPU
)
$(
CFLAGS_STYLE
)
-static
-lgcc
-nostartfiles
export
LINKFLAGS
+=
-Wl
,--gc-sections
# This CPU implementation is using the new core/CPU interface:
# This CPU implementation is using the new core/CPU interface:
export
CFLAGS
+=
-DCOREIF_NG
=
1
export
CFLAGS
+=
-DCOREIF_NG
=
1
...
@@ -70,6 +120,14 @@ endif
...
@@ -70,6 +120,14 @@ endif
# CPU depends on the cortex-m common module, so include it:
# CPU depends on the cortex-m common module, so include it:
include
$(RIOTCPU)/cortexm_common/Makefile.include
include
$(RIOTCPU)/cortexm_common/Makefile.include
# Import all toolchain settings
include
$(RIOTBOARD)/Makefile.include.$(TOOLCHAIN)
# use the nano-specs of Newlib when available
ifeq
($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
export
LINKFLAGS
+=
-specs
=
nano.specs
-lc
-lnosys
endif
# Avoid overriding the default rule:
# Avoid overriding the default rule:
all
:
all
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment