diff options
author | David Sidrane <david_s5@nscdg.com> | 2015-01-22 10:37:33 -1000 |
---|---|---|
committer | David Sidrane <david_s5@nscdg.com> | 2015-01-22 10:37:33 -1000 |
commit | 6c3523d5c3b34af82f0083c758a102161037581c (patch) | |
tree | 6074f0d2c53619be3c0c0ab2746cfd3b99d96f9e | |
parent | af5c9876c469fdf71d309eb8812359f5feba6569 (diff) | |
download | px4-firmware-6c3523d5c3b34af82f0083c758a102161037581c.tar.gz px4-firmware-6c3523d5c3b34af82f0083c758a102161037581c.tar.bz2 px4-firmware-6c3523d5c3b34af82f0083c758a102161037581c.zip |
Created a general rule for testing a Nuttx CONFIG_xxx variable.
-rw-r--r-- | makefiles/toolchain_gnu-arm-eabi.mk | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index d4d73fb84..75a611fee 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -80,12 +80,23 @@ ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \ -march=armv7-m \ -mfloat-abi=soft +# +# Tool to test a Nuttx Config value from config.h +# + +NUTTX_CONFIG_H=$(WORK_DIR)nuttx-export/include/nuttx/config.h +define check_nuttx_config +$(strip $(shell $(GREP) -q $1 $2;echo -n $$?;)) +endef +nuttx_config_true:="0" +nuttx_config_2true:="0 0" + +# # Enabling stack checks if OS was build with them # -TEST_FILE_STACKCHECK=$(WORK_DIR)nuttx-export/include/nuttx/config.h -TEST_VALUE_STACKCHECK=CONFIG_ARMV7M_STACKCHECK\ 1 -ENABLE_STACK_CHECKS=$(shell $(GREP) -q "$(TEST_VALUE_STACKCHECK)" $(TEST_FILE_STACKCHECK); echo $$?;) -ifeq ("$(ENABLE_STACK_CHECKS)","0") + +ENABLE_STACK_CHECKS=$(call check_nuttx_config ,"CONFIG_ARMV7M_STACKCHECK 1", $(NUTTX_CONFIG_H)) +ifeq ("$(ENABLE_STACK_CHECKS)",$(nuttx_config_true)) ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions -ffixed-r10 ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = @@ -138,7 +149,7 @@ ARCHWARNINGS = -Wall \ -Wdouble-promotion \ -Wshadow \ -Wfloat-equal \ - -Wframe-larger-than=1024 \ + -Wframe-larger-than=2560 \ -Wpointer-arith \ -Wlogical-op \ -Wmissing-declarations \ @@ -325,3 +336,4 @@ define BIN_TO_OBJ --rename-section .data=.rodata $(Q) $(REMOVE) $2.c $2.c.o endef + |