aboutsummaryrefslogtreecommitdiffstats
path: root/default.cmd.do
blob: 0e6d2916f431341ce5ef3cc0b2d7b1b51b6151ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
set -e
src=${1%.cmd}.c
if grep -q '@BUILD_CC host' "$src"; then
	tool=compile-host.tool
else
	tool=compile.tool
fi
redo-ifchange "$tool" "$src"
. ./"$tool" "${1%.cmd}.o" "$2" "$3"
jq -n --arg d "$PWD" --arg c "${cmd[*]@Q}" --arg f "$src" \
	'{directory:$d, command:$c, file:$f}' >"$3"
# vim:ft=bash