targets := `find crossfiles -type f | awk -F'[/.]' '{print $2}' | sed -z 's/\n/|/g'` bash := `which bash` list-targets: @echo `echo '{{ targets }}' | sed 's/|/, /g'` [working-directory('.')] core target: #!{{ bash }} set -euo pipefail if [[(! "{{ target }}" =~ "^{{ targets }}$") || (-z "{{ target }}")]]; then echo "Target not supported. Use 'just list-targets' for a list of supported core targets." exit 1 fi echo 'Building libcirce-core for target {{ target }}' meson setup --cross-file $(pwd)/crossfiles/{{ target }}.ini build-{{ target }} ninja -C build-{{ target }} libcirce-core.a [working-directory('.')] cleanall: #!{{ bash }} set -euo pipefail echo 'Cleaning repo' for target in `echo '{{ targets }}' | sed 's/|/\n/g'` do if [[ -d "build-${target}" ]]; then ninja -C build-${target} clean fi done