Skip to main content
Homepage
Explore
Search or go to…
/
Register
Sign in
Explore
Primary navigation
Project
M
marlin-anet-a8
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
96e9db89
Commit
96e9db89
authored
Dec 13, 2012
by
daid
Browse files
Options
Downloads
Plain Diff
Merge pull request #339 from KevinOConnor/CompilerFlags
Add additional optimization flags to Makefile
parents
08356361
09084583
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/Makefile
+27
-17
27 additions, 17 deletions
Marlin/Makefile
with
27 additions
and
17 deletions
Marlin/Makefile
+
27
−
17
View file @
96e9db89
...
@@ -227,6 +227,22 @@ OPT = s
...
@@ -227,6 +227,22 @@ OPT = s
DEFINES
?=
DEFINES
?=
# Program settings
CC
=
$(
AVR_TOOLS_PATH
)
avr-gcc
CXX
=
$(
AVR_TOOLS_PATH
)
avr-g++
OBJCOPY
=
$(
AVR_TOOLS_PATH
)
avr-objcopy
OBJDUMP
=
$(
AVR_TOOLS_PATH
)
avr-objdump
AR
=
$(
AVR_TOOLS_PATH
)
avr-ar
SIZE
=
$(
AVR_TOOLS_PATH
)
avr-size
NM
=
$(
AVR_TOOLS_PATH
)
avr-nm
AVRDUDE
=
avrdude
REMOVE
=
rm
-f
MV
=
mv
-f
# Tool for testing compiler flags
cc-option
=
$(
shell
if
test
-z
"
`
$(
1
)
$(
2
)
-S
-o
/dev/null
-xc
/dev/null 2>&1
`
"
\
;
then
echo
"
$(
2
)
"
;
else
echo
"
$(
3
)
"
;
fi
;)
# Place -D or -U options here
# Place -D or -U options here
CDEFS
=
-DF_CPU
=
$(
F_CPU
)
${
addprefix
-D
,
$(
DEFINES
)}
CDEFS
=
-DF_CPU
=
$(
F_CPU
)
${
addprefix
-D
,
$(
DEFINES
)}
CXXDEFS
=
-DF_CPU
=
$(
F_CPU
)
${
addprefix
-D
,
$(
DEFINES
)}
CXXDEFS
=
-DF_CPU
=
$(
F_CPU
)
${
addprefix
-D
,
$(
DEFINES
)}
...
@@ -251,10 +267,12 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
...
@@ -251,10 +267,12 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
endif
endif
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
CFLAGS
=
$(
CDEBUG
)
$(
CDEFS
)
$(
CINCS
)
-O
$(
OPT
)
$(
CWARN
)
$(
CEXTRA
)
$(
CTUNING
)
CFLAGS
:=
$(
CDEBUG
)
$(
CDEFS
)
$(
CINCS
)
-O
$(
OPT
)
$(
CWARN
)
$(
CEXTRA
)
$(
CTUNING
)
\
CXXFLAGS
=
$(
CDEFS
)
$(
CINCS
)
-O
$(
OPT
)
-Wall
$(
CEXTRA
)
$(
CTUNING
)
$(
call cc-option,
$(
CC
)
,-flto
-fwhole-program
,
)
CXXFLAGS
:=
$(
CDEFS
)
$(
CINCS
)
-O
$(
OPT
)
-Wall
$(
CEXTRA
)
$(
CTUNING
)
\
$(
call cc-option,
$(
CC
)
,-flto
-fwhole-program
,
)
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
LDFLAGS
=
-lm
LDFLAGS
=
-lm
-Wl
,--relax
# Programming support using avrdude. Settings and variables.
# Programming support using avrdude. Settings and variables.
...
@@ -264,18 +282,6 @@ AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \
...
@@ -264,18 +282,6 @@ AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \
-p
$(
MCU
)
-P
$(
AVRDUDE_PORT
)
-c
$(
AVRDUDE_PROGRAMMER
)
\
-p
$(
MCU
)
-P
$(
AVRDUDE_PORT
)
-c
$(
AVRDUDE_PROGRAMMER
)
\
-b
$(
UPLOAD_RATE
)
-b
$(
UPLOAD_RATE
)
# Program settings
CC
=
$(
AVR_TOOLS_PATH
)
avr-gcc
CXX
=
$(
AVR_TOOLS_PATH
)
avr-g++
OBJCOPY
=
$(
AVR_TOOLS_PATH
)
avr-objcopy
OBJDUMP
=
$(
AVR_TOOLS_PATH
)
avr-objdump
AR
=
$(
AVR_TOOLS_PATH
)
avr-ar
SIZE
=
$(
AVR_TOOLS_PATH
)
avr-size
NM
=
$(
AVR_TOOLS_PATH
)
avr-nm
AVRDUDE
=
avrdude
REMOVE
=
rm
-f
MV
=
mv
-f
# Define all object files.
# Define all object files.
OBJ
=
${
patsubst %.c,
$(
BUILD_DIR
)
/%.o,
${
SRC
}}
OBJ
=
${
patsubst %.c,
$(
BUILD_DIR
)
/%.o,
${
SRC
}}
OBJ
+=
${
patsubst %.cpp,
$(
BUILD_DIR
)
/%.o,
${
CXXSRC
}}
OBJ
+=
${
patsubst %.cpp,
$(
BUILD_DIR
)
/%.o,
${
CXXSRC
}}
...
@@ -372,9 +378,13 @@ extcoff: $(TARGET).elf
...
@@ -372,9 +378,13 @@ extcoff: $(TARGET).elf
$(
NM
)
-n
$<
>
$@
$(
NM
)
-n
$<
>
$@
# Link: create ELF output file from library.
# Link: create ELF output file from library.
$(BUILD_DIR)/$(TARGET).elf
:
$(OBJ) Configuration.h
$(BUILD_DIR)/$(TARGET).elf
:
$(BUILD_DIR)/$(TARGET).o
$(
Pecho
)
" CXX
$@
"
$P
$(
CC
)
$(
ALL_CXXFLAGS
)
-Wl
,--gc-sections
-o
$@
-L
.
$^
$(
LDFLAGS
)
$(BUILD_DIR)/$(TARGET).o
:
$(OBJ) Configuration.h
$(
Pecho
)
" CXX
$@
"
$(
Pecho
)
" CXX
$@
"
$P
$(
CC
)
$(
ALL_CXXFLAGS
)
-
Wl
,--gc-sections
-o
$@
-L
.
$(
OBJ
)
$(
LDFLAGS
)
$P
$(
CC
)
$(
ALL_CXXFLAGS
)
-
nostdlib
-Wl
,-r
-o
$@
$(
OBJ
)
$(BUILD_DIR)/%.o
:
%.c Configuration.h Configuration_adv.h $(MAKEFILE)
$(BUILD_DIR)/%.o
:
%.c Configuration.h Configuration_adv.h $(MAKEFILE)
$(
Pecho
)
" CC
$<
"
$(
Pecho
)
" CC
$<
"
...
...
...
...
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