2007-09-25 20:23:15 +00:00
|
|
|
#!/bin/sh
|
2008-11-16 19:31:42 +00:00
|
|
|
for d in `find . -name packages | grep driver`; do
|
2007-09-25 20:23:15 +00:00
|
|
|
cd `dirname $d`
|
|
|
|
echo "Entering "`dirname $d`
|
|
|
|
for p in `cat packages`; do
|
|
|
|
_NAME=${p%%|*}
|
2008-09-01 21:31:52 +00:00
|
|
|
NAME=${_NAME%-*}
|
2007-09-25 20:23:15 +00:00
|
|
|
BASE_NAME=${NAME%%-*}
|
2008-09-01 21:31:52 +00:00
|
|
|
VER=${_NAME##*-}
|
2007-09-25 20:23:15 +00:00
|
|
|
DEP=`echo ${p##*|} | sed "s/+/ +/g"`
|
|
|
|
echo generating Makefile for ${NAME}-${VER} with deps : ${DEP}
|
2008-09-01 21:31:52 +00:00
|
|
|
rm -f ${NAME}/Makefile
|
2008-09-03 20:55:27 +00:00
|
|
|
if [ -e ${NAME}/patches ]; then
|
|
|
|
rm -f ${NAME}/patches/*
|
|
|
|
fi
|
2008-09-01 21:31:52 +00:00
|
|
|
if [ "$1" = "gen" ]; then
|
|
|
|
if [ ! -e ${NAME} ]; then
|
|
|
|
mkdir ${NAME}
|
|
|
|
fi
|
2007-09-25 20:23:15 +00:00
|
|
|
sed "s/@VER@/${VER}/g" template.mk | sed "s/@DEP@/${DEP}/g" | sed "s/@NAME@/${NAME}/g" | sed "s/@BASE_NAME@/${BASE_NAME}/g" > ${NAME}/Makefile
|
|
|
|
if [ -d `pwd`/patches/${NAME} ]; then
|
2008-09-03 20:55:27 +00:00
|
|
|
if [ ! -d ${NAME}/patches ]; then
|
|
|
|
mkdir ${NAME}/patches
|
|
|
|
fi
|
2007-09-25 20:23:15 +00:00
|
|
|
cp -r `pwd`/patches/${NAME}/* ${NAME}/patches/
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
cd - > /dev/null
|
|
|
|
done
|