#!/bin/sh
# $Id: build-opt-xterm,v 1.8 2020/04/27 19:48:58 tom Exp $
if [ $# = 1 ] && [ -d "$1" ]
then
	OUT=build-opt-`partition`-`pd`.log
	cat >>"$OUT" <<EOF
** `date`
** run: $*
EOF
	( cd "$1" && eval "$0" 2>&1 ) | tee -a "$OUT"
	exit
fi

. no-rcs
rcs_save

test ! -d bin && mkdir bin
for OPT in `all-opts-xterm`
do
	target=xterm-$OPT
	if test -s "bin/$target" ; then
		echo "SKIP bin/$target"
		continue
	fi
	echo "MAKE bin/$target"
	make distclean
	rm ./*.out
	cfg-normal "$@" "--$OPT" && \
	if make-out
	then
		mv xterm "bin/$target"
	else
		touch "bin/$target"
	fi
done
