diff options
Diffstat (limited to 'pttbbs.mk')
-rw-r--r-- | pttbbs.mk | 38 |
1 files changed, 17 insertions, 21 deletions
@@ -11,27 +11,26 @@ OSTYPE?= $(OS) CC= gcc CCACHE!= which ccache|sed -e 's/^.*\///' PTT_CFLAGS= -Wall -pipe -DBBSHOME='"$(BBSHOME)"' -I../include -PTT_LDFLAGS= -pipe -Wall -L/usr/local/lib +PTT_LDFLAGS= -L/usr/local/lib PTT_LIBS= -lhz # enable assert() #PTT_CFLAGS+= -DNDEBUG # FreeBSD特有的環境 -CFLAGS_FreeBSD= -DHAVE_SETPROCTITLE -DFreeBSD -I/usr/local/include +CFLAGS_FreeBSD= -DHAVE_SETPROCTITLE -I/usr/local/include LDFLAGS_FreeBSD= LIBS_FreeBSD= -lkvm -liconv # Linux特有的環境 -# CFLAGS_linux= -DHAVE_DES_CRYPT -DLinux CFLAGS_Linux= -LDFLAGS_Linux= -pipe -Wall +LDFLAGS_Linux= LIBS_Linux= # SunOS特有的環境 -CFLAGS_Solaris= -DSolaris -DHAVE_DES_CRYPT -I/usr/local/include -LDFLAGS_Solaris= -L/usr/local/lib -L/usr/lib/ -LIBS_Solaris= -lnsl -lsocket -liconv -lkstat +CFLAGS_Solaris= -DSolaris -I/usr/local/include +LDFLAGS_Solaris= -L/usr/local/lib -L/usr/lib +LIBS_Solaris= -lnsl -lsocket -liconv -lkstat OS_FLAGS= -D__OS_MAJOR_VERSION__="$(OS_MAJOR_VER)" \ -D__OS_MINOR_VERSION__="$(OS_MINOR_VER)" @@ -50,33 +49,30 @@ NO_OMITFP= yes NO_FORK= yes .endif +# 若有定義 DEBUG, 則在 CFLAGS內定義 DEBUG +.if defined(DEBUG) +GDB= 1 +CFLAGS+= -DDEBUG +.endif + .if defined(USE_ICC) CC= icc CFLAGS= $(PTT_CFLAGS) -O1 -tpp6 -mcpu=pentiumpro -march=pentiumiii \ -ip -ipo LDFLAGS+= -O1 -tpp6 -mcpu=pentiumpro -march=pentiumiii -ip -ipo \ $(PTT_LDFLAGS) $(PTT_LIBS) +.elif defined(GDB) +CFLAGS= -g -O0 $(PTT_CFLAGS) +LDFLAGS= -O0 $(PTT_LDFLAGS) $(PTT_LIBS) .else -# 若有定義 GDB或 DEBUG, 則加入 -g , 否則用 -O -.if defined(GDB) || defined(DEBUG) -CFLAGS= -g $(PTT_CFLAGS) -LDFLAGS= -g $(PTT_LDFLAGS) $(PTT_LIBS) -.else -CFLAGS+= -Os -fstrength-reduce \ - -fthread-jumps -fexpensive-optimizations \ - $(PTT_CFLAGS) $(EXT_CFLAGS) +CFLAGS+= -g -Os $(PTT_CFLAGS) $(EXT_CFLAGS) LDFLAGS+= -Os $(PTT_LDFLAGS) $(PTT_LIBS) -.if !defined(NO_OMITFP) +.if defined(OMITFP) CFLAGS+= -fomit-frame-pointer .endif .endif -.endif -# 若有定義 DEBUG, 則在 CFLAGS內定義 DEBUG -.if defined(DEBUG) -CFLAGS+= -DDEBUG -.endif # 若有定義 NO_FORK, 則在 CFLAGS內定義 NO_FORK .if defined(NO_FORK) |