summaryrefslogtreecommitdiffstats
path: root/mbbsd/Makefile
blob: 6281e2fe8decce107bc15046ef3a07867a224c31 (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
# $Id: Makefile,v 1.3 2002/03/16 13:19:46 ptt Exp $

BBSHOME?=$(HOME)
OSTYPE=linux

# FreeBSD
CFLAGS_FreeBSD= -pipe -Wall -g -O3 -DHAVE_SETPROCTITLE -DBBSHOME='"$(BBSHOME)"' -DFreeBSD -I../include
LDFLAGS_FreeBSD=-pipe -Wall -g -O3
LIBS_FreeBSD=   -lutil -lkvm

# Linux
CFLAGS_linux=   -pipe -Wall -g -O3 -DHAVE_DES_CRYPT -DBBSHOME='"$(BBSHOME)"' -DLinux -I../include -s
LDFLAGS_linux=  -pipe -Wall -g -O3
LIBS_linux= -lcrypt

CFLAGS= $(CFLAGS_$(OSTYPE))
LDFLAGS=$(LDFLAGS_$(OSTYPE))
LIBS=   $(LIBS_$(OSTYPE))

CC= gcc
PROG=   mbbsd
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

.SUFFIXES: .c .o
.c.o:
    $(CC) $(CFLAGS) -c $*.c

all: $(PROG)

$(PROG): $(OBJS)
    $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)

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/

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