-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
469 lines (404 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
#
# This is the Makefile for hybrid(core)
# 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 [email protected]
# 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)
hc_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 -e "\x1b[38;5;32m□\x1b[0m run: \x1b[38;5;245mmake\x1b[0m" && \
echo -e ""
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)
hc_install_msg = echo -e "" && \
echo -e "\x1b[38;5;32m□\x1b[0m run: \x1b[38;5;245mmake install\x1b[0m" && \
echo -e ""
ls_exe = echo -e "" && \
echo -e "hybrid(core) compiled:" && ls -l $(EGGEXEC) && \
echo -e ""
ls_mods = $(ls_exe) && echo -e "" && \
echo -e "modules compiled:" && ls -l *.$(MOD_EXT) && \
echo -e ""
show_test_run = echo -e "" && \
echo -e "\x1b[38;5;32m□\x1b[0m test: \x1b[38;5;245m./hybridcore -v\x1b[0m" && \
$(hc_test_run) && \
echo -e ""
# 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@
hcclean:
@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
@cd dh1080_tcl && rm -f *.o
clean: hcclean
@cd src/mod && $(MAKE) clean
distclean: hcclean 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 TEST.stamp ]; then \
echo "You're trying to do a MODULE build of hybrid(core) 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" >MOD.stamp
hybridcore: modtest
@echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mhybrid(core)\x1b[38;5;235m" && echo -e "" && \
rm -f src/mod/mod.xlibs && \
(cd src && $(MAKE) $(MAKE_MODEGG_ARGS) $(EGGEXEC)) && \
echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mmodules\x1b[38;5;235m" && echo -e "" && \
(cd src/mod && $(MAKE) $(MAKE_MODULES_ARGS) modules) && \
$(show_test_run) && $(ls_mods) && $(hc_install_msg)
debug: modtest
@echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mhybrid(core)\x1b[38;5;235m" && echo -e "" && \
rm -f src/mod/mod.xlibs && \
(cd src && $(MAKE) $(MAKE_DEBEGG_ARGS) $(EGGEXEC)) && \
echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mmodules\x1b[38;5;235m" && echo -e "" && \
(cd src/mod && $(MAKE) $(MAKE_DEBMOD_ARGS) modules) && \
$(show_test_run) && $(ls_mods) && $(hc_install_msg)
# Static builds
eggtest: conftest
@if test -f MOD.stamp; then \
echo "You're trying to do a STATIC build of hybrid(core) 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" >TEST.stamp
static: hctest
@echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mmodule objects for static linking\x1b[38;5;235m" && \
echo "" && rm -f src/mod/mod.xlibs && \
(cd src/mod && $(MAKE) $(MAKE_STATIC_ARGS) static) && \
echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mhybrid(core) for static linking\x1b[38;5;235m" && \
echo "" && \
(cd src && $(MAKE) $(MAKE_STATIC_ARGS) $(EGGEXEC)) && \
$(show_test_run) && $(ls_exe) && $(hc_install_msg)
sdebug: hctest
@echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mmodule objects for static linking\x1b[38;5;235m" && \
echo "" && rm -f src/mod/mod.xlibs && \
(cd src/mod && $(MAKE) $(MAKE_SDEBUG_ARGS) static) && \
echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m make: \x1b[38;5;245mhybrid(core) for static linking\x1b[38;5;235m" && \
echo "" && \
(cd src && $(MAKE) $(MAKE_SDEBUG_ARGS) $(EGGEXEC)) && \
$(show_test_run) && $(ls_exe) && $(hc_install_msg)
# Install
install-end = chmod -R go-rwx $(DEST) && \
echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m install complete" && \
echo -e "\x1b[38;5;32m□\x1b[0m run: \x1b[38;5;245mmake sslcert" && \
echo -e "" && \
echo -e "\x1b[0minstalled: \x1b[38;5;245m$(DEST)" && \
echo -e "\x1b[0mconfig: \x1b[38;5;245mhybrid.cf" && \
echo -e "\x1b[0m"
sslcert:
@if test ! -d $(DEST); then \
echo "You haven't installed hybrid(core) 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)/.ssl-key; then \
cp $(DEST)/.ssl-key $(DEST)/.ssl-key~old; \
fi && \
if test -f $(DEST)/.ssl-crt; then \
cp $(DEST)/.ssl-crt $(DEST)/.ssl-crt~old; \
fi && \
openssl req -new -x509 -nodes -days 365 -keyout $(DEST)/.ssl-key -out $(DEST)/.ssl-crt -config ssl.conf; \
install: ainstall
dinstall: hybridcore
@$(MAKE) ainstall
sinstall: static
@$(MAKE) ainstall
ainstall: install-bin install-modules install-data \
install-help install-language install-scripts install-dh1080
@$(install-end)
install-start:
@if test ! -f $(EGGEXEC); then \
echo ""; \
echo "You haven't compiled hybrid(core) yet."; \
echo "To compile hybrid(core), use:"; \
echo ""; \
echo " make [target]"; \
echo ""; \
echo "Valid targets: 'hybridcore', '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 "" && \
$(hc_test_run) && \
echo -e "" && echo -e "\x1b[38;5;32m□\x1b[0m install destination: \x1b[38;5;245m'$(ABSDEST)'\x1b[38;5;235m" && \
echo "" && \
if test ! -d $(DEST); then \
echo -e "\x1b[38;5;32m□\x1b[0m create: \x1b[38;5;245m'$(DEST)' directory\x1b[38;5;235m"; \
$(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 -e "\x1b[38;5;32m□\x1b[0m remove: \x1b[38;5;245msymlink to archival hybrid(core) binary\x1b[38;5;235m"; \
rm -f $(DEST)/$(EGGEXEC); \
fi && \
if test -f $(DEST)/$(EGGEXEC); then \
echo -e "\x1b[38;5;32m□\x1b[0m rename: \x1b[38;5;245mold '$(EGGEXEC)' executable to 'o$(EGGEXEC)'\x1b[38;5;235m"; \
mv -f $(DEST)/$(EGGEXEC) $(DEST)/o$(EGGEXEC); \
fi && \
echo -e "\x1b[38;5;32m□\x1b[0m copy: \x1b[38;5;245m'$(EGGEXEC)' executable\x1b[38;5;235m" && \
$(INSTALL_PROGRAM) $(EGGEXEC) $(DEST)/$(EGGEXEC) ; \
chmod 0700 $(DEST)/$(EGGEXEC)
install-modules: install-start
@if test -h $(DEST)/modules; then \
echo -e "\x1b[38;5;32m□\x1b[0m remove: \x1b[38;5;245msymlink to archival modules subdirectory\x1b[38;5;235m"; \
rm -f $(DEST)/modules; \
fi && \
if test -d $(DEST)/modules; then \
echo -e "\x1b[38;5;32m□\x1b[0m move: \x1b[38;5;245mold modules into 'modules.old' subdirectory\x1b[38;5;235m"; \
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; then \
echo -e "\x1b[38;5;32m□\x1b[0m create: \x1b[38;5;245m'modules' subdirectory\x1b[38;5;235m"; \
$(top_srcdir)/misc/mkinstalldirs $(DEST)/modules >/dev/null; \
fi; \
echo -e "\x1b[38;5;32m□\x1b[0m copy: \x1b[38;5;245mmodules\x1b[38;5;235m"; \
for i in *.$(MOD_EXT); do \
$(INSTALL_PROGRAM) $$i $(DEST)/modules/; \
done; \
fi
install-data: install-start
@if test ! -f $(DEST)/hybrid.cf; then \
$(INSTALL_DATA) $(srcdir)/hybrid.cf $(DEST)/; \
fi
install-help: install-start
@echo -e "\x1b[38;5;32m□\x1b[0m copy: \x1b[38;5;245mhelp files\x1b[38;5;235m" && \
if test ! "x`echo $(srcdir)/help/*.help`" = "x$(srcdir)/help/*.help"; then \
if test ! -d $(DEST)/help; then \
echo -e "\x1b[38;5;32m□\x1b[0m create: \x1b[38;5;245m'help' subdirectory\x1b[38;5;235m"; \
$(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 -e "\x1b[38;5;32m□\x1b[0m create: \x1b[38;5;245m'help/msg' subdirectory\x1b[38;5;235m"; \
$(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 -e "\x1b[38;5;32m□\x1b[0m create: \x1b[38;5;245m'help/set' subdirectory\x1b[38;5;235m"; \
$(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 -e "\x1b[38;5;32m□\x1b[0m copy: \x1b[38;5;245mlanguage files\x1b[38;5;235m" && \
if test ! "x`echo $(srcdir)/language/*.lang`" = "x$(srcdir)/language/*.lang"; then \
if test ! -d $(DEST)/language; then \
echo -e "\x1b[38;5;32m□\x1b[0m create: \x1b[38;5;245m'language' subdirectory\x1b[38;5;235m"; \
$(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-doc: install-start
+@$(INSTALL_DATA) $(srcdir)/README $(DEST) && \
cd doc/ && $(MAKE_INSTALL) install
install-scripts: install-start
+@cd scripts/ && $(MAKE_INSTALL) install
install-dh1080: install-start
+@echo -e "\x1b[38;5;32m□\x1b[0m compile: \x1b[38;5;245mdh1080_tcl\x1b[38;5;235m" ; \
cd dh1080_tcl/ && \
gcc -fPIC -c -static base64.c && \
gcc -fPIC -c -static DH1080.c && \
gcc -fPIC -shared DH1080.o base64.o -o DH1080.so && \
gcc -fPIC -I$(TCLLIB) -c DH1080_tcl.c && \
gcc -fPIC -shared DH1080_tcl.o DH1080.o base64.o -lssl -lcrypto -o dh1080.so && \
$(INSTALL_DATA) $(srcdir)/dh1080.so $(DEST)/modules/dh1080.so ; \
chmod 0700 $(DEST)/modules/dh1080.so
#safety hash