]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
Updated linkarch script to work with the new GIT repositories.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 Mar 2008 15:28:12 +0000 (16:28 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 Mar 2008 15:28:12 +0000 (16:28 +0100)
common/Makefile.omk
common/linkarch

index 5baf5ed56f776e3a873ff6d330d2fd894eb12fee..a29583027ad1e8902da7b36d8795352e8dff3f14 100644 (file)
@@ -1,3 +1,3 @@
 # -*- makefile -*-
 
-SUBDIRS = $(ALL_OMK_SUBDIRS)
+SUBDIRS = $(filter-out common,$(ALL_OMK_SUBDIRS))
index e19c9000e1e227f428c1403e4d5dff793222f625..4a4c038aab851b85265866137fc3ecc629d5256c 100755 (executable)
@@ -1,34 +1,29 @@
 #!/bin/sh
 
-if [ -z "$1" ]; then
-    echo "Usage: linkarch <arch directory>"
-    exit 1;
-fi
-
-ARCH_DIR=$1
-
-ARCH_DIR=`cd $ARCH_DIR; pwd`
+# This script recursively creates links to files from common directory
+# in the current tree.
 
 function make_links
 {
-    DIR=$1
-    if [ ! -d $DIR ]; then
-        echo "Can't find $DIR in current directory";
+    SRC_DIR=$1
+    if [ ! -d $SRC_DIR ]; then
+        echo "Error: Can't find $SRC_DIR in current directory";
         exit 1;
     fi
-    if [ ! -d $ARCH_DIR/$DIR ]; then
-        echo "Warning: Can't find $ARCH_DIR/$DIR directory";
-        return
-    fi
-
-    for f in $ARCH_DIR/$DIR/*; do
-        [ ! -f $DIR/`basename $f` -a ! -L $DIR/`basename $f` ] && ln -s `echo $f|sed 's!//!/!'` $DIR/`basename $f`
+    for f in $SRC_DIR/*; do
+       bf=`basename $f`
+        if [ ! -e $bf ]; then
+           ln -sf $f $bf
+       else
+           if [ -d $bf -a ! -L $bf ]; then
+               (cd $bf; make_links ../$f)
+           fi
+       fi
     done
 
 }
 
-make_links app
-make_links arch
-make_links board
-make_links libs4c
-make_links doc
+# Maybe we should delete existing links
+#find -lname '*common/*'
+
+make_links common