Add-in development tools for fx-9860G and fx-CG 50, to use with GCC and gint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
1.9KB

  1. #! /bin/bash
  2. #
  3. # Output variables
  4. #
  5. # Path parameters
  6. PREFIX="$HOME/.local"
  7. # Individual component selection
  8. BUILD_fxsdk=1
  9. BUILD_fxconv=1
  10. BUILD_fxg1a=1
  11. #
  12. # Tool name checking
  13. #
  14. check()
  15. {
  16. [[ $1 = "fxsdk" ]] ||
  17. [[ $1 = "fxconv" ]] ||
  18. [[ $1 = "fxg1a" ]]
  19. }
  20. #
  21. # Usage
  22. #
  23. help()
  24. {
  25. cat << EOF
  26. Configuration options for the fxSDK (fx9860g and fxcg50 development tools).
  27. Tool selection:
  28. <tool> may be one of the following:
  29. "fxsdk" Command-line options (you generally want this)
  30. "fxconv" Asset conversion for gint (or any 4-aligned-VRAM system)
  31. "fxg1a" G1A file wrapper, editor and analyzer
  32. --enable-<tool> Build and install the selected tool [default]
  33. --disable-<tool> Do not build or install the selected tool
  34. Install folders:
  35. Executables will be installed in <prefix>/bin and runtime data in
  36. <prefix>/share/fxsdk.
  37. --prefix=<prefix> Base install folder [default $HOME/.local]
  38. EOF
  39. exit 0
  40. }
  41. #
  42. # Argument parsing
  43. #
  44. for arg; do case "$arg" in
  45. -h | -? | --help)
  46. help;;
  47. --prefix=*)
  48. PREFIX=${arg#--prefix=};;
  49. --enable-*)
  50. tool="${arg#--enable-}"
  51. if ! check $tool; then
  52. echo "error: cannot enable $tool: unknown tool"
  53. exit 1
  54. fi
  55. eval "BUILD_${tool}=1";;
  56. --disable-*)
  57. tool="${arg#--disable-}"
  58. if ! check $tool; then
  59. echo "error: cannot disable $tool: unknown tool"
  60. exit 1
  61. fi
  62. eval "BUILD_${tool}=0";;
  63. *)
  64. echo "error: unrecognized option $arg"
  65. exit 1;;
  66. esac; done
  67. #
  68. # Makefile generation
  69. #
  70. gen()
  71. {
  72. # Allow an install script to change the destination at the last second
  73. # to have all files in a separate root before packaging
  74. echo "PREFIX ?= $PREFIX"
  75. echo -n "TARGETS ="
  76. [[ $BUILD_fxsdk = 1 ]] && echo -n " fxsdk"
  77. [[ $BUILD_fxconv = 1 ]] && echo -n " fxconv"
  78. [[ $BUILD_fxg1a = 1 ]] && echo -n " fxg1a"
  79. echo ""
  80. }
  81. echo "Configuration complete, the following has been saved in Makefile.cfg:"
  82. echo ""
  83. gen | tee Makefile.cfg
  84. echo ""
  85. echo "You can now 'make'."