diff options
author | Martin Mares <mj@ucw.cz> | 1998-11-27 20:31:41 +0100 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1998-11-27 20:31:41 +0100 |
commit | d2ed2579fa365fa36b7882ef847b9e640290c05e (patch) | |
tree | 3b292c22364b120099f1b133d6578eedf16a8c10 /tools/mergedirs | |
parent | dfeef5d8bb9fe19cb44d4121fd8324179a38b7a0 (diff) | |
download | bird-d2ed2579fa365fa36b7882ef847b9e640290c05e.tar bird-d2ed2579fa365fa36b7882ef847b9e640290c05e.zip |
Now merges configuration fragments (*.Y) as well.
Diffstat (limited to 'tools/mergedirs')
-rwxr-xr-x | tools/mergedirs | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/tools/mergedirs b/tools/mergedirs index 581ea4c..3a085fd 100755 --- a/tools/mergedirs +++ b/tools/mergedirs @@ -7,26 +7,38 @@ if [ -z "$2" ] ; then TOPDIR=`pwd` OBJDIR=$1 LIBDIR=$OBJDIR/lib +CONFDIR=$OBJDIR/conf 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 +rm -rf $LIBDIR $CONFDIR +mkdir -p $LIBDIR $CONFDIR 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 \\ + case $b in + *.h) ln -s $TOPDIR/$a $LIBDIR/$b + ;; + *.c) OBJ=`echo $b | sed 's/\.c$/\.o/'` + OBJS="$OBJS $OBJ" + SRCS="$SRCS \\ \$(TOPDIR)/$a" - fi + ln -s $TOPDIR/$a $LIBDIR/$b + ;; + *.Y) CONFS="$CONFS\$(TOPDIR)/$a " + ln -s $TOPDIR/$a $CONFDIR/$b + ;; + *) echo "$b: Unknown file type" + exit 1 + ;; + esac done + cat >$LIBDIR/Makefile <<EOF OBJS=$OBJS SRCS=$SRCS @@ -34,3 +46,6 @@ LIB=birdlib.a include \$(TOPDIR)/Rules EOF + +sed <$TOPDIR/conf/Makefile >$CONFDIR/Makefile "s|@CONFS@|$CONFS|" +ln -s $TOPDIR/conf/*.[chl] $CONFDIR/ |