From 7a18e2fb8b3aa91262229448a177cb674e86ea6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Tue, 13 Aug 2019 17:09:00 +0200 Subject: [PATCH] buildsystem_sanity_check: script to save deps resolution variables Add a script saving all applications and boards dependency resolution variables. It is slow but should dump everything. --- ...e_all_dependencies_resolution_variables.sh | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 dist/tools/buildsystem_sanity_check/save_all_dependencies_resolution_variables.sh diff --git a/dist/tools/buildsystem_sanity_check/save_all_dependencies_resolution_variables.sh b/dist/tools/buildsystem_sanity_check/save_all_dependencies_resolution_variables.sh new file mode 100755 index 0000000000000..cd96de6573678 --- /dev/null +++ b/dist/tools/buildsystem_sanity_check/save_all_dependencies_resolution_variables.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2019 Freie Universität Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +# Script to save all the dependencies resolution variables for both normal and +# in `info-boards-supported` resolution. +# +# The script takes a long time +# +# @author: Gaëtan Harter + +: "${RIOTBASE:="$(cd "$(dirname "$0")/../../../" || exit; pwd)"}" + +usage() { + echo "Usage: $0 " +} + + +applications() { + make --no-print-directory -C "${RIOTBASE}" info-applications +} + + +boards() { + make --no-print-directory -C "${RIOTBASE}" info-boards +} + + +function info_deps_variables_application() { + local application="$1" + local output_dir="$2/${application}" + + DEPENDENCY_DEBUG=1 DEPENDENCY_DEBUG_OUTPUT_DIR="${output_dir}/info-global" make --no-print-directory -C "${RIOTBASE}/${application}" info-boards-supported >/dev/null + for board in $(boards) + do + DEPENDENCY_DEBUG_OUTPUT_DIR="${output_dir}/info" BOARD="${board}" make --no-print-directory -C "${RIOTBASE}/${application}" dependency_debug >/dev/null + done +} + + +main() { + if [[ $# -ne 1 ]]; then + usage + exit 1 + fi + local output_dir + + # No 'realpath' in mac by default… + output_dir=$(python -c 'import os.path; print(os.path.abspath("'"$1"'"))') + + for app in $(applications) + do + echo "Evaluating ${app}" >&2 + info_deps_variables_application "${app}" "${output_dir}" + done + +} + + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main "$@" +fi