summaryrefslogtreecommitdiff
path: root/tools/mergedirs
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-05-15 07:56:13 +0000
committerMartin Mares <mj@ucw.cz>1998-05-15 07:56:13 +0000
commit25697773b529d80278679978b7416ca9c87e15e9 (patch)
tree8ca875571e57475a15e978abae76aeda58d82149 /tools/mergedirs
parent62aa008abd627c6862310daf65ffd337a920bdbb (diff)
The library is now glued together from generic and OS-dependent parts
by the `mergedirs' script. Few more IP address manipulation functions and some fixes.
Diffstat (limited to 'tools/mergedirs')
-rwxr-xr-xtools/mergedirs36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/mergedirs b/tools/mergedirs
new file mode 100755
index 00000000..581ea4cd
--- /dev/null
+++ b/tools/mergedirs
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+if [ -z "$2" ] ; then
+ echo "Usage: mergedirs <obj-dir> <list-of-dirs>"
+ exit 1
+ fi
+TOPDIR=`pwd`
+OBJDIR=$1
+LIBDIR=$OBJDIR/lib
+shift
+echo "Merging system-dependent modules"
+MODULES=`for a in $@ ; do
+ sed <$a/Modules "s@\\(.*\\)@\\1 $a/\\1@"
+ done |
+ sort +0 -1 -u |
+ cut -d ' ' -f 2`
+rm -rf $LIBDIR
+mkdir -p $LIBDIR
+for a in $MODULES ; do
+ echo $a
+ b=`basename $a`
+ ln -s $TOPDIR/$a $LIBDIR/$b
+ OBJ=`echo $b | sed '/\.c$/!d;s/\.c$/\.o/'`
+ if [ -n "$OBJ" ] ; then
+ OBJS="$OBJS $OBJ"
+ SRCS="$SRCS \\
+ \$(TOPDIR)/$a"
+ fi
+ done
+cat >$LIBDIR/Makefile <<EOF
+OBJS=$OBJS
+SRCS=$SRCS
+LIB=birdlib.a
+
+include \$(TOPDIR)/Rules
+EOF