Now merges configuration fragments (*.Y) as well.
This commit is contained in:
parent
dfeef5d8bb
commit
d2ed2579fa
1 changed files with 23 additions and 8 deletions
|
@ -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
|
;;
|
||||||
|
*.c) OBJ=`echo $b | sed 's/\.c$/\.o/'`
|
||||||
OBJS="$OBJS $OBJ"
|
OBJS="$OBJS $OBJ"
|
||||||
SRCS="$SRCS \\
|
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
|
||||||
|
|
||||||
include \$(TOPDIR)/Rules
|
include \$(TOPDIR)/Rules
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
sed <$TOPDIR/conf/Makefile >$CONFDIR/Makefile "s|@CONFS@|$CONFS|"
|
||||||
|
ln -s $TOPDIR/conf/*.[chl] $CONFDIR/
|
||||||
|
|
Loading…
Reference in a new issue