Skip to content

Commit

Permalink
buildsystem_sanity_check: script to save deps resolution variables
Browse files Browse the repository at this point in the history
Add a script saving all applications and boards dependency resolution
variables.

It is slow but should dump everything.
  • Loading branch information
cladmi committed Aug 22, 2019
1 parent f3a5401 commit 7a18e2f
Showing 1 changed file with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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 <gaetan.harter@fu-berlin.de>

: "${RIOTBASE:="$(cd "$(dirname "$0")/../../../" || exit; pwd)"}"

usage() {
echo "Usage: $0 <output_directory>"
}


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

0 comments on commit 7a18e2f

Please sign in to comment.