diff --git a/Makefile b/Makefile index 287fffcb14..798ef7cbf4 100644 --- a/Makefile +++ b/Makefile @@ -554,6 +554,14 @@ check_px4: $(call make_list,nuttx,"px4") \ check_nxp: $(call make_list,nuttx,"nxp") \ sizes +# helpers for running olddefconfig (nuttx) and px4_savedefconfig on all boards +.PHONY: all_oldconfig all_px4_savedefconfig +all_oldconfig: + @for targ in $(ALL_CONFIG_TARGETS); do $(MAKE) $$targ oldconfig; done + +all_px4_savedefconfig: + @for targ in $(ALL_CONFIG_TARGETS); do $(MAKE) $$targ px4_savedefconfig; done + .PHONY: failsafe_web run_failsafe_web_server failsafe_web: @if ! command -v emcc; then echo -e "Install emscripten first: https://emscripten.org/docs/getting_started/downloads.html\nAnd source the env: source /emsdk_env.sh"; exit 1; fi diff --git a/cmake/kconfig.cmake b/cmake/kconfig.cmake index c5f09082e4..be1a54cca5 100644 --- a/cmake/kconfig.cmake +++ b/cmake/kconfig.cmake @@ -417,6 +417,17 @@ if(${LABEL} MATCHES "default" OR ${LABEL} MATCHES "bootloader" OR ${LABEL} MATCH USES_TERMINAL COMMAND_EXPAND_LISTS ) + + add_custom_target(px4_savedefconfig + COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${SAVEDEFCONFIG_PATH} + COMMAND ${CMAKE_COMMAND} -E copy defconfig ${BOARD_DEFCONFIG} + COMMAND ${CMAKE_COMMAND} -E remove defconfig + COMMAND ${CMAKE_COMMAND} -E remove ${PX4_BINARY_DIR}/NuttX/apps_copy.stamp + WORKING_DIRECTORY ${PX4_SOURCE_DIR} + USES_TERMINAL + COMMAND_EXPAND_LISTS + ) + else() add_custom_target(boardconfig ${CMAKE_COMMAND} -E env @@ -443,4 +454,15 @@ else() USES_TERMINAL COMMAND_EXPAND_LISTS ) + + add_custom_target(px4_savedefconfig + COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${SAVEDEFCONFIG_PATH} + COMMAND ${CMAKE_COMMAND} -E env ${COMMON_KCONFIG_ENV_SETTINGS} ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/kconfig/diffconfig.py -m ${PX4_BOARD_DIR}/default.px4board defconfig > ${BOARD_DEFCONFIG} + COMMAND ${CMAKE_COMMAND} -E remove defconfig + COMMAND ${CMAKE_COMMAND} -E remove ${PX4_BINARY_DIR}/NuttX/apps_copy.stamp + WORKING_DIRECTORY ${PX4_SOURCE_DIR} + USES_TERMINAL + COMMAND_EXPAND_LISTS + ) + endif()