Browse Source

* Script to regenerate makefiles with proper options

Michaël Van Canneyt 2 years ago
parent
commit
a77c50728f
1 changed files with 63 additions and 0 deletions
  1. 63 0
      rtl/regenmakefiles.sh

+ 63 - 0
rtl/regenmakefiles.sh

@@ -0,0 +1,63 @@
+#!/bin/bash
+#
+# Check directory
+#
+if [ -z "$1" ]; then
+  RTLDIR=$(pwd)
+else
+  RTLDIR=$1
+  if [ ! -d $RTLDIR ]; then
+    echo "The directory $RTLDIR does not exist"
+    exit 1
+  fi  
+fi 
+#
+# Check rtl dir ?
+#
+if [ ! -d $RTLDIR/ucmaps ]; then
+  echo "This script must be executed in the rtl directory or have an argument tto specify the RTL directory"
+  exit 1
+fi
+#
+# fpcmake to use
+#
+if [ -e $RTLDIR/../utils/fpcm/fpcmake ]; then
+  FPCMAKE=$RTLDIR/../utils/fpcm/fpcmake
+else
+  FPCMAKE=fpcmake
+fi  
+#
+# Go
+#
+echo "Using fpcmake: $FPCMAKE"
+#
+# Main
+#
+echo "Doing RTL toplevel dir: $RTLDIR"
+pushd $RTLDIR >/dev/null 2>&1
+$FPCMAKE -q -Tall
+popd >/dev/null 2>&1
+#
+# OS-specific
+#
+for d in *
+do
+  if [ -f $d/Makefile.fpc ]; then
+    echo "Doing directory $d"
+    pushd $RTLDIR/$d >/dev/null 2>&1
+    case $d in
+      darwin) 
+        TARGETS="darwin,ios,iphonesim" ;;
+      *)
+        TARGETS=$d  
+    esac  
+    CMD="$FPCMAKE -T$TARGETS -q -x $RTLDIR/inc/Makefile.rtl"
+    # echo "Command: $CMD"
+    $CMD 
+    popd >/dev/null 2>&1
+  fi
+done
+#
+# That's all, folks!
+#
+