-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile.in
413 lines (341 loc) · 12.3 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
# Makefile
# This file holds the make rules for the Telephony Engine
# override DESTDIR at install time to prefix the install directory
DESTDIR :=
# override DEBUG at compile time to enable full debug or remove it all
DEBUG :=
YATE_VERSION := @PACKAGE_VERSION@
YATE_RELEASE := @PACKAGE_STATUS@@PACKAGE_RELEASE@
YATE_REVISION:= @PACKAGE_REVISION@
CXX := @CXX@ -Wall
SED := sed
DEFS :=
LIBTHR:= @THREAD_LIB@
INCLUDES := -I. -I@srcdir@
CFLAGS := @CFLAGS@ @MODULE_CPPFLAGS@ @INLINE_FLAGS@
LDFLAGS:= @LDFLAGS@
LDCONFIG:=true
RPMOPT :=
MKDEPS := ./config.status
PROGS:= yate
YLIB := libyate.so.@PACKAGE_VERSION@
SLIBS:= $(YLIB) libyate.so \
libyatescript.so.@PACKAGE_VERSION@ libyatescript.so \
libyatesig.so.@PACKAGE_VERSION@ libyatesig.so \
libyateasn.so.@PACKAGE_VERSION@ libyateasn.so \
libyateradio.so.@PACKAGE_VERSION@ libyateradio.so \
libyatemgcp.so.@PACKAGE_VERSION@ libyatemgcp.so \
libyatejabber.so.@PACKAGE_VERSION@ libyatejabber.so
ILIBS:= yscript yasn yradio
INCS := yateclass.h yatemime.h yatengine.h yatephone.h yatecbase.h yatexml.h yatemath.h yatewiresniff.h
GENS := yateversn.h
LIBS :=
MAN8 := yate.8 yate-config.8
DOCS := README COPYING ChangeLog
DOCS_ILBC := LICENSE.txt
DOCS_WEBRTC := LICENSE LICENSE_THIRD_PARTY PATENTS
OBJS := main.o
CLEANS = $(PROGS) $(SLIBS) $(LIBS) $(OBJS) yatepaths.h core
COMPILE = $(CXX) $(DEFS) $(DEBUG) $(INCLUDES) $(CFLAGS)
LINK = $(CXX) $(LDFLAGS)
DOCGEN_F := $(INCS)
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
confdir = @sysconfdir@/yate
bindir = @bindir@
libdir = @libdir@
incdir = @includedir@/yate
mandir = @mandir@
docdir = @datadir@/doc/yate-@PACKAGE_VERSION@
vardir = @localstatedir@/lib/yate
moddir = @libdir@/yate
shrdir = $(datadir)/yate
# include optional local make rules
-include YateLocal.mak
DOCGEN := /bin/false
DOCGEN_K := /bin/false
DOCGEN_D := /bin/false
APIDOCS :=
APIINDEX:= @srcdir@/docs/api/index.html
ifneq (_@KDOC_BIN@,_)
DOCGEN_K := @KDOC_BIN@ -C ./docs/doc-filter.sh -d docs/api/ $(DOCGEN_F)
DOCGEN := $(DOCGEN_K)
APIDOCS := apidocs
endif
ifneq (_@DOXYGEN_BIN@,_)
DOCGEN_D := (cat docs/Doxyfile; echo 'INPUT = $(DOCGEN_F)') | @DOXYGEN_BIN@ -
DOCGEN := $(DOCGEN_D)
APIDOCS := apidocs
endif
GIT_TAG := $(shell LANG=C LC_MESSAGES=C git tag 2>/dev/null | tail -1)
GIT_HASH := $(shell LANG=C LC_MESSAGES=C git rev-list -n1 HEAD 2>tmp.txt)
GIT_ERR := $(shell LANG=C LC_MESSAGES=C cat tmp.txt 2>/dev/null; rm -f tmp.txt 2>/dev/null )
.PHONY: all everything debug ddebug xdebug ndebug
all: engine modules clients ilibs
everything: engine libs modules clients test apidocs
debug:
$(MAKE) all DEBUG=-g3 MODSTRIP=
ddebug:
$(MAKE) all DEBUG='-g3 -DDEBUG' MODSTRIP=
xdebug:
$(MAKE) all DEBUG='-g3 -DXDEBUG' MODSTRIP=
ndebug:
$(MAKE) all DEBUG='-g0 -DNDEBUG'
.PHONY: clean distclean cvsclean clean-config-files clean-packing clean-apidocs
clean:
@-$(RM) $(CLEANS) 2>/dev/null
$(MAKE) -C ./engine $@
$(MAKE) -C ./modules $@
$(MAKE) -C ./clients $@
@for i in libs/*; do \
test ! -f "$$i/Makefile" || $(MAKE) -C "$$i" clean ; \
done
check-topdir:
@test -f configure || (echo "Must make this target in the top source directory"; exit 1)
check-root:
@test `id -u` = '0' || (echo "You must run this command as root"; exit 1)
check-ldconfig:
@test "x/usr/@ARCHLIB@" = "x$(libdir)" || \
grep -l -R "^$(libdir)$$" /etc/ld.so.conf* >/dev/null 2>&1 || \
echo "Add manually $(libdir) to /etc/ld.so.conf and run ldconfig (as root)"
clean-config-files: check-topdir
-rm -rf auto*.cache
-rm -f @CONFIGURE_FILES@
clean-packing: check-topdir
-rm -f packing/rpm/yate.spec packing/portage/yate.ebuild
clean-apidocs: check-topdir
-rm docs/api/*.*
distclean: check-topdir clean clean-config-files
cvsclean: check-topdir clean clean-apidocs clean-packing clean-config-files
-rm -f configure yate-config.in
.PHONY: engine libs ilibs modules clients test apidocs-build apidocs-kdoc apidocs-doxygen apidocs-everything check-topdir check-ldconfig windows
engine: library libyate.so $(PROGS)
apidocs-kdoc: check-topdir
@if [ "x$(DOCGEN_K)" != x/bin/false ]; then \
$(DOCGEN_K) ; \
else \
echo "Executable kdoc is not installed!" ; exit 1 ; \
fi
apidocs-doxygen: check-topdir
@if [ "x$(DOCGEN_D)" != x/bin/false ]; then \
$(DOCGEN_D) ; \
else \
echo "Executable doxygen is not installed!" ; exit 1 ; \
fi
apidocs-build:
@if [ "x$(DOCGEN)" != x/bin/false ]; then \
cd @srcdir@ ; $(DOCGEN) ; \
else \
echo "Neither kdoc or doxygen is installed!" ; exit 1 ; \
fi
apidocs-everything: check-topdir
$(MAKE) apidocs-build DOCGEN_F="$(DOCGEN_F) `echo libs/y*/*.h`"
apidocs: $(APIINDEX)
$(APIINDEX): @srcdir@/docs/Doxyfile \
@srcdir@/yateclass.h @srcdir@/yatemime.h @srcdir@/yatengine.h \
@srcdir@/yatephone.h @srcdir@/yatecbase.h @srcdir@/yatemath.h
$(MAKE) apidocs-build
.PHONY: strip sex love war
strip: all
-strip --preserve-dates --strip-debug --discard-locals $(PROGS) $(SLIBS)
sex: strip
@echo 'Stripped for you!'
# Let's have a little fun
love:
@echo 'Not war?'
war:
@echo 'Please make love instead!'
modules clients test: engine
$(MAKE) -C ./$@ all
libs: engine
@for i in libs/*; do \
test ! -f "$$i/Makefile" || $(MAKE) -C "$$i" all ; \
done
ilibs: engine
@for i in $(ILIBS); do \
test ! -f "libs/$$i/Makefile" || $(MAKE) -C "libs/$$i" all ; \
done
yatepaths.h: $(MKDEPS)
@echo '#define CFG_PATH "$(confdir)"' > $@
@echo '#define MOD_PATH "$(moddir)"' >> $@
@echo '#define SHR_PATH "$(shrdir)"' >> $@
windows: check-topdir
@cmp -s yateversn.h $@/yateversn.h || cp -p yateversn.h $@/yateversn.h
@cmp -s yateiss.inc $@/yateiss.inc || cp -p yateiss.inc $@/yateiss.inc
.PHONY: install install-root install-noconf install-noapi install-api uninstall uninstall-root
install install-root: all $(APIDOCS) install-noapi install-api check-ldconfig
install-noapi: install-noconf
$(MAKE) -C ./conf.d install
install-noconf: all
@mkdir -p "$(DESTDIR)$(libdir)/" && \
for i in $(SLIBS) ; do \
if [ -h "$$i" ]; then \
f=`readlink "$$i"` ; \
ln -sf "$$f" "$(DESTDIR)$(libdir)/$$i" ; \
else \
install @INSTALL_L@ $$i "$(DESTDIR)$(libdir)/" ; \
fi \
done
@mkdir -p "$(DESTDIR)$(bindir)/" && \
install $(PROGS) yate-config "$(DESTDIR)$(bindir)/"
$(MAKE) -C ./modules install
$(MAKE) -C ./clients install
$(MAKE) -C ./share install
@$(LDCONFIG)
@mkdir -p "$(DESTDIR)$(mandir)/man8/" && \
for i in $(MAN8) ; do \
install -m 0644 @srcdir@/docs/man/$$i "$(DESTDIR)$(mandir)/man8/" ; \
done
@mkdir -p "$(DESTDIR)$(libdir)/pkgconfig/" && \
install -m 0644 yate.pc "$(DESTDIR)$(libdir)/pkgconfig/"
@mkdir -p "$(DESTDIR)$(incdir)/" && \
for i in $(INCS) ; do \
install -m 0644 @srcdir@/$$i "$(DESTDIR)$(incdir)/" ; \
done
@for i in $(GENS) ; do \
install -m 0644 $$i "$(DESTDIR)$(incdir)/" ; \
done
@for i in $(ILIBS) ; do \
for f in @srcdir@/libs/$$i/*.h ; do \
install -m 0644 $$f "$(DESTDIR)$(incdir)/" ; \
done ; \
done
@mkdir -p "$(DESTDIR)$(docdir)/api/" && \
for i in $(DOCS) ; do \
install -m 0644 @srcdir@/$$i "$(DESTDIR)$(docdir)/" ; \
done; \
for i in $(DOCS_ILBC) ; do \
install -m 0644 @srcdir@/libs/ilbc/$$i "$(DESTDIR)$(docdir)/iLBC-$$i" ; \
done; \
for i in $(DOCS_WEBRTC) ; do \
install -m 0644 @srcdir@/libs/miniwebrtc/$$i "$(DESTDIR)$(docdir)/WebRTC-$$i" ; \
done
install-api: $(APIDOCS)
@mkdir -p "$(DESTDIR)$(docdir)/api/" && \
install -m 0644 @srcdir@/docs/*.html "$(DESTDIR)$(docdir)/" && \
test -f "$(APIINDEX)" && \
install -m 0644 @srcdir@/docs/api/*.* "$(DESTDIR)$(docdir)/api/"
uninstall uninstall-root:
@-for i in $(SLIBS) ; do \
rm "$(DESTDIR)$(libdir)/$$i" ; \
done; \
$(MAKE) -C ./clients uninstall
@$(LDCONFIG)
@-for i in $(PROGS) yate-config ; do \
rm "$(DESTDIR)$(bindir)/$$i" ; \
done
@-rm "$(DESTDIR)$(libdir)/pkgconfig/yate.pc" && \
rmdir $(DESTDIR)$(libdir)/pkgconfig
@-for i in $(INCS) $(GENS) ; do \
rm "$(DESTDIR)$(incdir)/$$i" ; \
done; \
for i in $(ILIBS) ; do \
for f in @srcdir@/libs/$$i/*.h ; do \
rm "$(DESTDIR)$(incdir)/"`basename $$f` ; \
done ; \
done ; \
rmdir "$(DESTDIR)$(incdir)"
@-for i in $(MAN8) ; do \
rm "$(DESTDIR)$(mandir)/man8/$$i" ; \
done
@rm -rf "$(DESTDIR)$(docdir)/"
$(MAKE) -C ./modules uninstall
$(MAKE) -C ./share uninstall
$(MAKE) -C ./conf.d uninstall
install-root uninstall-root: LDCONFIG:=ldconfig
.PHONY: snapshot tarball rpm srpm rpm-tag srpm-tag rpm-head srpm-head revision check-gittag check-githash
snapshot tarball: check-topdir revision clean windows apidocs
@if [ $@ = snapshot ]; then ver="`date '+GIT-%Y%m%d'`"; else ver="@PACKAGE_VERSION@-@PACKAGE_STATUS@@PACKAGE_RELEASE@"; fi ; \
wd=`pwd|sed 's,^.*/,,'`; \
mkdir -p packing/tarballs; cd ..; \
echo $$wd/tar-exclude >$$wd/tar-exclude; \
find $$wd -name Makefile >>$$wd/tar-exclude; \
find $$wd -name 'YateLocal*' >>$$wd/tar-exclude; \
find $$wd/conf.d -name '*.conf' >>$$wd/tar-exclude; \
find $$wd -name '*.cache' >>$$wd/tar-exclude; \
find $$wd -name '*~' >>$$wd/tar-exclude; \
find $$wd -name '.*.swp' >>$$wd/tar-exclude; \
if [ $@ = tarball ]; then \
find $$wd -name .svn >>$$wd/tar-exclude; \
find $$wd -name CVS >>$$wd/tar-exclude; \
find $$wd -name .cvsignore >>$$wd/tar-exclude; \
find $$wd -name .gitignore >>$$wd/tar-exclude; \
find $$wd -name .git >>$$wd/tar-exclude; \
else \
echo "$$wd/packing/rpm/yate.spec" >>$$wd/tar-exclude; \
fi ; \
tar czf $$wd/packing/tarballs/@PACKAGE_TARNAME@-$$ver.tar.gz \
--exclude $$wd/packing/tarballs \
--exclude $$wd/config.status \
--exclude $$wd/config.log \
--exclude $$wd/run \
--exclude $$wd/yate-config \
--exclude $$wd/yate.pc \
--exclude $$wd/yatepaths.h \
--exclude $$wd/yateversn.h \
-X $$wd/tar-exclude \
$$wd; \
rm $$wd/tar-exclude
# rpm and sprm will check that head is at the last tag
rpm: check-gittag tarball
rpmbuild -tb $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
srpm: check-gittag tarball
rpmbuild -ta $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
#build rpm/srpm with tag in revision number
rpm-tag: check-gittag tarball
rpmbuild -tb --define 'revision $(GIT_TAG)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
srpm-tag: check-gittag tarball
rpmbuild -ta --define 'revision $(GIT_TAG)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
# build packages from GIT HEAD
rpm-head: check-githash tarball
rpmbuild -tb --define 'revision $(GIT_HASH)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
srpm-head: check-githash tarball
rpmbuild -ta --define 'revision $(GIT_HASH)git' $(RPMOPT) packing/tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
check-gittag revision: check-topdir check-githash
@tag_hash=""; \
if [ "" != "$(GIT_TAG)" ]; then \
tag_hash=`LANG=C LC_MESSAGES=C git rev-list -n1 $(GIT_TAG) 2>/dev/null`; \
elif [ $@ = check-gittag ]; then \
echo "No available GIT tag"; \
exit 1; \
fi; \
if [ "x$(GIT_HASH)" != "x$$tag_hash" ]; then \
if [ $@ = check-gittag ]; then \
echo "Current commit hash $(GIT_HASH) different from expected hash for tag $(GIT_TAG) ($$tag_hash)"; \
exit 1; \
fi; \
tag=""; \
fi; \
test -z "$(GIT_TAG)" || echo "$(GIT_TAG)" > packing/revision.txt ; \
test -z "$(GIT_HASH)" || echo "$(GIT_HASH)" > packing/git_commit.txt
check-githash:
@if [ "x" = "x$(GIT_HASH)" ]; then \
echo "Could not obtain last GIT commit hash. GIT Error:"; \
echo "$(GIT_ERR)"; \
exit 1; \
fi;
%.o: @srcdir@/%.cpp $(MKDEPS) @srcdir@/yatengine.h
$(COMPILE) -c $<
@srcdir@/configure: @srcdir@/configure.ac
cd @srcdir@ && ./autogen.sh --silent
config.status: @srcdir@/configure
./config.status --recheck
Makefile: @srcdir@/Makefile.in $(MKDEPS)
./config.status
yate: $(OBJS) $(LIBS) libyate.so
$(LINK) -o $@ $(LIBTHR) $^ @LIBS@
libyate.so: $(YLIB)
ln -sf $^ $@
.PHONY: library
library $(YLIB): yatepaths.h
$(MAKE) -C ./engine all
.PHONY: help
help:
@echo -e 'Usual make targets:\n'\
' all engine libs modules clients apidocs test everything\n'\
' install uninstall install-noapi install-root uninstall-root\n'\
' clean distclean cvsclean (avoid this one!) clean-apidocs\n'\
' debug ddebug xdebug (carefull!)\n'\
' snapshot tarball rpm srpm'