2021-01-11 22:18:22 +01:00
|
|
|
#! /usr/bin/env bash
|
2019-03-21 22:54:06 +01:00
|
|
|
|
2021-01-11 22:18:22 +01:00
|
|
|
# Install prefix
|
2019-05-03 11:19:36 +02:00
|
|
|
PREFIX="$HOME/.local"
|
2019-03-21 22:54:06 +01:00
|
|
|
# Individual component selection
|
|
|
|
BUILD_fxsdk=1
|
|
|
|
BUILD_fxconv=1
|
|
|
|
BUILD_fxg1a=1
|
|
|
|
|
2021-01-11 22:18:22 +01:00
|
|
|
help() {
|
|
|
|
cat << EOF
|
2019-03-21 22:54:06 +01:00
|
|
|
Configuration options for the fxSDK (fx9860g and fxcg50 development tools).
|
|
|
|
|
|
|
|
Tool selection:
|
|
|
|
<tool> may be one of the following:
|
2021-01-11 22:18:22 +01:00
|
|
|
fxsdk Project management (you generally want this)
|
|
|
|
fxconv Asset conversion for standard and custom gint formats
|
|
|
|
fxg1a G1A file wrapper, editor and analyzer
|
2019-03-21 22:54:06 +01:00
|
|
|
|
|
|
|
--enable-<tool> Build and install the selected tool [default]
|
|
|
|
--disable-<tool> Do not build or install the selected tool
|
|
|
|
|
|
|
|
Install folders:
|
|
|
|
Executables will be installed in <prefix>/bin and runtime data in
|
|
|
|
<prefix>/share/fxsdk.
|
|
|
|
|
2019-05-03 11:19:36 +02:00
|
|
|
--prefix=<prefix> Base install folder [default $HOME/.local]
|
2019-03-21 22:54:06 +01:00
|
|
|
EOF
|
2021-01-11 22:18:22 +01:00
|
|
|
exit 0
|
2019-03-21 22:54:06 +01:00
|
|
|
}
|
|
|
|
|
2021-01-11 22:18:22 +01:00
|
|
|
# Parse arguments
|
2019-03-21 22:54:06 +01:00
|
|
|
for arg; do case "$arg" in
|
2021-01-11 22:18:22 +01:00
|
|
|
-h | -? | --help)
|
|
|
|
help;;
|
|
|
|
|
|
|
|
--prefix=*)
|
|
|
|
PREFIX=${arg#--prefix=};;
|
|
|
|
|
|
|
|
--enable-*)
|
|
|
|
tool="${arg#--enable-}"
|
|
|
|
if [[ ! ":fxsdk:fxg1a:fxconv:" =~ ":$tool:" ]]; then
|
|
|
|
echo "error: $arg: no such tool"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
eval "BUILD_${tool}=1";;
|
|
|
|
|
|
|
|
--disable-*)
|
|
|
|
tool="${arg#--disable-}"
|
|
|
|
if [[ ! ":fxsdk:fxg1a:fxconv:" =~ ":$tool:" ]]; then
|
|
|
|
echo "error: $arg: no such tool"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
eval "BUILD_${tool}=0";;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "error: unrecognized option $arg"
|
|
|
|
exit 1;;
|
2019-03-21 22:54:06 +01:00
|
|
|
esac; done
|
|
|
|
|
2021-01-11 22:18:22 +01:00
|
|
|
# Generate sub-Makefile with configuration details
|
|
|
|
gen() {
|
|
|
|
# Allow an install script to change the destination at the last second
|
|
|
|
# to have all files in a separate root before packaging
|
|
|
|
# TODO: Support DESTDIR instead
|
|
|
|
echo "PREFIX ?= $PREFIX"
|
|
|
|
echo -n "TARGETS ="
|
|
|
|
[[ $BUILD_fxsdk = 1 ]] && echo -n " fxsdk"
|
|
|
|
[[ $BUILD_fxconv = 1 ]] && echo -n " fxconv"
|
|
|
|
[[ $BUILD_fxg1a = 1 ]] && echo -n " fxg1a"
|
|
|
|
echo ""
|
2019-03-21 22:54:06 +01:00
|
|
|
}
|
|
|
|
|
2021-01-11 22:18:22 +01:00
|
|
|
gen > Makefile.cfg
|