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