summaryrefslogtreecommitdiffstats
path: root/mbbsd/Makefile
blob: d06ad63d967176b17bce195e6583d8ba62d3f6f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# $Id$

.include "../pttbbs.mk"

.if defined(WITH_BLOG)
CFLAGS+=  -DBLOG
LDFLAGS+= -L/usr/local/lib/mysql -lmysqlclient
.endif


PROG=   mbbsd
OBJS=   admin.o announce.o args.o assess.o bbs.o board.o cache.o cal.o card.o\
    chat.o chc.o chc_tab.o chicken.o convert.o crypt.o dark.o edit.o fav.o friend.o gamble.o\
    gomo.o guess.o indict.o io.o kaede.o lovepaper.o mail.o mbbsd.o menu.o\
    more.o name.o osdep.o othello.o page.o read.o record.o register.o\
    screen.o stuff.o talk.o term.o topsong.o user.o brc.o vice.o vote.o\
    xyz.o voteboard.o syspost.o var.o passwd.o calendar.o go.o file.o \
    pmore.o chess.o

.if defined(DIET)
OBJS+=  random.o time.o
DIETCC= diet -Os
.endif
#CFLAGS+=-g

# reduce .bss align overhead
.if !defined(DEBUG)
LDFLAGS+=-Wl,--sort-common
.endif

.if defined(MERGEBBS)
CFLAGS+= -DMERGEBBS
OBJS+= merge.o
.endif

.SUFFIXES: .c .o
.c.o:   ../include/var.h
    $(CCACHE) $(DIETCC) $(CC) $(CFLAGS) -c $*.c

all: $(PROG)

$(PROG): $(OBJS)
    sh ../util/newvers.sh
    $(DIETCC) $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS) $(EXT_LIBS) vers.c

../include/var.h:   var.c
    perl ../util/parsevar.pl < var.c > ../include/var.h

test: $(PROG)
    killall -9 testmbbsd || true
    cp mbbsd testmbbsd
    ./testmbbsd 9000
    rm -f testmbbsd

install: $(PROG)
    install -d $(BBSHOME)/bin/
    install -c -m 755 $(PROG) $(BBSHOME)/bin/
    mv -f $(BBSHOME)/bin/mbbsd $(BBSHOME)/bin/mbbsd.`date '+%m%d%H%M'`
    ln -sv $(BBSHOME)/bin/mbbsd.`date '+%m%d%H%M'` $(BBSHOME)/bin/mbbsd

clean:
    rm -f $(OBJS) $(PROG)