From da81316536e0af773dc46e9779d384fcb23e890b Mon Sep 17 00:00:00 2001 From: in2 Date: Sun, 28 Apr 2002 19:36:04 +0000 Subject: add DEBUG flag git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@132 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd.icc/Makefile | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'mbbsd.icc/Makefile') diff --git a/mbbsd.icc/Makefile b/mbbsd.icc/Makefile index a87135cc..9247b770 100644 --- a/mbbsd.icc/Makefile +++ b/mbbsd.icc/Makefile @@ -11,13 +11,26 @@ OBJS= admin.o announce.o args.o bbcall.o bbs.o board.o cache.o cal.o card.o\ voteboard.o syspost.o var.o descrypt.o toolkit.o passwd.o\ calendar.o -CFLAGS= -O -DHAVE_SETPROCTITLE -DBBSHOME='"$(BBSHOME)"' -DFreeBSD -I../include -D__FreeBSD__ -LDFLAGS=-O -lutil -lkvm -GCCUSE=gcc -pipe -Wall -O -DHAVE_SETPROCTITLE -DBBSHOME='"/home/bbs"' -DFreeBSD -I../include -c +CFLAGS=-DHAVE_SETPROCTITLE -DBBSHOME='"$(BBSHOME)"' -DFreeBSD -I../include +LDFLAGS=-lutil -lkvm + +.if defined(DEBUG) +CFLAGS+= -g -DDEBUG +LDFLAGS+= -g -DDEBUG +.else +CFLAGS+= -O +LDFLAGS+= -O +.endif + +.if defined(NO_FORK) +CFLAGS+= -DNO_FORK +.endif + +GCCUSE=gcc -pipe -Wall $(CFLAGS) -c .SUFFIXES: .c .o .c.o: - iccbin $(CFLAGS) -c ../mbbsd/$*.c + iccbin -D__FreeBSD__ -D__FreeBSD $(CFLAGS) -c ../mbbsd/$*.c all: $(PROG) @@ -47,5 +60,11 @@ topsong.o: topsong.c xyz.o: xyz.c $(GCCUSE) ../mbbsd/$*.c +test: $(PROG) + killall -9 testmbbsd || true + cp $(PROG) testmbbsd + ./testmbbsd 9000 + rm -f testmbbsd + clean: rm -f $(OBJS) $(PROG) -- cgit v1.2.3