diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-05 23:21:38 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-05 23:21:38 +0800 |
commit | 8e98be925ce38e16b56175a6c6f10a34517af29f (patch) | |
tree | 317b313ed1e784aaece19e3c58408b1fd16f7364 /util | |
parent | 63ec22865783cf36a950eb4405b3ce59826843fa (diff) | |
download | pttbbs-8e98be925ce38e16b56175a6c6f10a34517af29f.tar pttbbs-8e98be925ce38e16b56175a6c6f10a34517af29f.tar.gz pttbbs-8e98be925ce38e16b56175a6c6f10a34517af29f.tar.bz2 pttbbs-8e98be925ce38e16b56175a6c6f10a34517af29f.tar.lz pttbbs-8e98be925ce38e16b56175a6c6f10a34517af29f.tar.xz pttbbs-8e98be925ce38e16b56175a6c6f10a34517af29f.tar.zst pttbbs-8e98be925ce38e16b56175a6c6f10a34517af29f.zip |
add tools for PMake v2
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2895 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rwxr-xr-x | util/pmakev2.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/util/pmakev2.sh b/util/pmakev2.sh new file mode 100755 index 00000000..e6e1509d --- /dev/null +++ b/util/pmakev2.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# Modify Makefiles to work with PMake v2. +# PMake v2 used '#if' to replace '.if'. + +TESTFN=pttbbs.mk + +echo "Checking directory..." + +if [ ! -f $TESTFN -a -f ../$TESTFN ] ; then + cd .. # more chance to locate it +fi + +if [ ! -f $TESTFN ] ; then + echo "Please prepare your $TESTFN first and run this script in" + echo "same level directory with $TESTFN" + exit 1 +fi + +echo "Found $TESTFN, check pmake version..." + +if ( pmake -h 2>/dev/null >/dev/null ) ; then + echo "OK, you have pmake v2." +else + echo "I can't find pmake v2. You are using v1 or pmake not installed." + echo "This script only works for pmake v2." + exit 2 +fi + +for X in `find . -name "Makefile"` `find . -name "*.mk"` +do + echo "$X -> $X.orig" + mv -f $X $X.orig + # I'm not sure if very old sed has multiple command supporting, + # and what about their regex, so let's be stupid here. + cat $X.orig | sed 's/^\.if/#if/' \ + | sed 's/^\.el/#el/'| sed 's/^\.end/#end/' \ + | sed 's/^\.include/#include/' \ + > $X +done + +echo "Complete. Now invoke pmake and try." |