Commit 4b2c69d7 authored by Alessandro Rubini's avatar Alessandro Rubini

config: add an option to force -O0 when using gdb

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent a1e05ad4
...@@ -162,9 +162,18 @@ config MAX_VLANS_PER_PORT ...@@ -162,9 +162,18 @@ config MAX_VLANS_PER_PORT
microcontroller-class architectures. Hosted builds microcontroller-class architectures. Hosted builds
feature a bigger default, because they have no size constraints. feature a bigger default, because they have no size constraints.
# I want a number, to be used without ifdef # I want a number, to be used without ifdef
config VLAN_ARRAY_SIZE config VLAN_ARRAY_SIZE
int int
default 0 if !VLAN default 0 if !VLAN
default 1 if !HAS_MULTIPLE_VLAN default 1 if !HAS_MULTIPLE_VLAN
default MAX_VLANS_PER_PORT default MAX_VLANS_PER_PORT
config DISABLE_OPTIMIZATION
bool "Disable -O2, to ease running a debugger"
config OPTIMIZATION
int
default 0 if DISABLE_OPTIMIZATION
default 2
...@@ -47,7 +47,8 @@ all: $(TARGET).o ...@@ -47,7 +47,8 @@ all: $(TARGET).o
# CFLAGS to use. Both this Makefile (later) and app-makefile may grow CFLAGS # CFLAGS to use. Both this Makefile (later) and app-makefile may grow CFLAGS
CFLAGS = $(USER_CFLAGS) CFLAGS = $(USER_CFLAGS)
CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes
CFLAGS += -O2 -ggdb -Iinclude -fno-common CFLAGS += -O$(CONFIG_OPTIMIZATION)
CFLAGS += -ggdb -Iinclude -fno-common
CFLAGS += -DPPSI_VERSION=\"$(VERSION)\" CFLAGS += -DPPSI_VERSION=\"$(VERSION)\"
# to avoid ifdef as much as possible, I use the kernel trick for OBJ variables # to avoid ifdef as much as possible, I use the kernel trick for OBJ variables
......
#
# Automatically generated make config: don't edit
#
CONFIG_ARCH_UNIX=y
# CONFIG_ARCH_BARE_I386 is not set
# CONFIG_ARCH_BARE_X86_64 is not set
# CONFIG_ARCH_WRPC is not set
# CONFIG_ARCH_WRS is not set
# CONFIG_ARCH_SIMULATOR is not set
CONFIG_ARCH="unix"
#
# PTP Protocol Options
#
CONFIG_E2E=y
# CONFIG_P2P is not set
CONFIG_EXT_NONE=y
CONFIG_EXTENSION=""
CONFIG_CROSS_COMPILE=""
CONFIG_ARCH_CFLAGS=""
CONFIG_ARCH_LDFLAGS=""
CONFIG_HAS_VLAN=y
CONFIG_HAS_MULTIPLE_VLAN=y
CONFIG_VLAN=y
CONFIG_MAX_VLANS_PER_PORT=32
CONFIG_VLAN_ARRAY_SIZE=32
CONFIG_DISABLE_OPTIMIZATION=y
CONFIG_OPTIMIZATION=0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment