mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 06:54:49 +08:00
[build] optimization flag can be set from airframe file
This commit is contained in:
@@ -69,25 +69,16 @@ endif
|
||||
|
||||
# Compiler options here.
|
||||
ifeq ($(USE_OPT),)
|
||||
USE_OPT = -std=gnu11 -g -O0 -ggdb3 -fno-inline \
|
||||
# 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 \
|
||||
$(PPRZ_DEFINITION)
|
||||
endif
|
||||
ifeq ($(USE_OPT),)
|
||||
USE_OPT = -std=gnu11 -O2 \
|
||||
-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),)
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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=@
|
||||
@@ -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)
|
||||
|
||||
|
||||
+1
-2
@@ -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
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
+2
-1
@@ -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=@
|
||||
@@ -52,7 +53,7 @@ CFLAGS += $(INCLUDES)
|
||||
CFLAGS += $($(TARGET).CFLAGS)
|
||||
CFLAGS += $(LOCAL_CFLAGS)
|
||||
CFLAGS += -fPIC
|
||||
CFLAGS += -O2
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -g
|
||||
CFLAGS += -std=gnu99
|
||||
|
||||
|
||||
+1
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user