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.

113 lines
2.0KB

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