-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
120 lines (85 loc) · 3.55 KB
/
Makefile.common
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# XMail by Davide Libenzi (Intranet and Internet mail server)
# Copyright (C) 1999,..,2010 Davide Libenzi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Davide Libenzi <[email protected]>
#
ifeq ($(DEBUG_OSSL), 1)
CFLAGS := $(CFLAGS) -DDEBUG_OSSL
endif
ifeq ($(XMAIL_DEBUG), 1)
CFLAGS := $(CFLAGS) -O0 -g
STRIP = touch
else
CFLAGS := $(CFLAGS) -O2
endif
OUTDIR = bin
MKMACHDEPINC = SysMachine.h
MKMACHDEP = ${OUTDIR}/MkMachDep
MAILSVR = ${OUTDIR}/XMail
CRTLCLNT = ${OUTDIR}/CtrlClnt
XMCRYPT = ${OUTDIR}/XMCrypt
MKUSERS = ${OUTDIR}/MkUsers
SENDMAIL = ${OUTDIR}/sendmail
MKMACHDEPSRCS = MkMachDep.cpp
MKMACHDEPOBJS = $(addprefix $(OUTDIR)/, $(notdir $(patsubst %.cpp, %.o, $(MKMACHDEPSRCS))))
SVRSRCS = $(MAINSRC) $(SYSSRCS) SysDepCommon.cpp BuffSock.cpp CTRLSvr.cpp DNS.cpp DNSCache.cpp Errors.cpp \
ExtAliases.cpp FINGSvr.cpp MailConfig.cpp MailSvr.cpp Maildir.cpp MailDomains.cpp MD5.cpp \
MiscUtils.cpp LMAILSvr.cpp AliasDomain.cpp POP3GwLink.cpp POP3Svr.cpp POP3Utils.cpp PSYNCSvr.cpp \
ResLocks.cpp SList.cpp SMAILSvr.cpp TabIndex.cpp SMAILUtils.cpp SMTPSvr.cpp SMTPUtils.cpp \
ShBlocks.cpp StrUtils.cpp MessQueue.cpp QueueUtils.cpp SvrUtils.cpp UsrMailList.cpp UsrAuth.cpp \
UsrUtils.cpp Base64Enc.cpp Filter.cpp SSLBind.cpp SSLConfig.cpp Hash.cpp Array.cpp SSLMisc.cpp
SVROBJS = $(addprefix $(OUTDIR)/, $(notdir $(patsubst %.cpp, %.o, $(SVRSRCS))))
CCLNSRCS = $(SYSSRCS) SysDepCommon.cpp Base64Enc.cpp BuffSock.cpp StrUtils.cpp MD5.cpp MiscUtils.cpp \
CTRLClient.cpp Errors.cpp SSLBind.cpp SSLMisc.cpp
CCLNOBJS = $(addprefix $(OUTDIR)/, $(notdir $(patsubst %.cpp, %.o, $(CCLNSRCS))))
XMCSRCS = XMCrypt.cpp
XMCOBJS = $(addprefix $(OUTDIR)/, $(notdir $(patsubst %.cpp, %.o, $(XMCSRCS))))
MKUSRCS = MkUsers.cpp
MKUOBJS = $(addprefix $(OUTDIR)/, $(notdir $(patsubst %.cpp, %.o, $(MKUSRCS))))
SENDMAILSRC = SendMail.cpp
SENDMAILOBJS = $(addprefix $(OUTDIR)/, $(notdir $(patsubst %.cpp, %.o, $(SENDMAILSRC))))
$(OUTDIR)/%.o: %.cpp
${CC} ${CPPFLAGS} ${CFLAGS} -o $(OUTDIR)/$*.o -c $*.cpp
all: ${OUTDIR} ${MKMACHDEPINC} ${MAILSVR} ${CRTLCLNT} ${XMCRYPT} ${MKUSERS} ${SENDMAIL}
${OUTDIR}:
@mkdir ${OUTDIR}
${MKMACHDEPINC}: ${MKMACHDEP}
./${MKMACHDEP} > ${MKMACHDEPINC}
${MKMACHDEP}: ${MKMACHDEPOBJS}
${LD} -o ${MKMACHDEP} ${MKMACHDEPOBJS} ${LDFLAGS}
${STRIP} ${MKMACHDEP}
${MAILSVR}: ${SVROBJS}
${LD} -o ${MAILSVR} ${SVROBJS} ${LDFLAGS}
${STRIP} ${MAILSVR}
${CRTLCLNT}: ${CCLNOBJS}
${LD} -o ${CRTLCLNT} ${CCLNOBJS} ${LDFLAGS}
${STRIP} ${CRTLCLNT}
${XMCRYPT}: ${XMCOBJS}
${LD} -o ${XMCRYPT} ${XMCOBJS} ${LDFLAGS}
${STRIP} ${XMCRYPT}
${MKUSERS}: ${MKUOBJS}
${LD} -o ${MKUSERS} ${MKUOBJS} ${LDFLAGS}
${STRIP} ${MKUSERS}
${SENDMAIL}: ${SENDMAILOBJS}
${LD} -o ${SENDMAIL} ${SENDMAILOBJS} ${LDFLAGS}
${STRIP} ${SENDMAIL}
distclean: clean
clean:
rm -f .depend a.out core ${MAILSVR} ${CRTLCLNT} ${XMCRYPT} ${MKUSERS} ${SENDMAIL}
rm -f *.o *~ ${MKMACHDEPINC} ${MKMACHDEP}
rm -rf ${OUTDIR}