diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-12 11:24:11 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-12 11:24:11 +0800 |
commit | 66b044d59ae04d0a3fea2ec12b44076a47da4add (patch) | |
tree | 777c7f2fe83ac4b29e12c33942fdb77482548101 | |
parent | 20dcffd255f3db8f1ef70ab61b87aba3b2b859b9 (diff) | |
download | pttbbs-66b044d59ae04d0a3fea2ec12b44076a47da4add.tar pttbbs-66b044d59ae04d0a3fea2ec12b44076a47da4add.tar.gz pttbbs-66b044d59ae04d0a3fea2ec12b44076a47da4add.tar.bz2 pttbbs-66b044d59ae04d0a3fea2ec12b44076a47da4add.tar.lz pttbbs-66b044d59ae04d0a3fea2ec12b44076a47da4add.tar.xz pttbbs-66b044d59ae04d0a3fea2ec12b44076a47da4add.tar.zst pttbbs-66b044d59ae04d0a3fea2ec12b44076a47da4add.zip |
makefile clean up
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2593 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | pttbbs.mk | 38 | ||||
-rw-r--r-- | util/bbsrf.c | 2 | ||||
-rw-r--r-- | util/diskstat.c | 4 | ||||
-rw-r--r-- | util/outmail.c | 2 |
5 files changed, 22 insertions, 28 deletions
@@ -1,6 +1,4 @@ SUBDIR= mbbsd util innbbsd -BBSHOME?=$(HOME) -OSTYPE!=uname all install clean: .if !exists(/usr/local/lib/libhz.so) && !exists(/usr/lib/libhz.so) @@ -11,6 +9,6 @@ all install clean: .endif @for i in $(SUBDIR); do\ cd $$i;\ - $(MAKE) BBSHOME=$(BBSHOME) $@;\ + $(MAKE) $@;\ cd ..;\ done @@ -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) diff --git a/util/bbsrf.c b/util/bbsrf.c index ce1440e7..27ed9e3a 100644 --- a/util/bbsrf.c +++ b/util/bbsrf.c @@ -21,7 +21,7 @@ #define U_FILE UTMP_FILE #endif -#ifdef FreeBSD +#ifdef __FreeBSD__ #define UTMP_FILE _PATH_UTMP #endif diff --git a/util/diskstat.c b/util/diskstat.c index 1b785120..bc80ece1 100644 --- a/util/diskstat.c +++ b/util/diskstat.c @@ -1,4 +1,4 @@ -#ifndef FreeBSD +#ifndef __FreeBSD__ #include <stdio.h> int main(int argc, char **argv) { @@ -785,4 +785,4 @@ cpustats(void) printf("%3.0f", 100. * cur.cp_time[state] / (time ? time : 1)); } -#endif // FreeBSD +#endif // __FreeBSD__ diff --git a/util/outmail.c b/util/outmail.c index 53e6e44d..7f036c4f 100644 --- a/util/outmail.c +++ b/util/outmail.c @@ -65,7 +65,7 @@ int connectMailServer(char *servername, int serverport) } memset(&addr, 0, sizeof(addr)); -#ifdef FreeBSD +#ifdef __FreeBSD__ addr.sin_len = sizeof(addr); #endif addr.sin_family = AF_INET; |