Files
cappuccino/Tools/Install/install-tools
T

64 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
usage()
{
echo "$0 [--prefix install_directory]"
exit 1
}
INSTALL_DIR="/usr/local"
# Parse parameters
while [ $# -ge 1 ]; do
case $1 in
--prefix)
INSTALL_DIR=$2
shift
;;
*)
usage
;;
esac
shift
done
mkdir -p $INSTALL_DIR/bin
mkdir -p $INSTALL_DIR/share/objj
cp -fR objj/* $INSTALL_DIR/share/objj/.
BINS=`ls objj/bin`
for BIN in $BINS
do
ln -sf $INSTALL_DIR/share/objj/bin/$BIN $INSTALL_DIR/bin/$BIN
chmod +x $INSTALL_DIR/bin/$BIN
done
chmod +x $INSTALL_DIR/share/objj/bin/*
cat <<EOT
Installation of the Objective-J tools to $INSTALL_DIR is almost complete!
Several environment variables should be set:
- PATH should include $INSTALL_DIR/bin:
export PATH=\$PATH:$INSTALL_DIR/bin
(currently: $PATH)
- OBJJ_HOME should be set to $INSTALL_DIR/share/objj:
export OBJJ_HOME=$INSTALL_DIR/share/objj
(currently: $OBJJ_HOME)
- STEAM_BUILD should be set (required) to the build directory of your choice (e.x. $HOME/objj_build):
export STEAM_BUILD=$HOME/objj_build
(currently: $STEAM_BUILD)
EOT