Skip to content

Commit

Permalink
[build] optimization flag can be set from airframe file
Browse files Browse the repository at this point in the history
  • Loading branch information
gautierhattenberger committed Feb 7, 2014
1 parent 1a0ae29 commit 5135d9d
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 28 deletions.
19 changes: 5 additions & 14 deletions conf/Makefile.chibios-libopencm3
Expand Up @@ -69,25 +69,16 @@ endif

# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -std=gnu11 -g -O0 -ggdb3 -fno-inline \
-falign-functions=16 -fno-omit-frame-pointer\
-W -Wall -Werror -Wno-error=unused-variable -Wno-error=format \
-Wno-error=unused-function -Wno-error=unused-parameter \
$(PPRZ_DEFINITION)
endif
ifeq ($(USE_OPT),)
USE_OPT = -std=gnu11 -O2 \
# ChibiOS already define OPT
CH_OPT ?= 0 -g -ggdb3 -fno-inline

USE_OPT = -std=gnu11 -O$(CH_OPT) \
-falign-functions=16 -fno-omit-frame-pointer\
-W -Wall -Werror -Wno-error=unused-variable -Wno-error=format \
-Wno-error=unused-function -Wno-error=unused-parameter \
-Wno-error=unused-function -Wno-error=unused-parameter \
$(PPRZ_DEFINITION)
endif

# ifeq ($(USE_OPT),)
# USE_OPT = -std=gnu11 -Os \
# -falign-functions=16 -fomit-frame-pointer\
# -W -Wall -DRTOS_IS_CHIBIOS
# endif

# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
Expand Down
2 changes: 1 addition & 1 deletion conf/Makefile.geode
Expand Up @@ -27,7 +27,7 @@ LD = $(CC)
# Launch with "make Q=''" to get full command display
Q=@

OPT=3
OPT ?= 3
CSTANDARD = -std=gnu99
CINCS = $(INCLUDES) -I$(PAPARAZZI_SRC)/sw/include

Expand Down
3 changes: 2 additions & 1 deletion conf/Makefile.jsbsim
Expand Up @@ -29,6 +29,7 @@ SRC_ARCH = arch/sim

CC = g++
SIMDIR = $(PAPARAZZI_SRC)/sw/simulator
OPT ?= 2

# Launch with "make Q=''" to get full command display
Q=@
Expand All @@ -37,7 +38,7 @@ Q=@
# Compilation flags
#

CFLAGS = -W -Wall $(INCLUDES) -I$(PAPARAZZI_SRC)/sw/airborne/$(SRC_ARCH) $($(TARGET).CFLAGS) $(LOCAL_CFLAGS) -O2
CFLAGS = -W -Wall $(INCLUDES) -I$(PAPARAZZI_SRC)/sw/airborne/$(SRC_ARCH) $($(TARGET).CFLAGS) $(LOCAL_CFLAGS) -O$(OPT)

LDFLAGS = -lm $($(TARGET).LDFLAGS)

Expand Down
3 changes: 1 addition & 2 deletions conf/Makefile.lpc21
Expand Up @@ -68,8 +68,7 @@ ASRCARM = crt0.S

# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
OPT = s
#OPT=3
OPT ?= s

CSTANDARD = -std=gnu99

Expand Down
4 changes: 2 additions & 2 deletions conf/Makefile.nps
Expand Up @@ -27,7 +27,7 @@
SRC_ARCH = arch/sim

CC = g++

OPT ?= 2
SIMDIR = $(PAPARAZZI_SRC)/sw/simulator

# Launch with "make Q=''" to get full command display
Expand All @@ -37,7 +37,7 @@ CFLAGS = -W -Wall
CFLAGS += $(INCLUDES)
CFLAGS += $($(TARGET).CFLAGS)
CFLAGS += $(LOCAL_CFLAGS)
CFLAGS += -O2
CFLAGS += -O$(OPT)
CFLAGS += -g

LDFLAGS += $($(TARGET).LDFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion conf/Makefile.omap
Expand Up @@ -31,7 +31,7 @@ include $(PAPARAZZI_SRC)/conf/Makefile.arm-linux-toolchain
# Launch with "make Q=''" to get full command display
Q=@

OPT=3
OPT ?= 3
CSTANDARD = -std=gnu99
CINCS = $(INCLUDES) -I$(PAPARAZZI_SRC)/sw/include

Expand Down
2 changes: 1 addition & 1 deletion conf/Makefile.pentium-m
Expand Up @@ -27,7 +27,7 @@ LD = $(CC)
# Launch with "make Q=''" to get full command display
Q=@

OPT=3
OPT ?= 3

#
# OPT=O -g, turns off all optimization and turns on debugging.
Expand Down
3 changes: 2 additions & 1 deletion conf/Makefile.sim
Expand Up @@ -37,6 +37,7 @@ LINKPKG = $(PKG) -linkpkg -dllpath-pkg pprz
SIMSITLML = $(OBJDIR)/simsitl.ml
MYGTKINITCMO = myGtkInit.cmo
SITLCMA = $(SIMDIR)/sitl.cma
OPT ?= 2

# Launch with "make Q=''" to get full command display
Q=@
Expand All @@ -52,7 +53,7 @@ CFLAGS += $(INCLUDES)
CFLAGS += $($(TARGET).CFLAGS)
CFLAGS += $(LOCAL_CFLAGS)
CFLAGS += -fPIC
CFLAGS += -O2
CFLAGS += -O$(OPT)
CFLAGS += -g
CFLAGS += -std=gnu99

Expand Down
6 changes: 1 addition & 5 deletions conf/Makefile.stm32
Expand Up @@ -43,11 +43,7 @@ else
MCU = cortex-m3
endif
#DEBUG = dwarf-2
OPT = s
#OPT = 2
#OPT = 0


OPT ?= s

# input files
SRCS = $($(TARGET).srcs)
Expand Down

0 comments on commit 5135d9d

Please sign in to comment.