forked from wraith/wraith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
executable file
·262 lines (210 loc) · 8.35 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
#
# DO NOT EDIT THIS FILE
#
#
SHELL = @SHELL@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
@SET_MAKE@
CCDEPMODE = @CCDEPMODE@
BINEXEC = wraith@EXEEXT@
STATICMAKEFILES = lib/Makefile src/mod/Makefile src/crypto/Makefile src/compat/Makefile src/Makefile Makefile
CONFIGFILES = build/config.cache build/config.log build/config.status src/config.h src/buildinfo.h
DISTROFILES = README.md LICENSE build doc scripts lib Makefile.in build.sh configure src BSDmakefile
EXCLUDES = $(CONFIGFILES) $(STATICMAKEFILES)
COMMIT_FULL := $(shell git log -1 --pretty=format:%H HEAD)
COMMIT_SHORT := $(shell git log -1 --pretty=format:%h HEAD)
BRANCH := $(shell git branch --no-color | grep "^*" | sed -e 's/^\* //')
BUILDTS := $(shell git log -1 --pretty=format:%ct HEAD)
VERSION := $(shell git describe)
DISTRIB = wraith-$(VERSION)
HELPFILE = doc/help.txt
SETTINGSFILE = doc/settings.txt
RESPONSESFILE = doc/responses.txt
# defaults
CXX = @CXX@
LD = @CXX@
CC = @CC@
LD_DEBUG = @CXX@
STRIP = @STRIP@
DIFF = @DIFF@
#LIBS = @LIBS@ @ZLIB@
LIBS = @LIBS@
INCLUDES = @TCL_INCLUDES@ @SSL_INCLUDES@
DEBCXXFLAGS = -DDEBUG -fno-inline -g3 -ggdb3 -Wshadow -Wpointer-arith @GCC3DEB@ @GCC4DEB@ @DEBCXXFLAGS@
CFLGS = @GCC3_CFLAGS@
CXXFLAGS = @CXXFLAGS@ $(CFLGS) @GCC3_CXXFLAGS@ -fno-rtti
MAKEFLAGS = -s
STRINGFIX = src/stringfix
MAKE_STATIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX) @STATIC@' 'CC=$(CC) @STATIC@' 'LD=$(LD) @STATIC@' 'INCLUDES=$(INCLUDES)' \
'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
'STRIP=$(STRIP)' 'CXXFLAGS=$(CXXFLAGS)' 'CFLGS=$(CFLGS) -DBIN_TYPE_STATIC' 'STRINGFIX=$(STRINGFIX)' \
'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
MAKE_DYNAMIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'CC=$(CC)' 'LD=$(LD)' 'INCLUDES=$(INCLUDES)' \
'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
'STRIP=$(STRIP)' 'CXXFLAGS=$(CXXFLAGS)' 'CFLGS=$(CFLGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=$(STRINGFIX)' \
'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
MAKE_DEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'CC=$(CC)' 'LD=$(LD_DEBUG) -g' 'INCLUDES=$(INCLUDES)' \
'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
'STRIP=touch' 'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=' \
'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(debug)'
MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'CC=$(CC)' 'STRIP=touch' 'INCLUDES=$(INCLUDES)' \
'CCDEPMODE=$(CCDEPMODE)' \
'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD_DEBUG) -g'
MAKE_UTILS_NR = $(MAKE) 'CXX=$(CXX)' 'CC=$(CC)' 'STRIP=touch' 'INCLUDES=$(INCLUDES)' \
'CCDEPMODE=$(CCDEPMODE)' \
'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD) -g'
MAKE_CONFIG = $(MAKE) 'MAKE=$(MAKE)'
.PHONY: checkclean.static checkclean.dynamic checkclean.debug lib wraith dwraith lib.debug debug test general crypto utils sorthelp makehelp makeset makeres stringfix set res help sort indent tar distrib distclean clean cleanutils test all dynamic static tags
all: dynamic
test:
cleanutils:
@rm -f $(STRINGFIX) src/sorthelp@EXEEXT@ src/makehelp@EXEEXT@ src/makeres@EXEEXT@ src/makeset@EXEEXT@
clean: cleanutils
+@cd src && $(MAKE) clean
+@cd src/compat && $(MAKE) clean
+@cd src/crypto && $(MAKE) clean
+@cd src/mod && $(MAKE) clean
-+@cd lib && $(MAKE) clean
@rm -f $(BINEXEC) build/stamp.* *~ src/*~ configure.temp .mangled stamp.*
@rm -f src/help.h src/response.h src/responses.h utctime@EXEEXT@ ts@EXEEXT@
distclean: clean
@rm -rf *-$(VERSION)/ autom4te.cache/ autoscan.log configure.scan
@rm -rf src/.deps/ src/compat/.deps/ src/strucutres/.deps/ src/mod/*.mod/.deps/ src/crypto/.deps src/.defs/
-+@cd lib && $(MAKE) distclean
@rm -f $(STATICMAKEFILES) $(CONFIGFILES) config.h config.log config.status config.cache
distrib: clean
@rm -rf $(DISTRIB)/
-+@cd lib && $(MAKE) distclean
@mkdir $(DISTRIB) && cp -R $(DISTROFILES) $(DISTRIB)
@rm -rf `find $(DISTRIB)/ \( -name '*~' -o -name '*#' -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' -o -name '.gitignore' -o -name '.*.swp' \) -type f -print`
@rm -rf `find $(DISTRIB)/ \( -name '.git' -o -name '.deps' \) -type d -print`
@for s in $(EXCLUDES); do \
rm -rf $(DISTRIB)/$$s; \
done;
@sed \
-e 's/^COMMIT_FULL .*/COMMIT_FULL = $(COMMIT_FULL)/' \
-e 's/^COMMIT_SHORT .*/COMMIT_SHORT = $(COMMIT_SHORT)/' \
-e 's/^BRANCH .*/BRANCH = $(BRANCH)/' \
-e 's/^BUILDTS .*/BUILDTS = $(BUILDTS)/' \
-e 's/^VERSION .*/VERSION = $(VERSION)/' \
$(DISTRIB)/Makefile.in > Makefile.in.tmp && mv Makefile.in.tmp $(DISTRIB)/Makefile.in
@sed -e 's/GIT_REQUIRED=1/GIT_REQUIRED=0/' configure > $(DISTRIB)/configure
# @for s in `find $(DISTRIB)/src/ -name '*.h' -or -name '*.c'`; do mangle -rnw $$s > /dev/null 2>&1; done
tags:
@which cscope >/dev/null 2>&1 && cscope -Rbq || :
@which ctags >/dev/null 2>&1 && ctags -R || :
tar: distrib
tar -czvf $(DISTRIB).tar.gz $(DISTRIB)/
ls -al $(DISTRIB).tar.gz
# rm -rf $(DISTRIB)/
# cd ../ && rm -rf distrib/
indent:
@ifiles="`find src -name '*.h' -or -name '*.c'`"; \
for s in $$ifiles; \
do \
INDENT_PROFILE=private/indent.pro indent $$s; \
done
sort: sorthelp
@(if test "x`tail -n 1 $(HELPFILE)`" != "x::end"; then \
echo "::end" >> $(HELPFILE); \
fi)
# @(sed $(HELPFILE) -e "s/^$$/ /" > help~ && mv -f help~ $(HELPFILE)) || rm -f help~
@(sed -r -e :a -e 's/^$$/ /' -e '$$!N;s/^ \n:/:/;ta' -e 'P;D' $(HELPFILE) > help~ && mv -f help~ $(HELPFILE)) || rm -f help~
@cp -f $(HELPFILE) help.txt~
@(src/sorthelp@EXEEXT@ $(HELPFILE) $(HELPFILE) || (cp -f help.txt~ $(HELPFILE); echo "Sort failed, restoring backup."))
@rm -f help.txt~
help: makehelp
@src/makehelp@EXEEXT@ $(HELPFILE) src/help.h~
@(if [ ! -f src/help.h ]; then \
touch src/help.h; \
fi)
@(if test "x`$(DIFF) -qurN src/help.h~ src/help.h`" != "x"; then \
cp -f src/help.h~ src/help.h; \
fi)
set: makeset
@src/makeset@EXEEXT@ $(SETTINGSFILE) src/set_default.h~
@(if [ ! -f src/set_default.h ]; then \
touch src/set_default.h; \
fi)
@(if test "x`$(DIFF) -qurN src/set_default.h~ src/set_default.h`" != "x"; then \
cp -f src/set_default.h~ src/set_default.h; \
fi)
res: makeres
@src/makeres@EXEEXT@ $(RESPONSESFILE) src/ 1
@(if [ ! -f src/response.h ]; then \
touch src/response.h; \
fi)
@(if [ ! -f src/responses.h ]; then \
touch src/responses.h; \
fi)
@(if test "x`$(DIFF) -qurN src/response.h~ src/response.h`" != "x"; then \
cp -f src/response.h~ src/response.h; \
fi)
@(if test "x`$(DIFF) -qurN src/responses.h~ src/responses.h`" != "x"; then \
cp -f src/responses.h~ src/responses.h; \
fi)
stringfix: src/stringfix.cc src/config.h
+@cd src && ${MAKE_UTILS} stringfix
makeres: src/makeres.cc
+@cd src && ${MAKE_UTILS} makeres
makeset: src/makeset.cc
+@cd src && ${MAKE_UTILS} makeset
makehelp: src/makehelp.cc
+@cd src && ${MAKE_UTILS} makehelp
sorthelp: src/sorthelp.cc
+@cd src && ${MAKE_UTILS} sorthelp
utils: stringfix makehelp
crypto:
+@cd src/crypto && ${MAKE_UTILS} crypto
general: help res set stringfix
.NOTPARALLEL: checkclean.static checkclean.dynamic checkclean.debug
checkclean.static:
@(if test -f build/stamp.dynamic -o -f build/stamp.debug; then \
echo "[*] Cleaning up alternate build"; \
$(MAKE) MAKEFLAGS=-s clean; \
fi)
@touch build/stamp.static
checkclean.dynamic:
@(if test -f build/stamp.static -o -f build/stamp.debug; then \
echo "[*] Cleaning up alternate build"; \
$(MAKE) MAKEFLAGS=-s clean; \
fi)
@touch build/stamp.dynamic
checkclean.debug:
@(if test -f build/stamp.static -o -f build/stamp.dynamic; then \
echo "[*] Cleaning up alternate build"; \
$(MAKE) MAKEFLAGS=-s clean; \
fi)
@touch build/stamp.debug
lib:
+@cd lib && $(MAKE)
dynamic: checkclean.dynamic lib general
@echo ""
@echo "Making dynamic binary"
@echo ""
@echo ""
+@cd src/mod && $(MAKE_DYNAMIC) static
+@cd src && $(MAKE_DYNAMIC) $(BINEXEC)
@echo ""
static: checkclean.static lib general
@echo ""
@echo "Making static binary"
@echo ""
@echo ""
+@cd src/mod && $(MAKE_STATIC) static
+@cd src && $(MAKE_STATIC) $(BINEXEC)
@echo ""
dwraith: debug
lib.debug:
+@cd lib && $(MAKE) debug
debug: checkclean.debug lib.debug general
@echo ""
@echo "Making debug binary"
@echo ""
@echo ""
+@cd src/mod && $(MAKE_DEBUG) static
+@cd src && $(MAKE_DEBUG) $(BINEXEC)
@echo ""
#safety hash