blob: e6e1509dc3a1ee073847baa61fbc00223b828056 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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."
|