Project

General

Profile

1 9555 aaronmk
#!/bin/bash -e
2
. "$(dirname "${BASH_SOURCE[0]}")"/util.run
3 9854 aaronmk
.rel ../sh/local.sh
4 9555 aaronmk
5
if self_not_included; then
6
7
: "${schema="$(log+ 2 cd "$top_dir"/..; basename "$PWD")"}"
8 9585 aaronmk
: "${subdir="$(log+ 2 cd "$top_dir"   ; basename "$PWD")"}"
9
export schema subdir
10 9555 aaronmk
11 9585 aaronmk
subdir_make()
12 9555 aaronmk
# requires Makefile in datasrc dir with `include ../input.Makefile`
13 9585 aaronmk
# target names are relative to the subdir itself, not the datasrc dir
14 9555 aaronmk
{
15 9584 aaronmk
	echo_func
16 9745 aaronmk
	set -- "${@/#/$subdir/}" # replace empty str at start (/#) with $subdir/
17 9943 aaronmk
	set -- "${@/%/${remake:+-remake}}" # replace empty str at end (/%)
18 9745 aaronmk
	make --directory="$(canon_rel_path "$top_dir"/..)" "$@"
19 9555 aaronmk
}
20
21
fi