done
MACHINE=`./choose-machine.sh "${MACHINE}"`
-CMD="rm -f machine"
-echo "${CMD}"; eval "${CMD}"
+make_link ()
+{
+ local target link
+ target="${1}"
+ link="${2}"
+ if [ -e "${link}" -a ! -L "${link}" ]; then
+ cat <<EOF >&2
+${link} is not a symbolic link; refusing to clobber it.
+EOF
+ exit 1
+ else
+ CMDS="rm -f ${link} && ln -s ${target} ${link}"
+ echo "${CMDS}"; eval "${CMDS}"
+ fi
+}
-CMD="ln -s machines/${MACHINE} machine"
-echo "${CMD}"; eval "${CMD}"
+make_link "machines/${MACHINE}" machine
LINKS="compiler.cbf compiler.pkg compiler.sf make.com"
if test "${MACHINE}" = C; then
fi
for FN in ${LINKS}; do
- if [ ! -f "${FN}" ]; then
- CMD="ln -s machine/${FN} ."
- echo "${CMD}"; eval "${CMD}"
- fi
+ make_link "machine/${FN}" "${FN}"
done