justfile (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
targets := `find crossfiles -type f | awk -F'[/.]' '{print $2}' | sed -z 's/\n/|/g'`
bash := `which bash`
list-targets:
@echo '{{ targets }}'
[working-directory('.')]
core target="x86_64-linux": (check-supported target)
@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('.')]
test target="x86_64-linux": (check-supported target)
@echo 'Building libcirce-core for target {{ target }}'
cd build-{{ target }} && meson test
[working-directory('.')]
check-supported 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
[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
|