From dea6f126fe167ed6f452bd0616de7e6bdc24369d Mon Sep 17 00:00:00 2001 From: in2 Date: Sun, 22 Jun 2003 04:32:38 +0000 Subject: move COMPILE_TIME from .mk to vers.c git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@954 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/.cvsignore | 1 + mbbsd/Makefile | 5 +++-- mbbsd/cal.c | 5 +++-- pttbbs.mk | 5 +---- util/newvers.sh | 8 ++++++++ 5 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 util/newvers.sh diff --git a/mbbsd/.cvsignore b/mbbsd/.cvsignore index 35f9f2d1..b5881695 100644 --- a/mbbsd/.cvsignore +++ b/mbbsd/.cvsignore @@ -1,2 +1,3 @@ *.o mbbsd +vers.c diff --git a/mbbsd/Makefile b/mbbsd/Makefile index c4c5c320..33db03b6 100644 --- a/mbbsd/Makefile +++ b/mbbsd/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.25 2003/05/15 08:20:05 in2 Exp $ +# $Id: Makefile,v 1.26 2003/06/22 04:32:38 in2 Exp $ .include "../pttbbs.mk" @@ -19,7 +19,8 @@ OBJS= admin.o announce.o args.o bbs.o board.o cache.o cal.o card.o\ all: $(PROG) $(PROG): $(OBJS) - $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS) $(EXT_LIBS) + sh ../util/newvers.sh + $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS) $(EXT_LIBS) vers.c ../include/var.h: var.c perl ../util/parsevar.pl < var.c > ../include/var.h diff --git a/mbbsd/cal.c b/mbbsd/cal.c index bae8ca71..1567f0c2 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -1,4 +1,4 @@ -/* $Id: cal.c,v 1.26 2003/04/28 01:19:40 in2 Exp $ */ +/* $Id: cal.c,v 1.27 2003/06/22 04:32:38 in2 Exp $ */ #include "bbs.h" /* 防堵 Multi play */ @@ -415,6 +415,7 @@ p_sysinfo(void) { char buf[128], *cpuloadstr; int load; + extern char *compile_time; load = cpuload(buf); cpuloadstr = (load < 5 ? "良好" : (load < 20 ? "尚可" : "過重")); @@ -433,7 +434,7 @@ p_sysinfo(void) #else MAX_ACTIVE, #endif - COMPILE_TIME, ctime(&start_time)); + compile_time, ctime(&start_time)); if (HAS_PERM(PERM_SYSOP)) { struct rusage ru; getrusage(RUSAGE_SELF, &ru); diff --git a/pttbbs.mk b/pttbbs.mk index a246651c..8bd1e04d 100644 --- a/pttbbs.mk +++ b/pttbbs.mk @@ -1,4 +1,4 @@ -# $Id: pttbbs.mk,v 1.1 2003/05/15 08:20:05 in2 Exp $ +# $Id: pttbbs.mk,v 1.2 2003/06/22 04:32:38 in2 Exp $ # 訂義基本初值 BBSHOME?= $(HOME) BBSHOME?= /home/bbs @@ -8,9 +8,6 @@ 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 diff --git a/util/newvers.sh b/util/newvers.sh new file mode 100644 index 00000000..eaaff3c3 --- /dev/null +++ b/util/newvers.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# $Id: newvers.sh,v 1.1 2003/06/22 04:32:38 in2 Exp $ + +t=`date` + +cat << EOF > vers.c +char compile_time[] = "${t}"; +EOF -- cgit v1.2.3