From 0b54bb99f91032c76427a0060062a0bbc354a523 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sun, 17 Apr 2016 00:27:54 -0400 Subject: [PATCH] NuttX quiet build cmake combine NuttX copy and export -NuttX wasn't recopying if it fails to compile --- CMakeLists.txt | 4 +- Makefile | 2 +- Tools/px_process_airframes.py | 9 +-- Tools/px_process_params.py | 7 +- Tools/px_romfs_pruner.py | 2 +- cmake/common/px4_base.cmake | 2 +- cmake/nuttx/px4_impl_nuttx.cmake | 24 +++---- nuttx-configs/PX4_Warnings.mk | 72 +++++++++++++++++++ nuttx-configs/aerocore/nsh/Make.defs | 43 +++-------- nuttx-configs/mindpx-v2/nsh/Make.defs | 39 +++------- .../px4-stm32f4discovery/nsh/Make.defs | 49 ++++--------- .../px4-stm32f4discovery/nsh/defconfig | 3 +- nuttx-configs/px4fmu-v1/nsh/Make.defs | 37 +++------- nuttx-configs/px4fmu-v2/nsh/Make.defs | 37 +++------- nuttx-configs/px4fmu-v4/nsh/Make.defs | 29 ++------ nuttx-configs/px4io-v1/nsh/Make.defs | 39 ++++------ nuttx-configs/px4io-v2/nsh/Make.defs | 39 ++++------ 17 files changed, 183 insertions(+), 254 deletions(-) create mode 100644 nuttx-configs/PX4_Warnings.mk diff --git a/CMakeLists.txt b/CMakeLists.txt index bc598472c1..fc5bc249a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,7 +298,7 @@ px4_join(OUT CMAKE_C_FLAGS LIST "${c_flags}" GLUE " ") px4_join(OUT CMAKE_CXX_FLAGS LIST "${cxx_flags}" GLUE " ") include_directories(${include_dirs}) -message("INCLUDE_DIRS=${include_dirs}") +#message("INCLUDE_DIRS=${include_dirs}") link_directories(${link_dirs}) add_definitions(${definitions}) @@ -333,7 +333,7 @@ execute_process(COMMAND cmake -E make_directory ${ep_base}/Install/include) #============================================================================= # DriverFramework Drivers # -message("ADDING DRIVERS") +#message("ADDING DRIVERS") set(df_driver_libs) foreach(driver ${config_df_driver_list}) add_subdirectory(src/lib/DriverFramework/drivers/${driver}) diff --git a/Makefile b/Makefile index 5fc9451695..532a825a5a 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ define cmake-build +@if [ $(PX4_CMAKE_GENERATOR) = "Ninja" ] && [ -e $(PWD)/build_$@/Makefile ]; then rm -rf $(PWD)/build_$@; fi +@if [ ! -e $(PWD)/build_$@/CMakeCache.txt ]; then Tools/check_submodules.sh && mkdir -p $(PWD)/build_$@ && cd $(PWD)/build_$@ && cmake .. -G$(PX4_CMAKE_GENERATOR) -DCONFIG=$(1) || (cd .. && rm -rf $(PWD)/build_$@); fi +@Tools/check_submodules.sh -+$(PX4_MAKE) -C $(PWD)/build_$@ $(PX4_MAKE_ARGS) $(ARGS) ++@(echo PX4 CONFIG: $@ && cd $(PWD)/build_$@ && $(PX4_MAKE) $(PX4_MAKE_ARGS) $(ARGS)) endef # create empty targets to avoid msgs for targets passed to cmake diff --git a/Tools/px_process_airframes.py b/Tools/px_process_airframes.py index 7d7d28a2b2..aa7e57a8c8 100755 --- a/Tools/px_process_airframes.py +++ b/Tools/px_process_airframes.py @@ -71,6 +71,7 @@ def main(): const="", metavar="BOARD", help="Board to create airframes xml for") + parser.add_argument("-v", "--verbose", help="verbose output") args = parser.parse_args() # Check for valid command @@ -84,7 +85,7 @@ def main(): parser = srcparser.SourceParser() # Scan directories, and parse the files - print("Scanning source path " + args.airframes_path) + if args.verbose: print("Scanning source path " + args.airframes_path) if not scanner.ScanDir(args.airframes_path, parser): sys.exit(1) # We can't validate yet @@ -94,16 +95,16 @@ def main(): # Output to XML file if args.xml: - print("Creating XML file " + args.xml) + if args.verbose: print("Creating XML file " + args.xml) out = xmlout.XMLOutput(param_groups, args.board) out.Save(args.xml) if args.start_script: - print("Creating start script " + args.start_script) + if args.verbose: print("Creating start script " + args.start_script) out = rcout.RCOutput(param_groups, args.board) out.Save(args.start_script) - print("All done!") + if (args.verbose): print("All done!") if __name__ == "__main__": diff --git a/Tools/px_process_params.py b/Tools/px_process_params.py index fcd5b994e9..29206275bf 100644 --- a/Tools/px_process_params.py +++ b/Tools/px_process_params.py @@ -107,6 +107,7 @@ def main(): metavar="SUMMARY", default="Automagically updated parameter documentation from code.", help="DokuWiki page edit summary") + parser.add_argument("-v", "--verbose", help="verbose output") args = parser.parse_args() # Check for valid command @@ -120,7 +121,7 @@ def main(): parser = srcparser.SourceParser() # Scan directories, and parse the files - print("Scanning source path " + args.src_path) + if (args.verbose): print("Scanning source path " + args.src_path) if not scanner.ScanDir(args.src_path, parser): sys.exit(1) if not parser.Validate(): @@ -129,7 +130,7 @@ def main(): # Output to XML file if args.xml: - print("Creating XML file " + args.xml) + if args.verbose: print("Creating XML file " + args.xml) out = xmlout.XMLOutput(param_groups, args.board, os.path.join(args.src_path, args.inject_xml)) out.Save(args.xml) @@ -147,7 +148,7 @@ def main(): else: print("Error: You need to specify DokuWiki XML-RPC username and password!") - print("All done!") + #print("All done!") if __name__ == "__main__": diff --git a/Tools/px_romfs_pruner.py b/Tools/px_romfs_pruner.py index 67f0b57cbf..5ac8fc2801 100644 --- a/Tools/px_romfs_pruner.py +++ b/Tools/px_romfs_pruner.py @@ -53,7 +53,7 @@ def main(): help="ROMFS scratch folder.") args = parser.parse_args() - print("Pruning ROMFS files.") + #print("Pruning ROMFS files.") # go through for (root, dirs, files) in os.walk(args.folder): diff --git a/cmake/common/px4_base.cmake b/cmake/common/px4_base.cmake index f4caf0c420..30ccd86b5d 100644 --- a/cmake/common/px4_base.cmake +++ b/cmake/common/px4_base.cmake @@ -773,7 +773,7 @@ function(px4_create_git_hash_header) OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) - message(STATUS "GIT_DESC = ${git_desc}") + #message(STATUS "GIT_DESC = ${git_desc}") set(git_desc_short) string(SUBSTRING ${git_desc} 1 16 git_desc_short) configure_file(${CMAKE_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY) diff --git a/cmake/nuttx/px4_impl_nuttx.cmake b/cmake/nuttx/px4_impl_nuttx.cmake index e1c7fc3696..fb0b81711d 100644 --- a/cmake/nuttx/px4_impl_nuttx.cmake +++ b/cmake/nuttx/px4_impl_nuttx.cmake @@ -202,28 +202,22 @@ function(px4_nuttx_add_export) add_dependencies(nuttx_patch nuttx_patch_${patch_name}) endforeach() - # copy - add_custom_command(OUTPUT nuttx_copy_${CONFIG}.stamp - COMMAND ${MKDIR} -p ${CMAKE_BINARY_DIR}/${CONFIG} + # copy and export + file(GLOB_RECURSE config_files ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/*) + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CONFIG}.export COMMAND ${MKDIR} -p ${nuttx_src} COMMAND ${CP} -a ${CMAKE_SOURCE_DIR}/NuttX/. ${nuttx_src}/ COMMAND ${RM} -rf ${nuttx_src}/.git - COMMAND ${TOUCH} nuttx_copy_${CONFIG}.stamp - DEPENDS ${DEPENDS}) - add_custom_target(__nuttx_copy_${CONFIG} - DEPENDS nuttx_copy_${CONFIG}.stamp __nuttx_patch_${CONFIG}) - - # export - file(GLOB_RECURSE config_files ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/*) - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CONFIG}.export - COMMAND ${ECHO} Configuring NuttX for ${CONFIG} + #COMMAND ${ECHO} Configuring NuttX for ${CONFIG} COMMAND ${MAKE} --no-print-directory -C${nuttx_src}/nuttx -r --quiet distclean + COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/nuttx-configs/PX4_Warnings.mk ${nuttx_src}/nuttx/ COMMAND ${CP} -r ${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_src}/nuttx/configs COMMAND cd ${nuttx_src}/nuttx/tools && ./configure.sh ${CONFIG}/nsh - COMMAND ${ECHO} Exporting NuttX for ${CONFIG} - COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export > /dev/null + #COMMAND ${ECHO} Exporting NuttX for ${CONFIG} + COMMAND ${MAKE} --no-print-directory --quiet -C ${nuttx_src}/nuttx -j${THREADS} -r CONFIG_ARCH_BOARD=${CONFIG} export > nuttx_build.log COMMAND ${CP} -r ${nuttx_src}/nuttx/nuttx-export.zip ${CMAKE_BINARY_DIR}/${CONFIG}.export - DEPENDS ${config_files} ${DEPENDS} __nuttx_copy_${CONFIG}) + DEPENDS ${config_files} ${DEPENDS} + COMMENT "Building NuttX for ${CONFIG}") # extract add_custom_command(OUTPUT nuttx_export_${CONFIG}.stamp diff --git a/nuttx-configs/PX4_Warnings.mk b/nuttx-configs/PX4_Warnings.mk new file mode 100644 index 0000000000..9d19fc2e6a --- /dev/null +++ b/nuttx-configs/PX4_Warnings.mk @@ -0,0 +1,72 @@ +############################################################################ +# configs/PX4_Warnings.mk +# +# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +PX4_ARCHWARNINGS = -Wall \ + -Wextra \ + -Wdouble-promotion \ + -Wframe-larger-than=1024 \ + -Wlogical-op \ + -Wpacked \ + -Wpointer-arith \ + -Wshadow \ + -Wno-sign-compare \ + -Wno-unused-parameter + +# -Wcast-qual - generates spurious noreturn attribute warnings, try again later +# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code +# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives + +PX4_ARCHCWARNINGS = $(ARCHWARNINGS) \ + -Wbad-function-cast \ + -Wmissing-parameter-type \ + -Wnested-externs \ + -Wstrict-prototypes \ + -Wno-bad-function-cast \ + -Wno-cpp \ + -Wno-implicit-function-declaration \ + -Wno-maybe-uninitialized \ + -Wno-missing-field-initializers \ + -Wno-nested-externs \ + -Wno-old-style-declaration \ + -Wno-pointer-sign \ + -Wno-type-limits \ + -Wno-unused-but-set-variable \ + -Wno-unused-function \ + -Wno-unused-label \ + -Wno-unused-variable + +PX4_ARCHWARNINGSXX = $(ARCHWARNINGS) \ + -Wno-cpp \ + -Wno-psabi diff --git a/nuttx-configs/aerocore/nsh/Make.defs b/nuttx-configs/aerocore/nsh/Make.defs index 3808fc1cfd..96eedc3665 100644 --- a/nuttx-configs/aerocore/nsh/Make.defs +++ b/nuttx-configs/aerocore/nsh/Make.defs @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -53,7 +55,7 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump -MAXOPTIMIZATION = -O3 +MAXOPTIMIZATION = -Os ARCHCPUFLAGS = -mcpu=cortex-m4 \ -mthumb \ -march=armv7e-m \ @@ -91,7 +93,7 @@ else ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain + # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -108,10 +110,10 @@ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") ARCHOPTIMIZATION += -g @@ -119,32 +121,9 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wfloat-equal \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wmissing-declarations \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wmissing-prototypes \ - -Wnested-externs \ - -Wunsuffixed-float-constants -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-psabi +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 diff --git a/nuttx-configs/mindpx-v2/nsh/Make.defs b/nuttx-configs/mindpx-v2/nsh/Make.defs index a09e6794e3..75a3e4c282 100644 --- a/nuttx-configs/mindpx-v2/nsh/Make.defs +++ b/nuttx-configs/mindpx-v2/nsh/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/px4fmu-v2/nsh/Make.defs +# configs/mindpx-v2/nsh/Make.defs # # Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -91,7 +93,7 @@ else ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain + # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -108,10 +110,10 @@ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") ARCHOPTIMIZATION += -g @@ -119,28 +121,9 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wnested-externs -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-psabi +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 diff --git a/nuttx-configs/px4-stm32f4discovery/nsh/Make.defs b/nuttx-configs/px4-stm32f4discovery/nsh/Make.defs index e70320aaa4..b08b8934d8 100644 --- a/nuttx-configs/px4-stm32f4discovery/nsh/Make.defs +++ b/nuttx-configs/px4-stm32f4discovery/nsh/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/px4fmu-v2/nsh/Make.defs +# configs/px4-stm32f4discovery/nsh/Make.defs # # Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -53,7 +55,7 @@ NM = $(CROSSDEV)nm OBJCOPY = $(CROSSDEV)objcopy OBJDUMP = $(CROSSDEV)objdump -MAXOPTIMIZATION = -O3 +MAXOPTIMIZATION = -Os ARCHCPUFLAGS = -mcpu=cortex-m4 \ -mthumb \ -march=armv7e-m \ @@ -62,8 +64,9 @@ ARCHCPUFLAGS = -mcpu=cortex-m4 \ # enable precise stack overflow tracking -INSTRUMENTATIONDEFINES = -finstrument-functions \ - -ffixed-r10 +ifeq ($(CONFIG_ARMV7M_STACKCHECK),y) +INSTRUMENTATIONDEFINES = -finstrument-functions -ffixed-r10 +endif # pull in *just* libm from the toolchain ... this is grody LIBM = "${shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a}" @@ -90,7 +93,7 @@ else ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain + # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -107,10 +110,10 @@ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") ARCHOPTIMIZATION += -g @@ -118,31 +121,9 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wfloat-equal \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wmissing-declarations \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wmissing-prototypes \ - -Wnested-externs \ - -Wunsuffixed-float-constants -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-psabi +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 diff --git a/nuttx-configs/px4-stm32f4discovery/nsh/defconfig b/nuttx-configs/px4-stm32f4discovery/nsh/defconfig index 7be5399629..5285fae077 100644 --- a/nuttx-configs/px4-stm32f4discovery/nsh/defconfig +++ b/nuttx-configs/px4-stm32f4discovery/nsh/defconfig @@ -283,8 +283,7 @@ CONFIG_STM32_USART_SINGLEWIRE=y # # CONFIG_STM32_I2C_DYNTIMEO is not set CONFIG_STM32_I2CTIMEOSEC=0 -CONFIG_STM32_I2CTIMEOMS=500 -CONFIG_STM32_I2CTIMEOTICKS=500 +CONFIG_STM32_I2CTIMEOMS=10 # CONFIG_STM32_I2C_DUTY16_9 is not set # diff --git a/nuttx-configs/px4fmu-v1/nsh/Make.defs b/nuttx-configs/px4fmu-v1/nsh/Make.defs index a1439476aa..6f21d09777 100644 --- a/nuttx-configs/px4fmu-v1/nsh/Make.defs +++ b/nuttx-configs/px4fmu-v1/nsh/Make.defs @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -91,7 +93,7 @@ else ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain + # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -108,10 +110,10 @@ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") ARCHOPTIMIZATION += -g @@ -119,28 +121,9 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wnested-externs -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-psabi +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 diff --git a/nuttx-configs/px4fmu-v2/nsh/Make.defs b/nuttx-configs/px4fmu-v2/nsh/Make.defs index a09e6794e3..44afda73e0 100644 --- a/nuttx-configs/px4fmu-v2/nsh/Make.defs +++ b/nuttx-configs/px4fmu-v2/nsh/Make.defs @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -91,7 +93,7 @@ else ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain + # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -108,10 +110,10 @@ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") ARCHOPTIMIZATION += -g @@ -119,28 +121,9 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wnested-externs -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-psabi +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 diff --git a/nuttx-configs/px4fmu-v4/nsh/Make.defs b/nuttx-configs/px4fmu-v4/nsh/Make.defs index 6177f4c36d..bd3f2a3c15 100644 --- a/nuttx-configs/px4fmu-v4/nsh/Make.defs +++ b/nuttx-configs/px4fmu-v4/nsh/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# configs/px4fmu-v2/nsh/Make.defs +# configs/px4fmu-v4/nsh/Make.defs # # Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -119,28 +121,9 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wnested-externs -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-psabi +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 diff --git a/nuttx-configs/px4io-v1/nsh/Make.defs b/nuttx-configs/px4io-v1/nsh/Make.defs index df1110fc61..a04fee665e 100644 --- a/nuttx-configs/px4io-v1/nsh/Make.defs +++ b/nuttx-configs/px4io-v1/nsh/Make.defs @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -84,7 +86,7 @@ else ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain + # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -101,10 +103,10 @@ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") ARCHOPTIMIZATION += -g @@ -112,28 +114,10 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wnested-externs -ARCHWARNINGSXX = $(ARCHWARNINGS) -ARCHDEFINES = +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) +ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 # this seems to be the only way to add linker flags @@ -155,6 +139,7 @@ OBJEXT = .o LIBEXT = .a EXEEXT = + # produce partially-linked $1 from files in $2 define PRELINK @echo "PRELINK: $1" diff --git a/nuttx-configs/px4io-v2/nsh/Make.defs b/nuttx-configs/px4io-v2/nsh/Make.defs index 23ebca902a..9b7a226b9e 100644 --- a/nuttx-configs/px4io-v2/nsh/Make.defs +++ b/nuttx-configs/px4io-v2/nsh/Make.defs @@ -36,6 +36,8 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk +include $(TOPDIR)/PX4_Warnings.mk + # # We only support building with the ARM bare-metal toolchain from # https://launchpad.net/gcc-arm-embedded on Windows, Linux or Mac OS. @@ -84,7 +86,7 @@ else ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT) else - # Linux/Cygwin-native toolchain + # Linux/Cygwin-native toolchain MKDEP = $(TOPDIR)/tools/mkdeps.sh ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -101,10 +103,10 @@ ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ -fno-strict-aliasing \ -fno-strength-reduce \ -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections + -funsafe-math-optimizations \ + -fno-builtin-printf \ + -ffunction-sections \ + -fdata-sections ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") ARCHOPTIMIZATION += -g @@ -112,28 +114,10 @@ endif ARCHCFLAGS = -std=gnu99 ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -ARCHWARNINGS = -Wall \ - -Wno-sign-compare \ - -Wextra \ - -Wdouble-promotion \ - -Wshadow \ - -Wframe-larger-than=1024 \ - -Wpointer-arith \ - -Wlogical-op \ - -Wpacked \ - -Wno-unused-parameter -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wnested-externs -ARCHWARNINGSXX = $(ARCHWARNINGS) -ARCHDEFINES = +ARCHWARNINGS = $(PX4_ARCHWARNINGS) +ARCHCWARNINGS = $(PX4_ARCHWARNINGS) $(PX4_ARCHCWARNINGS) +ARCHWARNINGSXX = $(ARCHWARNINGS) $(PX4_ARCHWARNINGSXX) +ARCHDEFINES = ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 # this seems to be the only way to add linker flags @@ -155,6 +139,7 @@ OBJEXT = .o LIBEXT = .a EXEEXT = + # produce partially-linked $1 from files in $2 define PRELINK @echo "PRELINK: $1"