summaryrefslogtreecommitdiffstats
path: root/trans/Makefile
blob: 17f90bcd61bfa637a2f471b148cd73668638fa51 (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
# $Id$

SRCROOT=    ..
.include "$(SRCROOT)/pttbbs.mk"

CFLAGS+= -DPTTBBS_UTIL

BBSBASE=    $(SRCROOT)/include/var.h

UTIL_OBJS=  \
    util_cache.o    util_passwd.o   util_var.o

MBBSD_OBJS= \
    cache       record      passwd      var

# 下面這些程式, 會被 compile 並且和 $(UTIL_OBJS) 聯結
CPROG_WITH_UTIL= \
    itoc_trans \
    sob_trans \
    transman

# 下面是 C++ 的程式
CPP_WITH_UTIL= \


# 下面這些程式, 會直接被 compile
CPROG_WITHOUT_UTIL= \

# 下面這些程式會被 install
PROGS=  ${CPROG_WITH_UTIL}  ${CPROG_WITHOUT_UTIL}   ${CPP_WITH_UTIL}\

LDLIBS+=$(SRCROOT)/common/bbs/libcmbbs.a \
    $(SRCROOT)/common/sys/libcmsys.a \
    $(SRCROOT)/common/osdep/libosdep.a


all: $(SRCROOT)/include/var.h ${CPROG_WITH_UTIL} ${CPROG_WITHOUT_UTIL} ${CPP_WITH_UTIL} ${PROGS}

.for fn in ${CPROG_WITH_UTIL}
${fn}: ${BBSBASE} ${fn}.c ${UTIL_OBJS}
    ${CC} ${CFLAGS} ${LDFLAGS} -o ${fn} ${UTIL_OBJS} ${fn}.c $(LDLIBS)
.endfor

.for fn in ${CPP_WITH_UTIL}
${fn}: ${BBSBASE} ${fn}.cc ${UTIL_OBJS}
    ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${fn} ${UTIL_OBJS} ${fn}.cc $(LDLIBS)
.endfor

.for fn in ${MBBSD_OBJS}
util_${fn}.o: ${BBSBASE} $(SRCROOT)/mbbsd/${fn}.c
    ${CC} ${CFLAGS} -D_BBS_UTIL_C_ -c -o $@ $(SRCROOT)/mbbsd/${fn}.c
.endfor

install: $(PROGS)
    install -d $(BBSHOME)/bin/
    install -c -m 755 $(PROGS) $(BBSHOME)/bin/

clean:
    rm -f *.o $(CPROGS) $(CPROG_WITH_UTIL) $(CPROG_WITHOUT_UTIL) $(CPP_WITH_UTIL)