regenmakefiles.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. #
  3. # Check directory
  4. #
  5. if [ "${PATH/cygdrive/}" != "$PATH" ] ; then
  6. inCygwin=1
  7. else
  8. inCygwin=0
  9. fi
  10. if [ -z "$1" ]; then
  11. RTLDIR=$(pwd)
  12. else
  13. RTLDIR=$1
  14. if [ ! -d $RTLDIR ]; then
  15. echo "The directory $RTLDIR does not exist"
  16. exit 1
  17. fi
  18. fi
  19. if [ $inCygwin -eq 1 ] ; then
  20. echo "Cygwin system detected"
  21. NEWRTLDIR=`cygpath -da $RTLDIR`
  22. echo "RTLDIR=$NEWRTLDIR"
  23. if [ -n "$NEWRTLDIR" ] ; then
  24. RTLDIR="$NEWRTLDIR"
  25. fi
  26. fi
  27. #
  28. # Check rtl dir ?
  29. #
  30. if [ ! -d "$RTLDIR/ucmaps" ]; then
  31. echo "This script must be executed in the rtl directory or have an argument tto specify the RTL directory"
  32. exit 1
  33. fi
  34. #
  35. # fpcmake to use
  36. #
  37. if [ -e "$RTLDIR/../utils/fpcm/fpcmake" ]; then
  38. FPCMAKE="$RTLDIR/../utils/fpcm/fpcmake"
  39. else
  40. FPCMAKE=fpcmake
  41. fi
  42. #
  43. # Go
  44. #
  45. echo "Using fpcmake: \"$FPCMAKE\""
  46. #
  47. # Main
  48. #
  49. echo "Doing RTL toplevel dir: \"$RTLDIR\""
  50. pushd "$RTLDIR" >/dev/null 2>&1
  51. $FPCMAKE -q -Tall
  52. popd >/dev/null 2>&1
  53. #
  54. # OS-specific
  55. #
  56. for d in *
  57. do
  58. if [ -f "$d/Makefile.fpc" ]; then
  59. echo "Doing directory $d"
  60. pushd "$RTLDIR/$d" >/dev/null 2>&1
  61. case $d in
  62. darwin)
  63. TARGETS="darwin,ios,iphonesim" ;;
  64. macos)
  65. TARGETS="macosclassic" ;;
  66. *)
  67. TARGETS="$d" ;;
  68. esac
  69. CMD="$FPCMAKE -T$TARGETS -q -x $RTLDIR/inc/Makefile.rtl"
  70. echo "Command: $CMD"
  71. $CMD
  72. popd >/dev/null 2>&1
  73. fi
  74. done
  75. #
  76. # That's all, folks!
  77. #