summaryrefslogtreecommitdiffstats
path: root/pttbbs.mk
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-06 18:15:33 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-06 18:15:33 +0800
commit029bfc6493cd2134728b6b5280391aba8dd0d0df (patch)
treeb5cb39d4791b363ed663b75007ff44344ebb0a16 /pttbbs.mk
parentd8f00661e5f3eb46ec9f791506916ae5de983ca9 (diff)
downloadpttbbs-029bfc6493cd2134728b6b5280391aba8dd0d0df.tar
pttbbs-029bfc6493cd2134728b6b5280391aba8dd0d0df.tar.gz
pttbbs-029bfc6493cd2134728b6b5280391aba8dd0d0df.tar.bz2
pttbbs-029bfc6493cd2134728b6b5280391aba8dd0d0df.tar.lz
pttbbs-029bfc6493cd2134728b6b5280391aba8dd0d0df.tar.xz
pttbbs-029bfc6493cd2134728b6b5280391aba8dd0d0df.tar.zst
pttbbs-029bfc6493cd2134728b6b5280391aba8dd0d0df.zip
PROFILING support
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1708 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'pttbbs.mk')
-rw-r--r--pttbbs.mk16
1 files changed, 14 insertions, 2 deletions
diff --git a/pttbbs.mk b/pttbbs.mk
index 1c44aed7..4b85d062 100644
--- a/pttbbs.mk
+++ b/pttbbs.mk
@@ -28,15 +28,27 @@ PTT_CFLAGS+= $(CFLAGS_$(OSTYPE))
PTT_LDFLAGS+= $(LDFLAGS_$(OSTYPE))
PTT_LIBS+= $(LIBS_$(OSTYPE))
+# 若有定義 PROFILING
+.if defined(PROFILING)
+PTT_CFLAGS+= -pg
+PTT_LDFLAGS+= -pg
+NO_OMITFP= yes
+NO_FORK= yes
+.endif
+
# 若有定義 GDB或 DEBUG, 則加入 -g , 否則用 -O
.if defined(GDB) || defined(DEBUG)
CFLAGS= -g $(PTT_CFLAGS)
LDFLAGS= -g $(PTT_LDFLAGS) $(PTT_LIBS)
.else
-CFLAGS+= -Os -fomit-frame-pointer -fstrength-reduce \
+CFLAGS+= -Os -fstrength-reduce \
-fthread-jumps -fexpensive-optimizations \
- $(PTT_CFLAGS)
+ $(PTT_CFLAGS) $(EXT_CFLAGS)
LDFLAGS+= -Os $(PTT_LDFLAGS) $(PTT_LIBS)
+
+.if !defined(NO_OMITFP)
+CFLAGS+= -fomit-frame-pointer
+.endif
.endif
# 若有定義 DEBUG, 則在 CFLAGS內定義 DEBUG