summaryrefslogtreecommitdiffstats
path: root/build_one.sh
blob: c92e96f79140f63facc2e4e94138f744de6c2997 (plain)
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
#!/bin/bash

pattern="$1"
config=( $(find ptxconfigs/ -path "*${pattern}*.ptxconfig") )
shift

if [ ${#config[@]} -eq 0 ]; then
	echo "Could not find config for '${pattern}'!"
	exit 1
fi
if [ ${#config[@]} -gt 1 ]; then
	echo "'${pattern}' matches more than on config:"
	for cfg in "${config[@]}"; do
		echo -e "\t${cfg}"
	done
	exit 1
fi

target="$(basename "${config}")"
target="${target%.ptxconfig}"

if [ $# -gt 0 ]; then
	target="gstate/${target//_/-}.build"
	exec "$(dirname $0)/build_all_v2.mk" "${target}" ARG="${*}"
else
	target="gstate/${target//_/-}.pkgs"
	exec "$(dirname $0)/build_all_v2.mk" "${target}"
fi