summaryrefslogtreecommitdiffstats
path: root/mbbsd.icc/Makefile
blob: 9247b7706c2c12ed722eda707fbc82f88a64a876 (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
63
64
65
66
67
68
69
70
.PATH: ../mbbsd

BBSHOME=/home/bbs
PROG=   mbbsd.icc
OBJS=   admin.o announce.o args.o bbcall.o bbs.o board.o cache.o cal.o card.o\
    chat.o chc_draw.o chc_net.o chc_play.o chc_rule.o chicken.o dark.o\
    dice.o edit.o friend.o gamble.o gomo.o gomo1.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 vice.o vote.o xyz.o\
    voteboard.o syspost.o var.o descrypt.o toolkit.o passwd.o\
    calendar.o

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 -D__FreeBSD__ -D__FreeBSD $(CFLAGS) -c ../mbbsd/$*.c

all: $(PROG)

$(PROG): $(OBJS) 
    cc $(LDFLAGS) -o $(PROG) $(OBJS) 

install: $(PROG)
    install -d $(BBSHOME)/bin/
    install -c -m 755 $(PROG) $(BBSHOME)/bin/
    rm -f $(BBSHOME)/bin/mbbsd
    ln -sv $(BBSHOME)/bin/$(PROG) $(BBSHOME)/bin/mbbsd
cache.o: cache.c
    $(GCCUSE) ../mbbsd/$*.c

mail.o: mail.c
    $(GCCUSE) ../mbbsd/$*.c

menu.o: menu.c
    $(GCCUSE) ../mbbsd/$*.c

record.o: record.c
    $(GCCUSE) ../mbbsd/$*.c

topsong.o: topsong.c
    $(GCCUSE) ../mbbsd/$*.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)