Commit d2ed2579 authored by Martin Mareš's avatar Martin Mareš
Browse files

Now merges configuration fragments (*.Y) as well.

parent dfeef5d8
...@@ -7,26 +7,38 @@ if [ -z "$2" ] ; then ...@@ -7,26 +7,38 @@ if [ -z "$2" ] ; then
TOPDIR=`pwd` TOPDIR=`pwd`
OBJDIR=$1 OBJDIR=$1
LIBDIR=$OBJDIR/lib LIBDIR=$OBJDIR/lib
CONFDIR=$OBJDIR/conf
shift shift
echo "Merging system-dependent modules" echo "Merging system-dependent modules"
MODULES=`for a in $@ ; do MODULES=`for a in $@ ; do
sed <$a/Modules "s@\\(.*\\)@\\1 $a/\\1@" sed <$a/Modules "s@\\(.*\\)@\\1 $a/\\1@"
done | done |
sort +0 -1 -u | sort +0 -1 -u |
cut -d ' ' -f 2` cut -d ' ' -f 2`
rm -rf $LIBDIR rm -rf $LIBDIR $CONFDIR
mkdir -p $LIBDIR mkdir -p $LIBDIR $CONFDIR
for a in $MODULES ; do for a in $MODULES ; do
echo $a echo $a
b=`basename $a` b=`basename $a`
ln -s $TOPDIR/$a $LIBDIR/$b case $b in
OBJ=`echo $b | sed '/\.c$/!d;s/\.c$/\.o/'` *.h) ln -s $TOPDIR/$a $LIBDIR/$b
if [ -n "$OBJ" ] ; then ;;
OBJS="$OBJS $OBJ" *.c) OBJ=`echo $b | sed 's/\.c$/\.o/'`
SRCS="$SRCS \\ OBJS="$OBJS $OBJ"
SRCS="$SRCS \\
\$(TOPDIR)/$a" \$(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 done
cat >$LIBDIR/Makefile <<EOF cat >$LIBDIR/Makefile <<EOF
OBJS=$OBJS OBJS=$OBJS
SRCS=$SRCS SRCS=$SRCS
...@@ -34,3 +46,6 @@ LIB=birdlib.a ...@@ -34,3 +46,6 @@ LIB=birdlib.a
include \$(TOPDIR)/Rules include \$(TOPDIR)/Rules
EOF EOF
sed <$TOPDIR/conf/Makefile >$CONFDIR/Makefile "s|@CONFS@|$CONFS|"
ln -s $TOPDIR/conf/*.[chl] $CONFDIR/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment