diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-15 16:20:05 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-15 16:20:05 +0800 |
commit | fd82d08d8e1f8541713c55866f5578e2ba75fb1c (patch) | |
tree | af44c1e7654a4f640330bbe9451deabc0691511d /pttbbs.mk | |
parent | b1575031b5c9da036d2f33053691d0fdc4ed43df (diff) | |
download | pttbbs-fd82d08d8e1f8541713c55866f5578e2ba75fb1c.tar pttbbs-fd82d08d8e1f8541713c55866f5578e2ba75fb1c.tar.gz pttbbs-fd82d08d8e1f8541713c55866f5578e2ba75fb1c.tar.bz2 pttbbs-fd82d08d8e1f8541713c55866f5578e2ba75fb1c.tar.lz pttbbs-fd82d08d8e1f8541713c55866f5578e2ba75fb1c.tar.xz pttbbs-fd82d08d8e1f8541713c55866f5578e2ba75fb1c.tar.zst pttbbs-fd82d08d8e1f8541713c55866f5578e2ba75fb1c.zip |
use pttbbs.mk
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@847 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'pttbbs.mk')
-rw-r--r-- | pttbbs.mk | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/pttbbs.mk b/pttbbs.mk new file mode 100644 index 00000000..a246651c --- /dev/null +++ b/pttbbs.mk @@ -0,0 +1,52 @@ +# $Id: pttbbs.mk,v 1.1 2003/05/15 08:20:05 in2 Exp $ +# 訂義基本初值 +BBSHOME?= $(HOME) +BBSHOME?= /home/bbs +OSTYPE?= FreeBSD +CC?= gcc +PTT_CFLAGS= -Wall -pipe -DBBSHOME='"$(BBSHOME)"' -I../include +PTT_LDFLAGS= -pipe -Wall +PTT_LIBS= -lcrypt + +# 在 CFLAGS內加入定義 COMPILE_TIME +PTT_CFLAGS+= "-DCOMPILE_TIME=\"`date`\"" + +# 稍後再 enable assert() +PTT_CFLAGS+= -DNDEBUG + +# FreeBSD特有的環境 +CFLAGS_FreeBSD= -DHAVE_SETPROCTITLE -DFreeBSD +LDFLAGS_FreeBSD= +LIBS_FreeBSD= -lkvm + +# Linux特有的環境 +CFLAGS_linux= -DHAVE_DES_CRYPT -DLinux +LDFLAGS_linux= -pipe -Wall +LIBS_linux= + +# CFLAGS, LDFLAGS, LIBS 加入 OS 相關參數 +PTT_CFLAGS+= $(CFLAGS_$(OSTYPE)) +PTT_LDFLAGS+= $(LDFLAGS_$(OSTYPE)) +PTT_LIBS+= $(LIBS_$(OSTYPE)) + +# 若有定義 GDB或 DEBUG, 則加入 -g , 否則用 -O +.if defined(GDB) || defined(DEBUG) +CFLAGS= -g $(PTT_CFLAGS) +LDFLAGS= -g $(PTT_LDFLAGS) $(PTT_LIBS) +.else +CFLAGS+= -O2 -Os -fomit-frame-pointer -fstrength-reduce \ + -fthread-jumps -fexpensive-optimizations \ + $(PTT_CFLAGS) +LDFLAGS+= -O2 $(PTT_LDFLAGS) $(PTT_LIBS) +.endif + +# 若有定義 DEBUG, 則在 CFLAGS內定義 DEBUG +.if defined(DEBUG) +CFLAGS+= -DDEBUG +.endif + +# 若有定義 NO_FORK, 則在 CFLAGS內定義 NO_FORK +.if defined(NO_FORK) +CFLAGS+= -DNO_FORK +.endif + |