-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Makefile.in
496 lines (428 loc) · 15.8 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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
#
# This is the Makefile for EGGDROP (the IRC bot)
# You should never need to edit this.
SHELL = @SHELL@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
@SET_MAKE@
prefix = @prefix@
DEST = @DEST@
# GNU Make < 3.82 ignores these != statements, they are for bsd make and gnu make >= 4.0.
# gnu make 3.82 interprets a!= b as setting the variable a!.
# it seems to interpret != otherwise and throws an error.
DEST_PARENT_DIR!= dirname $(DEST)
DEST_PARENT!= readlink -f $(DEST_PARENT_DIR)
DEST_DIR!= basename $(DEST)
ABSDEST!= echo $(DEST_PARENT)/$(DEST_DIR)
# GNU Make
ABSDEST ?= $(abspath $(DEST))
EGGEXEC = @EGGEXEC@
EGG_CROSS_COMPILING = @EGG_CROSS_COMPILING@
EGGVERSION = @EGGVERSION@
# Extra compiler flags
#
# Things you can put here:
#
# -Wall if you're using gcc and it supports it
# (configure usually detects this anyway now)
#
# -DDEBUG generic debugging code
# -DDEBUG_ASSERT to enable assert debugging
# -DDEBUG_MEM to be able to debug memory allocation (.debug)
# -DDEBUG_DNS to enable dns.mod extra debugging information
#
# Debug defines can be set with configure now.
# See ./configure --help for more information.
CFLGS = @CFLGS@ @TCL_INCLUDE_SPEC@
DEBCFLGS = @DEBCFLGS@
# ./configure SHOULD set these; however you may need to tweak them to get
# modules to compile. If you do, PLEASE let the development team know so
# we can incorporate any required changes into the next release. You can
# contact us via eggdev@eggheads.org
# Defaults
CC = @CC@
LD = @CC@
STRIP = @STRIP@
RANLIB = @RANLIB@
# make 'modegg'
MOD_CC = @MOD_CC@
MOD_LD = @MOD_LD@
MOD_STRIP = @MOD_STRIP@
# make 'modules'
SHLIB_CC = @SHLIB_CC@
SHLIB_LD = @SHLIB_LD@
SHLIB_STRIP = @SHLIB_STRIP@
MOD_EXT = @MOD_EXT@
# Programs make install uses
LN_S = @LN_S@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
# Stuff for Tcl
TCLLIB = @TCL_LIB_SPEC@
# Extra libraries
# XLIBS will be linked with everything
# MODULE_XLIBS will only be linked with the module objects
XLIBS = @SSL_LIBS@ @TCL_LIB_SPEC@ @LIBS@
MODULE_XLIBS = @MODULE_XLIBS@
# You shouldn't need to edit anything below this line.
modconf = $(top_srcdir)/misc/modconfig --top_srcdir=$(top_srcdir)
egg_test_run = if [ '$(EGG_CROSS_COMPILING)' = 'no' ]; \
then ./$(EGGEXEC) -v; \
else echo 'This build is a cross-compilation, skipping test run...'; \
fi
post_config = echo "" && \
echo "You can now compile the bot, using \"make\"." && \
echo ""
post_iconfig = $(modconf) update-depends && \
$(modconf) Makefile && \
(cd src/mod && $(MAKE_CONFIG) config) && \
$(modconf) Makefile
run_config = $(modconf) modules-still-exist && \
$(modconf) detect-modules && \
$(modconf) update-depends && \
$(modconf) Makefile && \
cd src/mod && $(MAKE_CONFIG) config && cd ../../ && \
$(modconf) Makefile && \
$(post_config)
egg_install_msg = echo "" && \
echo "Now run \"make install\" to install your bot." && \
echo ""
ls_exe = echo "" && \
echo "Eggdrop successfully compiled:" && ls -l $(EGGEXEC) && \
echo ""
ls_mods = $(ls_exe) && echo "" && \
echo "Modules successfully compiled:" && ls -l *.$(MOD_EXT) && \
echo ""
show_test_run = echo "" && \
echo "Test run of ./eggdrop -v:" && \
$(egg_test_run) && \
echo ""
# Equal for all build types
SMAKE_GENERAL_ARGS = 'MAKE=$(MAKE)' 'RANLIB=$(RANLIB)' 'XLIBS=$(XLIBS)' \
'TCLLIB=$(TCLLIB)' 'TCLINC=$(TCLINC)'
# Equal for each builds category (static, shlib, modules)
SMAKE_BUILD_STATIC_ARGS = 'CC=$(CC)' 'LD=$(LD)' 'MODOBJS=mod/*.o' \
'EGGEXEC=$(EGGEXEC)'
SMAKE_BUILD_SHLIB_ARGS = 'CC=$(MOD_CC)' 'LD=$(MOD_LD)' 'MODOBJS=' \
'EGGEXEC=$(EGGEXEC)'
SMAKE_BUILD_MODULES_ARGS = 'CC=$(SHLIB_CC)' 'LD=$(SHLIB_LD)' \
'MOD_EXT=$(MOD_EXT)' 'MODULE_XLIBS=$(MODULE_XLIBS)'
# Equal for each build type (standard, debug)
SMAKE_NO_DEBUG_ARGS = 'STRIP=$(STRIP)'
SMAKE_WITH_DEBUG_ARGS = 'STRIP=touch'
# Combined
MAKE_STATIC_ARGS = $(SMAKE_GENERAL_ARGS) $(SMAKE_BUILD_STATIC_ARGS) \
$(SMAKE_NO_DEBUG_ARGS) 'EGGBUILD=(static version)' \
'CFLGS=$(CFLGS) -DSTATIC'
MAKE_SDEBUG_ARGS = $(SMAKE_GENERAL_ARGS) $(SMAKE_BUILD_STATIC_ARGS) \
$(SMAKE_WITH_DEBUG_ARGS) 'EGGBUILD=(static debug version)' \
'CFLGS=$(CFLGS) $(DEBCFLGS) -DSTATIC'
MAKE_MODEGG_ARGS = $(SMAKE_GENERAL_ARGS) $(SMAKE_BUILD_SHLIB_ARGS) \
$(SMAKE_NO_DEBUG_ARGS) 'EGGBUILD=(standard build)' \
'CFLGS=$(CFLGS)'
MAKE_DEBEGG_ARGS = $(SMAKE_GENERAL_ARGS) $(SMAKE_BUILD_SHLIB_ARGS) \
$(SMAKE_WITH_DEBUG_ARGS) 'EGGBUILD=(debug build)' \
'CFLGS=$(CFLGS) $(DEBCFLGS)'
MAKE_MODULES_ARGS = $(SMAKE_GENERAL_ARGS) $(SMAKE_BUILD_MODULES_ARGS) \
$(SMAKE_NO_DEBUG_ARGS) 'CFLGS=$(CFLGS)'
MAKE_DEBMOD_ARGS = $(SMAKE_GENERAL_ARGS) $(SMAKE_BUILD_MODULES_ARGS) \
$(SMAKE_WITH_DEBUG_ARGS) 'CFLGS=$(CFLGS) $(DEBCFLGS)'
# Special target types
MAKE_CONFIG = $(MAKE) 'MAKE=$(MAKE)'
MAKE_INSTALL = $(MAKE) 'MAKE=$(MAKE)' 'DEST=$(ABSDEST)'
MAKE_DEPEND = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)'
all: @DEFAULT_MAKE@
eggclean:
@rm -f $(EGGEXEC) *.$(MOD_EXT) *.stamp core DEBUG *~
@cd doc && $(MAKE) clean
@cd scripts && $(MAKE) clean
@cd src && $(MAKE) clean
@cd src/md5 && $(MAKE) clean
@cd src/compat && $(MAKE) clean
clean: eggclean
@cd src/mod && $(MAKE) clean
distclean: eggclean clean-modconfig
@cd src/mod && $(MAKE) distclean
@rm -f Makefile doc/Makefile scripts/Makefile src/Makefile src/md5/Makefile src/compat/Makefile src/mod/Makefile
@rm -f config.cache config.log config.status config.h lush.h eggint.h
@rm -rf autom4te.cache
distrib:
misc/releaseprep
depend:
@cat /dev/null > lush.h
+@cd src && $(MAKE_DEPEND) depend
+@cd src/md5 && $(MAKE_DEPEND) depend
+@cd src/mod && $(MAKE_DEPEND) depend
+@cd src/compat && $(MAKE_DEPEND) depend
config:
+@$(run_config)
new-iconfig:
+@$(modconf) modules-still-exist && \
$(modconf) update-depends && \
$(modconf) -n configure && \
$(post_iconfig) && \
$(post_config)
iconfig:
+@$(modconf) modules-still-exist && \
$(modconf) detect-modules && \
$(modconf) update-depends && \
$(modconf) configure && \
$(post_iconfig) && \
$(post_config)
clean-modconfig:
@rm -f .modules .known_modules
conftest:
@if test ! -f .modules; then \
echo ""; \
echo "You have NOT configured modules yet. This has to be done before you"; \
echo "can start compiling."; \
echo ""; \
echo " Run \"make config\" or \"make iconfig\" now."; \
echo ""; \
exit 1; \
fi
reconfig: clean-modconfig
+@$(run_config)
# Modular builds
modtest: conftest
@if [ -f EGGDROP.stamp ]; then \
echo "You're trying to do a MODULE build of eggdrop when you've";\
echo "already run 'make' for a static build.";\
echo "You must first type \"make clean\" before you can build";\
echo "a module version.";\
exit 1;\
fi && \
echo "stamp" >EGGMOD.stamp
eggdrop: modtest
@echo "" && echo "Making core eggdrop files..." && echo "" && \
rm -f src/mod/mod.xlibs && \
(cd src && $(MAKE) $(MAKE_MODEGG_ARGS) $(EGGEXEC)) && \
echo "" && echo "Making modules..." && echo "" && \
(cd src/mod && $(MAKE) $(MAKE_MODULES_ARGS) modules) && \
$(show_test_run) && $(ls_mods) && $(egg_install_msg)
debug: modtest
@echo "" && echo "Making core eggdrop files..." && echo "" && \
rm -f src/mod/mod.xlibs && \
(cd src && $(MAKE) $(MAKE_DEBEGG_ARGS) $(EGGEXEC)) && \
echo "" && echo "Making modules..." && echo "" && \
(cd src/mod && $(MAKE) $(MAKE_DEBMOD_ARGS) modules) && \
$(show_test_run) && $(ls_mods) && $(egg_install_msg)
# Static builds
eggtest: conftest
@if test -f EGGMOD.stamp; then \
echo "You're trying to do a STATIC build of eggdrop when you've";\
echo "already run 'make' for a module build.";\
echo "You must first type \"make clean\" before you can build";\
echo "a static version.";\
exit 1;\
fi && \
echo "stamp" >EGGDROP.stamp
static: eggtest
@echo "" && echo "Making module objects for static linking..." && \
echo "" && rm -f src/mod/mod.xlibs && \
(cd src/mod && $(MAKE) $(MAKE_STATIC_ARGS) static) && \
echo "" && echo "Making core eggdrop for static linking..." && \
echo "" && \
(cd src && $(MAKE) $(MAKE_STATIC_ARGS) $(EGGEXEC)) && \
$(show_test_run) && $(ls_exe) && $(egg_install_msg)
sdebug: eggtest
@echo "" && echo "Making module objects for static linking..." && \
echo "" && rm -f src/mod/mod.xlibs && \
(cd src/mod && $(MAKE) $(MAKE_SDEBUG_ARGS) static) && \
echo "" && echo "Making core eggdrop for static linking..." && \
echo "" && \
(cd src && $(MAKE) $(MAKE_SDEBUG_ARGS) $(EGGEXEC)) && \
$(show_test_run) && $(ls_exe) && $(egg_install_msg)
# Install
install-end = echo "" && echo "Installation completed." && echo "" && \
echo "If you intend to use this bot as a botnet hub for other Eggdrops using SSL," && \
echo "please run \"make sslcert\" now. If you installed eggdrop to a custom path" && \
echo "during the make install process, use the same DEST= option here." && \
echo "" && \
echo "You MUST ensure that you edit/verify your configuration file." && \
echo "An example configuration file, eggdrop.conf, is distributed with Eggdrop." && \
echo "" && \
echo "Remember to change directory to $(DEST) before you proceed." && \
echo ""
sslstart:
@if test ! -d $(DEST); then \
echo "You haven't installed eggdrop yet, or you installed using the DEST= flag.";\
echo "Please run \"make install\" first.";\
echo "If you have already run \"make install\" and used the DEST= option, please use it again here";\
exit 1;\
fi && \
if test -f $(DEST)/eggdrop.key; then \
cp $(DEST)/eggdrop.key $(DEST)/eggdrop.key~old; \
fi && \
if test -f $(DEST)/eggdrop.crt; then \
cp $(DEST)/eggdrop.crt $(DEST)/eggdrop.crt~old; \
fi
sslcert: sslstart
openssl req -new -x509 -nodes -days 365 -keyout $(DEST)/eggdrop.key -out $(DEST)/eggdrop.crt -config ssl.conf
sslsilent: sslstart
openssl req -new -x509 -nodes -days 365 -keyout $(DEST)/eggdrop.key -out $(DEST)/eggdrop.crt -config ssl.conf \
-subj "/O=Eggheads/OU=Eggdrop/CN=Self-generated Eggdrop Certificate"
install: ainstall
dinstall: eggdrop
@$(MAKE) ainstall
sinstall: static
@$(MAKE) ainstall
ainstall: install-bin install-modules install-data install-text \
install-help install-language install-filesys install-doc install-scripts
@$(install-end)
install-start:
@if test ! -f $(EGGEXEC); then \
echo ""; \
echo "You haven't compiled Eggdrop yet."; \
echo "To compile Eggdrop, use:"; \
echo ""; \
echo " make [target]"; \
echo ""; \
echo "Valid targets: 'eggdrop', 'static', 'debug', 'sdebug'."; \
echo "Default target: '@DEFAULT_MAKE@'."; \
echo ""; \
exit 1; \
fi && \
if test "x$(DEST)" = "x"; then \
echo "You must specify a destination directory."; \
echo "Example:"; \
echo ""; \
echo " make install DEST=\"/home/wcc/mybot\""; \
echo ""; \
exit 1; \
fi && \
if test "$(DEST)" -ef .; then \
echo "You are trying to install into the source directory."; \
echo "That will not work. Please specify a different"; \
echo "install directory with:"; \
echo ""; \
echo "make install DEST=\"/home/wcc/mybot\""; \
echo ""; \
exit 1; \
fi && \
echo "" && \
$(egg_test_run) && \
echo "" && echo "Installing in directory: '$(ABSDEST)'." && \
echo "" && \
if test ! -d $(DEST); then \
echo "Creating directory '$(DEST)'."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST) >/dev/null; \
fi
install-bin: install-start
@if test -f $(DEST)/o$(EGGEXEC); then \
rm -f $(DEST)/o$(EGGEXEC); \
fi && \
if test -h $(DEST)/$(EGGEXEC); then \
echo "Removing symlink to archival eggdrop binary."; \
rm -f $(DEST)/$(EGGEXEC); \
fi && \
if test -f $(DEST)/$(EGGEXEC); then \
echo "Renaming old '$(EGGEXEC)' executable to 'o$(EGGEXEC)'."; \
mv -f $(DEST)/$(EGGEXEC) $(DEST)/o$(EGGEXEC); \
fi && \
echo "Copying new '$(EGGEXEC)' executable and creating symlink." && \
$(INSTALL_PROGRAM) $(EGGEXEC) $(DEST)/$(EGGEXEC)-$(EGGVERSION) && \
(cd $(DEST) && $(LN_S) $(EGGEXEC)-$(EGGVERSION) $(EGGEXEC))
install-modules: install-start
@if test -h $(DEST)/modules; then \
echo "Removing symlink to archival modules subdirectory."; \
rm -f $(DEST)/modules; \
fi && \
if test -d $(DEST)/modules; then \
echo "Moving old modules into 'modules.old' subdirectory."; \
rm -rf $(DEST)/modules.old; \
mv -f $(DEST)/modules $(DEST)/modules.old; \
fi && \
if test ! "x`echo *.$(MOD_EXT)`" = "x*.$(MOD_EXT)"; then \
if test ! -d $(DEST)/modules-$(EGGVERSION); then \
echo "Creating 'modules-$(EGGVERSION)' subdirectory and symlink."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/modules-$(EGGVERSION) >/dev/null; \
fi; \
(cd $(DEST) && $(LN_S) modules-$(EGGVERSION) modules); \
echo "Copying new modules."; \
for i in *.$(MOD_EXT); do \
$(INSTALL_PROGRAM) $$i $(DEST)/modules-$(EGGVERSION)/; \
done; \
fi
install-data: install-start
@if test ! -f $(DEST)/eggdrop.conf; then \
$(INSTALL_DATA) $(srcdir)/eggdrop.conf $(DEST)/; \
fi
@if test ! -f $(DEST)/eggdrop-basic.conf; then \
$(INSTALL_DATA) $(srcdir)/eggdrop-basic.conf $(DEST)/; \
fi
@if test ! -d $(DEST)/logs; then \
echo "Creating 'logs' subdirectory."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/logs >/dev/null; \
$(INSTALL_DATA) $(srcdir)/logs/CONTENTS $(DEST)/logs/; \
fi
install-text: install-start
@if test ! -d $(DEST)/text; then \
echo "Creating 'text' subdirectory."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/text >/dev/null; \
fi && \
if test ! -f $(DEST)/text/motd; then \
$(INSTALL_DATA) $(srcdir)/text/motd $(DEST)/text/; \
fi && \
if test ! -f $(DEST)/text/banner; then \
$(INSTALL_DATA) $(srcdir)/text/banner $(DEST)/text/; \
fi
install-help: install-start
+@echo "Copying help files." && \
if test ! "x`echo $(srcdir)/help/*.help`" = "x$(srcdir)/help/*.help"; then \
if test ! -d $(DEST)/help; then \
echo "Creating 'help' subdirectory."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/help >/dev/null; \
fi; \
for i in $(srcdir)/help/*.help; do \
$(INSTALL_DATA) $$i $(DEST)/help/; \
done; \
fi && \
if test ! "x`echo $(srcdir)/help/msg/*.help`" = "x$(srcdir)/help/msg/*.help"; then \
if test ! -d $(DEST)/help/msg; then \
echo "Creating 'help/msg' subdirectory."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/help/msg >/dev/null; \
fi; \
for i in $(srcdir)/help/msg/*.help; do \
$(INSTALL_DATA) $$i $(DEST)/help/msg/; \
done; \
fi && \
if test ! "x`echo $(srcdir)/help/set/*.help`" = "x$(srcdir)/help/set/*.help"; then \
if test ! -d $(DEST)/help/set; then \
echo "Creating 'help/set' subdirectory."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/help/set >/dev/null; \
fi; \
for i in $(srcdir)/help/set/*.help; do \
$(INSTALL_DATA) $$i $(DEST)/help/set/; \
done; \
fi && \
cd src/mod/ && $(MAKE_INSTALL) install-help
install-language: install-start
+@echo "Copying language files." && \
if test ! "x`echo $(srcdir)/language/*.lang`" = "x$(srcdir)/language/*.lang"; then \
if test ! -d $(DEST)/language; then \
echo "Creating 'language' subdirectory."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/language >/dev/null; \
fi; \
for i in $(srcdir)/language/*.lang; do \
$(INSTALL_DATA) $$i $(DEST)/language/; \
done; \
fi && \
cd src/mod && $(MAKE_INSTALL) install-language
install-filesys: install-start
@if test ! -d $(DEST)/filesys; then \
echo "Creating skeletal filesystem subdirectories."; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/filesys >/dev/null; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/filesys/incoming >/dev/null; \
fi
install-doc: install-start
+@$(INSTALL_DATA) $(srcdir)/README $(DEST) && \
$(INSTALL_DATA) $(srcdir)/FEATURES $(DEST) && \
cd doc/ && $(MAKE_INSTALL) install
install-scripts: install-start
+@cd scripts/ && $(MAKE_INSTALL) install; \
cd ../src/mod && $(MAKE_INSTALL) install-scripts
#safety hash