From e38136fc9f3ec259f014c075cdd61e4faa69a22d Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 25 Sep 2017 13:19:47 -0400 Subject: [PATCH] NuttX build re-enable hard link copy and improve builtin_list --- platforms/nuttx/NuttX/CMakeLists.txt | 21 +++++++++---------- .../nuttx/NuttX/tools}/new_nuttx_px_config.sh | 0 .../nuttx/NuttX/tools}/nuttx_defconf_tool.sh | 0 3 files changed, 10 insertions(+), 11 deletions(-) rename {Tools => platforms/nuttx/NuttX/tools}/new_nuttx_px_config.sh (100%) rename {Tools => platforms/nuttx/NuttX/tools}/nuttx_defconf_tool.sh (100%) diff --git a/platforms/nuttx/NuttX/CMakeLists.txt b/platforms/nuttx/NuttX/CMakeLists.txt index 73083543c0..2ee334b15f 100644 --- a/platforms/nuttx/NuttX/CMakeLists.txt +++ b/platforms/nuttx/NuttX/CMakeLists.txt @@ -12,7 +12,7 @@ endif() project(NuttX_${BOARD} LANGUAGES ASM C CXX) message(STATUS "NuttX: " ${BOARD} " " ${nuttx_config_type} " " ${CMAKE_SYSTEM_PROCESSOR}) -if (CMAKE_HOST_APPLE OR TRUE) +if (CMAKE_HOST_APPLE OR CMAKE_HOST_WIN32) # copy with rsync and create file dependencies set(cp_cmd "rsync") set(cp_opts) @@ -93,13 +93,12 @@ add_custom_target(nuttx_context DEPENDS ${NUTTX_DIR}/include/nuttx/version.h) add_library(nuttx_build INTERFACE) # builtins +add_library(nuttx_builtin INTERFACE) if ("${BOARD}" MATCHES "px4io") # no apps for px4io - set(nuttx_builtin_list) else() # add additional commands to nuttx builtins set(builtin_registry ${APPS_DIR}/builtin/registry) - set(nuttx_builtin_list) foreach(module ${module_libraries}) get_target_property(MAIN ${module} MAIN) get_target_property(STACK_MAIN ${module} STACK_MAIN) @@ -110,13 +109,13 @@ else() COMMAND echo "{ \"${MAIN}\", ${PRIORITY}, ${STACK_MAIN}, ${MAIN}_main }," > ${builtin_registry}/${MAIN}_main.bdat VERBATIM ) - list(APPEND nuttx_builtin_list ${builtin_registry}/${MAIN}_main.bdat) + add_dependencies(nuttx_builtin ${builtin_registry}/${MAIN}_main.bdat) add_custom_command(OUTPUT ${builtin_registry}/${MAIN}_main.pdat COMMAND echo "int ${MAIN}_main(int argc, char *argv[]);" > ${builtin_registry}/${MAIN}_main.pdat VERBATIM ) - list(APPEND nuttx_builtin_list ${builtin_registry}/${MAIN}_main.pdat) + add_dependencies(nuttx_builtin ${builtin_registry}/${MAIN}_main.pdat) endif() endforeach() endif() @@ -128,7 +127,7 @@ add_custom_command(OUTPUT ${APPS_DIR}/libapps.a ${APPS_DIR}/platform/.built COMMAND find ${APPS_DIR} -name \*.o -o -name \*.built -delete COMMAND make --silent --no-print-directory -C ../apps TOPDIR="${NUTTX_DIR}" libapps.a > /dev/null - DEPENDS nuttx_context ${nuttx_builtin_list} + DEPENDS nuttx_context nuttx_builtin WORKING_DIRECTORY ${NUTTX_DIR} ) add_custom_target(nuttx_apps_build DEPENDS ${APPS_DIR}/libapps.a) @@ -184,9 +183,9 @@ add_nuttx_dir(mm mm n "") # oldconfig helper add_custom_target(oldconfig - COMMAND make --no-print-directory -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} oldconfig + COMMAND make --no-print-directory --silent -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} oldconfig COMMAND cp ${NUTTX_DIR}/.config ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig - COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig + COMMAND ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/tools/nuttx_defconf_tool.sh ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig DEPENDS nuttx_configure WORKING_DIRECTORY ${NUTTX_DIR} COMMENT "Running NuttX make oldconfig for ${BOARD} with ${nuttx_config_type}" @@ -195,9 +194,9 @@ add_custom_target(oldconfig # menuconfig helper add_custom_target(menuconfig - COMMAND make --no-print-directory -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} menuconfig + COMMAND make --no-print-directory --silent -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} menuconfig COMMAND cp ${NUTTX_DIR}/nuttx/.config ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig - COMMAND ${PX4_SOURCE_DIR}/Tools/nuttx_defconf_tool.sh ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig + COMMAND ${PX4_SOURCE_DIR}/platforms/nuttx/NuttX/tools/nuttx_defconf_tool.sh ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig DEPENDS nuttx_configure WORKING_DIRECTORY ${NUTTX_DIR} COMMENT "Running NuttX make menuconfig for ${BOARD} with ${nuttx_config_type}" @@ -206,7 +205,7 @@ add_custom_target(menuconfig # qconfig helper add_custom_target(qconfig - COMMAND make --no-print-directory -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} qconfig + COMMAND make --no-print-directory --silent -C ${NUTTX_DIR} CONFIG_ARCH_BOARD=${BOARD} qconfig COMMAND cp .config ${NUTTX_CONFIG_DIR}/${BOARD}/${nuttx_config_type}/defconfig DEPENDS nuttx_configure WORKING_DIRECTORY ${NUTTX_DIR} diff --git a/Tools/new_nuttx_px_config.sh b/platforms/nuttx/NuttX/tools/new_nuttx_px_config.sh similarity index 100% rename from Tools/new_nuttx_px_config.sh rename to platforms/nuttx/NuttX/tools/new_nuttx_px_config.sh diff --git a/Tools/nuttx_defconf_tool.sh b/platforms/nuttx/NuttX/tools/nuttx_defconf_tool.sh similarity index 100% rename from Tools/nuttx_defconf_tool.sh rename to platforms/nuttx/NuttX/tools/nuttx_defconf_tool.sh