forked from itds-consulting/yatebts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
212 lines (176 loc) · 5.91 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
# Makefile
# This file holds the make rules the Yate BTS module and associated executables
# 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@
CCFLAGS:= -O2 @YATE_DEF@
CFLAGS := $(subst -fno-check-new,,$(CCFLAGS))
LDFLAGS:= @YATE_LNK@
YATELIBS:= @YATE_LIB@
MODSTRIP:= @YATE_STR@
RPMOPT :=
PROGS := ybts.yate gsmtrx.yate
DOCS := README COPYING
LIBS :=
OEXE :=
OTRAN :=
INCFILES :=
MKDEPS := ./config.status
CLEANS = $(PROGS) $(LIBS) $(OEXE) $(OTRAN) 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@
datarootdir = @datarootdir@
datadir:= @datadir@
docdir := @datadir@/doc/yate-bts-@PACKAGE_VERSION@
confdir:= @YATE_CFG@
moddir := @YATE_MOD@
scrdir := @YATE_SCR@
shrdir := @YATE_SHR@
# include optional local make rules
-include YateLocal.mak
.PHONY: all debug ddebug xdebug ndebug
all: $(PROGS)
$(MAKE) -C ./transceiver all
$(MAKE) -C ./mbts/apps all
$(MAKE) -C ./nib/auth all
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
@for i in mbts/*; do \
test ! -f "$$i/Makefile" || $(MAKE) -C "$$i" clean BUILD_TESTS=yes; \
done
$(MAKE) -C ./transceiver clean
$(MAKE) -C ./nib/auth clean
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-bts.spec
.PHONY: strip install uninstall
strip: all
-strip --strip-debug --discard-locals $(PROGS)
install: all
@mkdir -p "$(DESTDIR)$(moddir)/server" && \
for i in $(PROGS) ; do \
@INSTALL_D@ @INSTALL_L@ "$$i" "$(DESTDIR)$(moddir)/server/$$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
@mkdir -p "$(DESTDIR)$(docdir)/" && \
for i in $(DOCS) ; do \
install -m 0644 @srcdir@/$$i "$(DESTDIR)$(docdir)/" ; \
done
$(MAKE) -C ./mbts/apps install
$(MAKE) -C ./nib install
$(MAKE) -C ./nib/auth install
$(MAKE) -C ./roaming install
$(MAKE) -C ./scripts install
uninstall:
$(MAKE) -C ./nib/auth uninstall
$(MAKE) -C ./nib uninstall
$(MAKE) -C ./roaming uninstall
$(MAKE) -C ./scripts uninstall
$(MAKE) -C ./mbts/apps uninstall
@-for i in $(PROGS) ; do \
rm -f "$(DESTDIR)$(moddir)/server/$$i" ; \
done
@-test -d "$(DESTDIR)$(moddir)/server" && rmdir "$(DESTDIR)$(moddir)/server"
@-test -d "$(DESTDIR)$(moddir)" && rmdir "$(DESTDIR)$(moddir)"
@-if [ -d "$(DESTDIR)$(confdir)" ]; then \
rmdir "$(DESTDIR)$(confdir)" || echo "Remove conf files by hand if you want so"; \
fi
@rm -rf "$(DESTDIR)$(docdir)/"
.PHONY: snapshot tarball rpm srpm revision
snapshot tarball: check-topdir clean
@if [ $@ = snapshot ]; then ver="`date '+SVN-%Y%m%d'`"; else ver="@PACKAGE_VERSION@-@PACKAGE_STATUS@@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.h \
--exclude $$wd/config.status \
--exclude $$wd/config.log \
-X $$wd/tar-exclude \
$$wd; \
rm $$wd/tar-exclude
rpm: tarball
rpmbuild -tb $(RPMOPT) tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
srpm: tarball
rpmbuild -ta $(RPMOPT) tarballs/@PACKAGE_TARNAME@-@PACKAGE_VERSION@-@PACKAGE_STATUS@@[email protected]
revision: check-topdir
@-rev=`svn info 2>/dev/null | sed -n 's,^Revision: *,,p'`; \
test -z "$$rev" || echo "$$rev" > revision.txt
%.o: @srcdir@/%.cpp $(MKDEPS) $(INCFILES)
$(CCOMPILE) $(LOCALFLAGS) -c $<
%.o: @srcdir@/%.c $(MKDEPS) $(INCFILES)
$(COMPILE) $(LOCALFLAGS) -c $<
%.yate: @srcdir@/%.cpp $(MKDEPS) $(INCFILES)
$(MODCOMP) -o $@ $(LOCALFLAGS) $< $(LOCALLIBS) $(YATELIBS)
ybts.yate: ybts.cpp ybts.h
ybts.yate: LOCALLIBS = -lyateradio
gsmtrx.yate: ./transceiver/libtransceiver.a
gsmtrx.yate: LOCALFLAGS = -I./transceiver
gsmtrx.yate: LOCALLIBS = -L./transceiver -ltransceiver -lyateradio
@srcdir@/configure: @srcdir@/configure.ac
cd @srcdir@ && autoconf
$(MKDEPS): @srcdir@/configure
$(MKDEPS) --recheck
Makefile: $(MKDEPS) @srcdir@/Makefile.in
$(MKDEPS)
./transceiver/libtransceiver.a:
$(MAKE) -C ./transceiver
.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'\
' revision snapshot tarball rpm srpm'