forked from r4sas/unrealircd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
281 lines (258 loc) · 9.18 KB
/
Makefile.in
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
#/************************************************************************
#* IRC - Internet Relay Chat, Makefile
#* Copyright (C) 1990, Jarkko Oikarinen
#*
#* 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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#*
#* $Id$
#*/
CC=@CC@
INCLUDEDIR=@UNRLINCDIR@
NETWORKSDIR=
FROMDOS=/home/cmunk/bin/4dos
# [CHANGEME]
# Default flags:
# Change XCFLAGS if you don't like what Config puts there. Same with
# IRCDLIBS.
#
# If you are configuring by hand, try "-O -g" for XCFLAGS, and leave
# IRCDLIBS blank. If that fails, try recomendations below.
#
#XCFLAGS=-O -g -export-dynamic
IRCDLIBS=@IRCDLIBS@ @TRE_LIBS@ @PCRE2_LIBS@ @CARES_LIBS@ @PTHREAD_LIBS@
CRYPTOLIB=@CRYPTOLIB@
OPENSSLINCLUDES=
XCFLAGS=@PTHREAD_CFLAGS@ @TRE_CFLAGS@ @PCRE2_CFLAGS@ @CARES_CFLAGS@ @CFLAGS@ @HARDEN_CFLAGS@ @CPPFLAGS@
#
# use the following on MIPS:
#CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)
# For Irix 4.x (SGI), use the following:
#CFLAGS= -g -cckr -I$(INCLUDEDIR)
#
# on NEXT use:
#CFLAGS=-bsd -I$(INCLUDEDIR)
#on NeXT other than 2.0:
#IRCDLIBS=-lsys_s
#
# AIX 370 flags
#CFLAGS=-D_BSD -Hxa -I$(INCLUDEDIR)
#IRCDLIBS=-lbsd
#
# Dynix/ptx V2.0.x
#CFLAGS= -I$(INCLUDEDIR) -O -Xo
#IRCDLIBS= -lsocket -linet -lnsl -lseq
#
# Dynix/ptx V1.x.x
#IRCDLIBS= -lsocket -linet -lnsl -lseq
#
#use the following on SUN OS without nameserver libraries inside libc
#IRCDLIBS=-lresolv
#
# Solaris 2
#IRCDLIBS=-lsocket -lnsl -lresolv -L/usr/ucblib -R/usr/ucblib -lgen
#
# ESIX
#CFLAGS=-O -I$(INCLUDEDIR) -I/usr/ucbinclude
#IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl
#
# LDFLAGS - flags to send the loader (ld). SunOS users may want to add
# -Bstatic here.
#
#LDFLAGS=-Bstatic
#
#Dell SVR4
#CC=gcc
#CFLAGS= -I$(INCLUDEDIR) -O2
#IRCDLIBS=-lsocket -lnsl -lucb
# [CHANGEME]
# IRCDMODE is the mode you want the binary to be.
# The 4 at the front is important (allows for setuidness)
#
# WARNING: if you are making ircd SUID or SGID, check config.h to make sure
# you are not defining CMDLINE_CONFIG
IRCDMODE = 711
URL=@URL@
# [CHANGEME]
# If you get a link-time error dealing with strtoul, comment out
# this line.
# STRTOUL= strtoul.o
STRTOUL=@STRTOUL@
# [CHANGEME]
# If you get crashes around a specific number of clients, and that
# client load comes close or a little over the system-defined value of
# FD_SETSIZE, override it here and see what happens. You may override
# the system FD_SETSIZE by setting the FD_SETSIZE Makefile variable to
# -DFD_SETSIZE=<some number>.
FD_SETSIZE=@FD_SETSIZE@
# Where is your openssl binary
OPENSSLPATH=@OPENSSLPATH@
CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) $(FD_SETSIZE)
LDFLAGS=@LDFLAGS_PRIVATELIBS@ @HARDEN_LDFLAGS@
SHELL=/bin/sh
SUBDIRS=src
BINDIR=@BINDIR@
INSTALL=@INSTALL@
RM=@RM@
CP=@CP@
TOUCH=@TOUCH@
RES=
all: build
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}' \
'RES=${RES}' 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' \
'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \
'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' \
'CRYPTOLIB=${CRYPTOLIB}' \
'CRYPTOINCLUDES=${CRYPTOINCLUDES}' \
'URL=${URL}'
custommodule:
@if test -z "${MODULEFILE}"; then echo "Please set MODULEFILE when calling \`\`make custommodule''. For example, \`\`make custommodule MODULEFILE=callerid''." >&2; exit 1; fi
+cd src; ${MAKE} ${MAKEARGS} MODULEFILE=${MODULEFILE} 'EXLIBS=${EXLIBS}' custommodule
server: Makefile
build: Makefile
-@if [ ! -f include/setup.h ] ; then \
echo "Hmm...doesn't look like you've run Config..."; \
echo "Doing so now."; \
sh Config; \
fi
@+for i in $(SUBDIRS); do \
echo "Building $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} build; ) \
done
@echo ''
@echo '* UnrealIRCd compiled successfully'
@echo '* YOU ARE NOT DONE YET! Run "make install" to install UnrealIRCd !'
@echo ''
clean:
$(RM) -f *~ \#* core *.orig include/*.orig
@+for i in $(SUBDIRS); do \
echo "Cleaning $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} clean; ) \
done
-@if [ -f include/setup.h ] ; then \
echo "To really restart installation, remove include/setup.h" ; \
fi
cleandir: clean
rm -rf include/setup.h Makefile Settings
distclean: cleandir
rm -rf extras/*.bak extras/regexp extras/*.tar extras/c-ares
rm -rf extras/c-ares-* extras/tre-*
rm -rf config.log config.settings *.pem ircd.* unrealircd
rm -rf Makefile config.status
depend:
@+for i in $(SUBDIRS); do \
echo "Making dependencies in $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} depend; ) \
done
install: all
$(INSTALL) -m 0700 -d @BINDIR@
$(INSTALL) -m 0700 src/ircd @BINDIR@/unrealircd
$(INSTALL) -m 0700 -d @DOCDIR@
$(INSTALL) -m 0600 doc/Authors doc/coding-guidelines doc/tao.of.irc @DOCDIR@
$(INSTALL) -m 0700 -d @CONFDIR@
$(INSTALL) -m 0600 doc/conf/*.default.conf @CONFDIR@
-@if [ ! -f "@CONFDIR@/spamfilter.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/spamfilter.conf @CONFDIR@ ; \
fi
-@if [ ! -f "@CONFDIR@/badwords.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/badwords.conf @CONFDIR@ ; \
fi
-@if [ ! -f "@CONFDIR@/dccallow.conf" ] ; then \
$(INSTALL) -m 0600 doc/conf/dccallow.conf @CONFDIR@ ; \
fi
$(INSTALL) -m 0700 -d @CONFDIR@/aliases
$(INSTALL) -m 0600 doc/conf/aliases/*.conf @CONFDIR@/aliases
$(INSTALL) -m 0700 -d @CONFDIR@/help
$(INSTALL) -m 0600 doc/conf/help/*.conf @CONFDIR@/help
$(INSTALL) -m 0700 -d @CONFDIR@/examples
$(INSTALL) -m 0600 doc/conf/examples/*.conf @CONFDIR@/examples
$(INSTALL) -m 0700 -d @CONFDIR@/ssl
$(INSTALL) -m 0600 doc/conf/ssl/curl-ca-bundle.crt @CONFDIR@/ssl
$(INSTALL) -m 0700 unrealircd @SCRIPTDIR@
$(INSTALL) -m 0700 -d @MODULESDIR@
$(INSTALL) -m 0700 src/modules/*.so @MODULESDIR@
$(INSTALL) -m 0700 -d @MODULESDIR@/usermodes
$(INSTALL) -m 0700 src/modules/usermodes/*.so @MODULESDIR@/usermodes
$(INSTALL) -m 0700 -d @MODULESDIR@/chanmodes
$(INSTALL) -m 0700 src/modules/chanmodes/*.so @MODULESDIR@/chanmodes
$(INSTALL) -m 0700 -d @MODULESDIR@/snomasks
$(INSTALL) -m 0700 src/modules/snomasks/*.so @MODULESDIR@/snomasks
$(INSTALL) -m 0700 -d @MODULESDIR@/extbans
$(INSTALL) -m 0700 src/modules/extbans/*.so @MODULESDIR@/extbans
$(INSTALL) -m 0700 -d @MODULESDIR@/third
@#Ugly stuff to detect 0 files in this directory:
@+for f in src/modules/third/*.so; do \
[ -e $f ] && $(INSTALL) -m 0700 src/modules/third/*.so @MODULESDIR@/third || echo; \
done
$(INSTALL) -m 0700 -d @TMPDIR@
$(INSTALL) -m 0700 -d @CACHEDIR@
$(INSTALL) -m 0700 -d @PERMDATADIR@
$(INSTALL) -m 0700 -d @LOGDIR@
-@if [ ! -f "@CONFDIR@/ssl/server.cert.pem" ] ; then \
$(INSTALL) -m 0600 server.req.pem @CONFDIR@/ssl ; \
$(INSTALL) -m 0600 server.key.pem @CONFDIR@/ssl ; \
$(INSTALL) -m 0600 server.cert.pem @CONFDIR@/ssl ; \
fi
@echo ''
@echo '* UnrealIRCd is now installed.'
-@if [ "@SCRIPTDIR@/bin" = "@BINDIR@" ] ; then \
echo '* Leave this directory and run "cd @SCRIPTDIR@" now' ; \
fi
@echo '* Directory layout:'
-@if [ "@SCRIPTDIR@/bin" = "@BINDIR@" ] ; then \
echo ' * Base directory: @SCRIPTDIR@' ; \
fi
@echo ' * Configuration files: @CONFDIR@'
@echo ' * Log files: @LOGDIR@'
@echo ' * Modules: @MODULESDIR@'
@echo '* To start/stop UnrealIRCd run: @SCRIPTDIR@/unrealircd"'
@echo ''
@echo '* Consult the documentation online at:'
@echo ' * https://www.unrealircd.org/docs/UnrealIRCd_4_documentation'
@echo ' * https://www.unrealircd.org/docs/FAQ'
@echo '* You may also wish to install a cron job to ensure UnrealIRCd is always running:'
@echo ' * https://www.unrealircd.org/docs/Cron_job'
@echo ''
-@if [ "@SCRIPTDIR@/bin" = "@BINDIR@" ] ; then \
echo 'Again, be sure to change to the @SCRIPTDIR@ directory!' ; \
fi
### TODO: all the stuff below ;) ###
pem: src/ssl.cnf
@echo "Generating certificate request .. "
$(OPENSSLPATH) req -new \
-config src/ssl.cnf -sha256 -out server.req.pem \
-keyout server.key.pem -nodes
@echo "Generating self-signed certificate .. "
$(OPENSSLPATH) req -x509 -days 3650 -sha256 -in server.req.pem \
-key server.key.pem -out server.cert.pem
@echo "Generating fingerprint .."
$(OPENSSLPATH) x509 -subject -dates -sha256 -fingerprint -noout \
-in server.cert.pem
@echo "Setting o-rwx & g-rwx for files... "
chmod o-rwx server.req.pem server.key.pem server.cert.pem
chmod g-rwx server.req.pem server.key.pem server.cert.pem
@echo "Done!. If you want to encrypt the private key, run"
@echo "make encpem"
encpem: server.key.pem
@echo "Encrypting server key .."
$(OPENSSLPATH) rsa -in server.key.pem -out server.key.c.pem -des3
-@if [ -f server.key.c.pem ] ; then \
echo "Replacing unencrypted with encrypted .." ; \
cp server.key.c.pem server.key.pem ; \
rm -f server.key.c.pem ; \
fi
Makefile: config.status Makefile.in
./config.status