]> jfr.im git - irc/unrealircd/unrealircd.git/blob - Makefile.in
Create branch unreal33.
[irc/unrealircd/unrealircd.git] / Makefile.in
1 #/************************************************************************
2 #* IRC - Internet Relay Chat, Makefile
3 #* Copyright (C) 1990, Jarkko Oikarinen
4 #*
5 #* This program is free software; you can redistribute it and/or modify
6 #* it under the terms of the GNU General Public License as published by
7 #* the Free Software Foundation; either version 1, or (at your option)
8 #* any later version.
9 #*
10 #* This program is distributed in the hope that it will be useful,
11 #* but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #* GNU General Public License for more details.
14 #*
15 #* You should have received a copy of the GNU General Public License
16 #* along with this program; if not, write to the Free Software
17 #* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #*
19 #* $Id$
20 #*/
21
22 CC=@CC@
23 INCLUDEDIR=../include
24 NETWORKSDIR=
25 FROMDOS=/home/cmunk/bin/4dos
26
27 # [CHANGEME]
28 # Default flags:
29 # Change XCFLAGS if you don't like what Config puts there. Same with
30 # IRCDLIBS.
31 #
32 # If you are configuring by hand, try "-O -g" for XCFLAGS, and leave
33 # IRCDLIBS blank. If that fails, try recomendations below.
34 #
35
36 #XCFLAGS=-O -g -export-dynamic
37 IRCDLIBS=@IRCDLIBS@ @TRE_LIBS@ @CARES_LIBS@
38 CRYPTOLIB=@CRYPTOLIB@
39 OPENSSLINCLUDES=
40
41 XCFLAGS=@TRE_CFLAGS@ @CARES_CFLAGS@ @CFLAGS@
42 #
43 # use the following on MIPS:
44 #CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)
45 # For Irix 4.x (SGI), use the following:
46 #CFLAGS= -g -cckr -I$(INCLUDEDIR)
47 #
48 # on NEXT use:
49 #CFLAGS=-bsd -I$(INCLUDEDIR)
50 #on NeXT other than 2.0:
51 #IRCDLIBS=-lsys_s
52 #
53 # AIX 370 flags
54 #CFLAGS=-D_BSD -Hxa -I$(INCLUDEDIR)
55 #IRCDLIBS=-lbsd
56 #
57 # Dynix/ptx V2.0.x
58 #CFLAGS= -I$(INCLUDEDIR) -O -Xo
59 #IRCDLIBS= -lsocket -linet -lnsl -lseq
60 #
61 # Dynix/ptx V1.x.x
62 #IRCDLIBS= -lsocket -linet -lnsl -lseq
63 #
64 #use the following on SUN OS without nameserver libraries inside libc
65 #IRCDLIBS=-lresolv
66 #
67 # Solaris 2
68 #IRCDLIBS=-lsocket -lnsl -lresolv -L/usr/ucblib -R/usr/ucblib -lgen
69 #
70 # ESIX
71 #CFLAGS=-O -I$(INCLUDEDIR) -I/usr/ucbinclude
72 #IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl
73 #
74 # LDFLAGS - flags to send the loader (ld). SunOS users may want to add
75 # -Bstatic here.
76 #
77 #LDFLAGS=-Bstatic
78 #
79 #Dell SVR4
80 #CC=gcc
81 #CFLAGS= -I$(INCLUDEDIR) -O2
82 #IRCDLIBS=-lsocket -lnsl -lucb
83
84 # [CHANGEME]
85 # IRCDMODE is the mode you want the binary to be.
86 # The 4 at the front is important (allows for setuidness)
87 #
88 # WARNING: if you are making ircd SUID or SGID, check config.h to make sure
89 # you are not defining CMDLINE_CONFIG
90 IRCDMODE = 711
91
92 # [CHANGEME]
93 # IRCDDIR must be the same as DPATH in include/config.h
94 #
95 IRCDDIR=@IRCDDIR@
96
97
98 URL=@URL@
99
100 # [CHANGEME]
101 # If you get a link-time error dealing with strtoul, comment out
102 # this line.
103 # STRTOUL= strtoul.o
104 STRTOUL=@STRTOUL@
105
106 # [CHANGEME]
107 # If you get crashes around a specific number of clients, and that
108 # client load comes close or a little over the system-defined value of
109 # FD_SETSIZE, override it here and see what happens. You may override
110 # the system FD_SETSIZE by setting the FD_SETSIZE Makefile variable to
111 # -DFD_SETSIZE=<some number>.
112 FD_SETSIZE=@FD_SETSIZE@
113
114 # Where is your openssl binary
115 OPENSSLPATH=@OPENSSLPATH@
116
117 CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) @LDFLAGS@ $(FD_SETSIZE)
118
119 SHELL=/bin/sh
120 SUBDIRS=src
121 BINDIR=@BINDIR@
122 INSTALL=@INSTALL@
123 RM=@RM@
124 CP=@CP@
125 TOUCH=@TOUCH@
126 RES=
127 all: build
128
129 MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
130 'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}' \
131 'RES=${RES}' 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \
132 'INCLUDEDIR=${INCLUDEDIR}' 'IRCDDIR=${IRCDDIR}' \
133 'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \
134 'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' \
135 'CRYPTOLIB=${CRYPTOLIB}' \
136 'CRYPTOINCLUDES=${CRYPTOINCLUDES}' \
137 'URL=${URL}'
138
139 custommodule:
140 @if test -z "${MODULEFILE}"; then echo "Please set MODULEFILE when calling \`\`make custommodule''. For example, \`\`make custommodule MODULEFILE=callerid''." >&2; exit 1; fi
141 cd src; ${MAKE} ${MAKEARGS} MODULEFILE=${MODULEFILE} 'EXLIBS=${EXLIBS}' custommodule
142
143 server:
144 build:
145 -@if [ ! -f include/setup.h ] ; then \
146 echo "Hmm...doesn't look like you've run Config..."; \
147 echo "Doing so now."; \
148 sh Config; \
149 fi
150 @for i in $(SUBDIRS); do \
151 echo "Building $$i";\
152 ( cd $$i; ${MAKE} ${MAKEARGS} build; ) \
153 done
154 @echo ' __________________________________________________ '
155 @echo '| Compile is now complete. |'
156 @echo '| You should now read the documentation and learn |'
157 @echo '| how to configure your IRCd. |'
158 @echo '| |'
159 @echo '| If you really like UnrealIRCd, and would like to |'
160 @echo '| make a donation, please read the Donation file in|'
161 @echo '| this archive. :) |'
162 @echo '| |'
163 @echo '| Thanks for using Unreal IRCd! If you are in need |'
164 @echo '| for any kind of help regarding the IRCd please |'
165 @echo '| read the Unreal.nfo file. |'
166 @echo '|__________________________________________________|'
167
168 clean:
169 $(RM) -f *~ \#* core *.orig include/*.orig
170 @for i in $(SUBDIRS); do \
171 echo "Cleaning $$i";\
172 ( cd $$i; ${MAKE} ${MAKEARGS} clean; ) \
173 done
174 -@if [ -f include/setup.h ] ; then \
175 echo "To really restart installation, remove include/setup.h" ; \
176 fi
177
178 cleandir: clean
179 rm -rf include/networks.h include/setup.h Makefile Settings
180
181 makex:
182 chmod +x Config newnet ircd ircdcron/ircdchk killircd
183 chmod +x rehash ircdreg
184
185 fromdos: cleandir
186 $(FROMDOS) -dv *
187 $(FROMDOS) -dv src/*
188 $(FROMDOS) -dv include/*
189 $(FROMDOS) -dv doc/*
190 $(FROMDOS) -dv crypt/*
191 $(FROMDOS) -dv ircdcron/*
192 makedist: makex
193 echo "Stamping.."
194
195 stamp: makedist
196 echo "/* Auto created release stamping */" > include/stamp.h
197 echo "#define RELEASEID2 \"`date +%s`\"" >> include/stamp.h
198 echo "#define RELEASESTUFF \"`hostname`\"" >> include/stamp.h
199 echo "" >> include/stamp.h
200
201 depend:
202 @for i in $(SUBDIRS); do \
203 echo "Making dependencies in $$i";\
204 ( cd $$i; ${MAKE} ${MAKEARGS} depend; ) \
205 done
206
207 install: all
208 $(INSTALL) -m 0700 -d $(IRCDDIR)
209 $(INSTALL) -m 0700 src/ircd $(BINDIR) 2>/dev/null || { $(INSTALL) -m 0700 -d "$$(dirname '$(BINDIR)')"; $(INSTALL) -m 0700 src/ircd $(BINDIR); }
210 $(INSTALL) -m 0700 -d $(IRCDDIR)/networks
211 $(INSTALL) -m 0600 networks/*.network $(IRCDDIR)/networks
212 $(INSTALL) -m 0700 networks/makenet $(IRCDDIR)/networks
213 $(INSTALL) -m 0600 networks/networks.ndx $(IRCDDIR)/networks
214 $(INSTALL) -m 0700 -d $(IRCDDIR)/doc
215 $(INSTALL) -m 0600 doc/Authors doc/example.conf doc/coding-guidelines doc/tao.of.irc doc/unreal32docs.html $(IRCDDIR)/doc
216 $(INSTALL) -m 0700 -d $(IRCDDIR)/aliases
217 $(INSTALL) -m 0600 aliases/*.conf $(IRCDDIR)/aliases
218 $(TOUCH) $(IRCDDIR)/unrealircd.conf
219 chmod 0600 $(IRCDDIR)/unrealircd.conf
220 $(INSTALL) -m 0600 spamfilter.conf dccallow.conf $(IRCDDIR)
221 $(INSTALL) -m 0600 badwords.*.conf help.conf LICENSE Donation $(IRCDDIR)
222 $(INSTALL) -m 0700 unreal $(IRCDDIR)
223 $(INSTALL) -m 0700 -d $(IRCDDIR)/modules
224 $(INSTALL) -m 0700 src/modules/*.so $(IRCDDIR)/modules
225 $(INSTALL) -m 0700 -d $(IRCDDIR)/ircdcron
226 $(INSTALL) -m 0600 ircdcron/ircd.cron $(IRCDDIR)/ircdcron
227 $(INSTALL) -m 0700 ircdcron/ircdchk $(IRCDDIR)/ircdcron
228 -@if [ ! -f "$(IRCDDIR)/curl-ca-bundle.crt" ] ; then \
229 $(INSTALL) -m 0700 curl-ca-bundle.crt $(IRCDDIR) ; \
230 fi
231
232 pem: src/ssl.cnf
233 @echo "Generating certificate request .. "
234 $(OPENSSLPATH) req -new \
235 -config src/ssl.cnf -out server.req.pem \
236 -keyout server.key.pem -nodes
237 @echo "Generating self-signed certificate .. "
238 $(OPENSSLPATH) req -x509 -days 365 -in server.req.pem \
239 -key server.key.pem -out server.cert.pem
240 @echo "Generating fingerprint .."
241 $(OPENSSLPATH) x509 -subject -dates -fingerprint -noout \
242 -in server.cert.pem
243 @echo "Setting o-rwx & g-rwx for files... "
244 chmod o-rwx server.req.pem server.key.pem server.cert.pem
245 chmod g-rwx server.req.pem server.key.pem server.cert.pem
246 @echo "Done!. If you want to encrypt the private key, run"
247 @echo "make encpem"
248
249 encpem: server.key.pem
250 @echo "Encrypting server key .."
251 $(OPENSSLPATH) rsa -in server.key.pem -out server.key.c.pem -des3
252 -@if [ -f server.key.c.pem ] ; then \
253 echo "Replacing unencrypted with encrypted .." ; \
254 cp server.key.c.pem server.key.pem ; \
255 rm -f server.key.c.pem ; \
256 fi
257