-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.in
187 lines (152 loc) · 4.97 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
# Makefile
# This file holds the make rules for a Yate module
# 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 :=
AR := ar
CC := @CC@ -Wall
CXX := @CXX@ -Wall
SED := sed
DEFS :=
INCLUDES := -I@top_srcdir@ @IPP_INC@ @IPP_INC_CORE@
CCFLAGS:= -O2 @YATE_INC@
CFLAGS := $(subst -fno-check-new,,$(CCFLAGS))
LDFLAGS:= @YATE_LIB@
MODSTRIP:= @YATE_STR@
PROGS:= g723codec.yate g729codec.yate
LIBS := libg723.a libg729.a
O723 := decg723.o encg723.o owng723.o vadg723.o aux_tbls.o
O729 := decg729fp.o encg729fp.o owng729fp.o vadg729fp.o
INCFILES :=
ifeq (@IPP_7@,yes) # IPP_7
IPPLIBS := -lippsc_l -lipps_l -lippcore_l
CFLAGS := -DIPP_7 $(CFLAGS)
else # IPP_7
IPPLIBS := -lippscmerged@IPP_SUFFIX@ \
-lippsrmerged@IPP_SUFFIX@ \
-lippsmerged@IPP_SUFFIX@ \
-lippcore@IPP_SUFFIX@
ifeq (@IPP_MERGED@,yes) # IPP_MERGED
IPPLIBS := -lippscemerged@IPP_SUFFIX@ -lippsremerged@IPP_SUFFIX@ \
-lippsemerged@IPP_SUFFIX@ $(IPPLIBS)
endif # IPP_MERGED
endif # IPP_7
MKDEPS := ./config.status
CLEANS = $(PROGS) $(LIBS) $(O723) $(O729) core
COMPILE = $(CC) $(DEFS) $(DEBUG) $(INCLUDES) $(CFLAGS)
CCOMPILE = $(CXX) $(DEFS) $(DEBUG) $(INCLUDES) $(CCFLAGS)
MODCOMP = $(CCOMPILE) $(MODFLAGS) $(MODSTRIP) $(LDFLAGS)
LINK = $(CXX) $(LDFLAGS)
prefix = @prefix@
exec_prefix = @exec_prefix@
confdir:= @YATE_CFG@
moddir := @YATE_MOD@
scrdir := @YATE_SCR@
skndir := @YATE_SKN@
# include optional local make rules
-include YateLocal.mak
.PHONY: all debug ddebug xdebug ndebug
all: $(PROGS)
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:
@-$(RM) $(CLEANS) 2>/dev/null
check-topdir:
@test -f configure || (echo "Must make this target in the top source directory"; exit 1)
clean-config-files: check-topdir
-rm -rf auto*.cache
-rm -f @CONFIGURE_FILES@
distclean: check-topdir clean clean-config-files
cvsclean: distclean
-rm -f configure yate-ipp.spec
.PHONY: strip install uninstall
strip: all
-strip --strip-debug --discard-locals $(PROGS)
install: all
@mkdir -p "$(DESTDIR)$(moddir)/" && \
for i in $(PROGS) ; do \
install -D "$$i" "$(DESTDIR)$(moddir)/$$i" ; \
done
@mkdir -p "$(DESTDIR)$(confdir)/" && \
lst="`ls -1 @srcdir@/*.conf @srcdir@/*.sample @srcdir@/*.default @srcdir@/*.sql 2>/dev/null | sed 's/\.sample//g; s/\.default//g; s/[^ ]*\*\.[^ ]*//g' | sort | uniq`" ; \
for s in $$lst; do \
d="$(DESTDIR)$(confdir)/`echo $$s | sed 's,.*/,,'`" ; \
if [ -f "$$d" ]; then \
echo "Not overwriting existing $$d" ; \
else \
if [ ! -f "$$s" ]; then \
test -f "$$s.default" && s="$$s.default" ; \
test -f "$$s.sample" && s="$$s.sample" ; \
fi ; \
install -m 0644 "$$s" "$$d" ; \
fi ; \
done
uninstall:
@-for i in $(PROGS) ; do \
rm "$(DESTDIR)$(moddir)/$$i" ; \
done
@-rmdir "$(DESTDIR)$(moddir)"
@-rmdir "$(DESTDIR)$(confdir)" || echo "Remove conf files by hand if you want so"
.PHONY: snapshot tarball rpm
snapshot tarball: check-topdir clean
@if [ $@ = snapshot ]; then ver="`date '+SVN-%Y%m%d'`"; else ver="@PACKAGE_VERSION@-@PACKAGE_RELEASE@"; fi ; \
wd=`pwd|sed 's,^.*/,,'`; \
mkdir -p tarballs; cd ..; \
echo $$wd/tar-exclude >$$wd/tar-exclude; \
find $$wd -name Makefile >>$$wd/tar-exclude; \
find $$wd -name YateLocal.mak >>$$wd/tar-exclude; \
find $$wd -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; \
else \
find $$wd -name '*.spec' >>$$wd/tar-exclude; \
fi ; \
tar czf $$wd/tarballs/$$wd-$$ver.tar.gz \
--exclude $$wd/tarballs \
--exclude $$wd/config.status \
--exclude $$wd/config.log \
-X $$wd/tar-exclude \
$$wd; \
rm $$wd/tar-exclude
rpm: tarball
rpmbuild -tb tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_RELEASE@.tar.gz
%.o: @srcdir@/%.cpp $(MKDEPS) $(INCFILES)
$(CCOMPILE) -c $<
%.o: @srcdir@/%.c $(MKDEPS) $(INCFILES)
$(COMPILE) -c $<
%.yate: @srcdir@/%.cpp $(MKDEPS) $(INCFILES)
$(MODCOMP) -o $@ $(LOCALFLAGS) $< $(LOCALLIBS)
g723codec.yate: libg723.a
g723codec.yate: LOCALLIBS = -L. -lg723 @IPP_LIB@ $(IPPLIBS)
g729codec.yate: libg729.a
g729codec.yate: LOCALLIBS = -L. -lg729 @IPP_LIB@ $(IPPLIBS)
libg723.a: $(O723)
$(AR) rcs $@ $^
libg729.a: $(O729)
$(AR) rcs $@ $^
@srcdir@/configure: @srcdir@/configure.in
cd @srcdir@ && autoconf
$(MKDEPS): @srcdir@/configure
$(MKDEPS) --recheck
Makefile: $(MKDEPS) @srcdir@/Makefile.in
$(MKDEPS) --file=$@
.PHONY: help
help:
@echo -e 'Usual make targets:\n'\
' all install uninstall\n'\
' clean distclean cvsclean (avoid this one!)\n'\
' debug ddebug xdebug (carefull!)\n'\
' snapshot tarball rpm'