summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/FAQ16
-rwxr-xr-xutil/pmakev2.sh42
2 files changed, 54 insertions, 4 deletions
diff --git a/docs/FAQ b/docs/FAQ
index 12b6d287..9b3bbfcd 100644
--- a/docs/FAQ
+++ b/docs/FAQ
@@ -23,10 +23,18 @@ $Id$
如: apt-get install pmake
alias make pmake
-注意: pmake 2.X 把 .if 改成 #if 的格式,會造成很多問題,而且雖然有提供
--Z . 可以用 . 代替 # ,但 system.mk 等系統檔仍為 # 所以會爛
-
-請裝 pmake 1.X
+注意: 如果你 pmake 看到 "Makefile", line 9: Missing dependency operator
+是因為裝了 pmake 2.x (Debian 目前裝的是 1.9x, 而 Mandrake 就是用 2.x)。
+PMake 2.x 把 .if 改成 #if 的格式,這會造成舊的檔案都失效,而且雖然有提供
+-Z . 可用 . 代替 # ,但 system.mk 等系統檔仍為 # 所以會爛。
+
+PttBBS 會不會改成 PMake v2 的格式呢? 因為 BSD 系統都沒變,所以可能不會改。
+
+解決方法有兩種
+(1) 請裝 pmake 1.x ,簡單直接的作法
+(2) 不過有時候你就是不幸要用 pmake 2.x,所以有個小程式可以幫你忙。
+ 在 pttbbs/ 目錄下執行 util/pmakev2.sh
+ 它會自動轉換成 PMake v2 的格式。
------------------------------------------------------------------------------
3.加大 shared-memory
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."