Debian Codegraph @

utils/Makefile

raw symbols SCIP
1 #
2 # Asterisk -- An open source telephony toolkit.
3 #
4 # Various utilities
5 #
6 # Copyright (C) 1999-2006, Digium
7 #
8 # Mark Spencer <[email protected]>
9 #
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
12 #
13
14 ASTTOPDIR?=..
15 -include $(ASTTOPDIR)/menuselect.makeopts
16
17 .PHONY: clean all uninstall
18
19 # to get check_expr, add it to the ALL_UTILS list -- this is a somewhat old checking
20 # program that wants an ael file for input, and will check each $[] expr for
21 # possible (old) problems, like spacing around operators, which dates back to
22 # the 1.2 days. The neat part is that it will actually evaluate the expressions.
23 # Users could use this to quickly check expressions in their .ael file.
24 # to get check_expr2, add it to the ALL_UTILS list -- this is a program that will
25 # read in a file containing expressions (as if they were in $[ ]), one per line.
26 # It will, of course signal any syntax errors. Devs (like murf) should use this whenever
27 # changes are made to ast_expr2.y or ast_expr2.fl (or the corresponding .c files),
28 # as a regression test. Others (mere mortals?) need not bother, but they are
29 # more than welcome to play! The regression test itself is in expr2.testinput.
30 ALL_UTILS:=$(MENUSELECT_UTILS)
31 UTILS:=$(ALL_UTILS)
32
33 LIBS += $(BKTR_LIB) # astobj2 with devmode uses backtrace
34
35 _ASTCFLAGS+=-DSTANDALONE
36
37 include $(ASTTOPDIR)/Makefile.rules
38
39 ifeq ($(OSARCH),SunOS)
40 LIBS+=-lsocket -lnsl
41 endif
42
43 ifeq ($(OSARCH),mingw32)
44 UTILS:=
45 endif
46
47 ifneq ($(findstring darwin,$(OSARCH)),)
48 AUDIO_LIBS=-framework CoreAudio
49 endif
50
51 ifeq ($(POPT_LIB),)
52 UTILS:=$(filter-out smsq,$(UTILS))
53 endif
54
55 ifeq ($(NEWT_LIB),)
56 UTILS:=$(filter-out astman,$(UTILS))
57 endif
58
59 ifneq ($(filter pbx_ael,$(MENUSELECT_PBX)),)
60 UTILS:=$(filter-out aelparse,$(UTILS))
61 endif
62
63 all: $(UTILS)
64
65 install:
66 for x in $(UTILS); do \
67 if [ "$$x" != "none" ]; then \
68 $(INSTALL) -m 755 $$x "$(DESTDIR)$(ASTSBINDIR)/$$x"; \
69 fi; \
70 done
71
72 uninstall:
73 for x in $(ALL_UTILS); do rm -f "$(DESTDIR)$(ASTSBINDIR)/$$x"; done
74
75 clean:
76 rm -f *.o $(ALL_UTILS) check_expr
77 rm -f .*.d
78 rm -f *.s *.i
79 rm -f astmm.c md5.c strcompat.c ast_expr2.c ast_expr2.h ast_expr2f.c pbx_ael.c pval.c hashtab.c lock.c
80 rm -f aelparse.c aelbison.c
81 rm -f threadstorage.c
82 rm -f utils.c strings.c poll.c version.c sha1.c astobj2.c refcounter
83 rm -f db1-ast/.*.d
84 @$(MAKE) -C db1-ast clean
85
86
87 md5.c: $(ASTTOPDIR)/main/md5.c
88 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
89 $(CMD_PREFIX) cp "$<" "$@"
90
91 astman: astman.o md5.o
92 astman: LIBS+=$(NEWT_LIB)
93
94 stereorize: stereorize.o frame.o
95 stereorize: LIBS+=-lm
96
97 astmm.c: $(ASTTOPDIR)/main/astmm.c
98 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
99 $(CMD_PREFIX) cp "$<" "$@"
100
101 hashtab.c: $(ASTTOPDIR)/main/hashtab.c
102 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
103 $(CMD_PREFIX) cp "$<" "$@"
104
105 lock.c: $(ASTTOPDIR)/main/lock.c
106 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
107 $(CMD_PREFIX) cp "$<" "$@"
108
109 strcompat.c: $(ASTTOPDIR)/main/strcompat.c
110 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
111 $(CMD_PREFIX) cp "$<" "$@"
112
113 pval.c: $(ASTTOPDIR)/res/ael/pval.c
114 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
115 $(CMD_PREFIX) cp "$<" "$@"
116
117 ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c
118 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
119 $(CMD_PREFIX) cp "$<" "$@"
120
121 ast_expr2.h: $(ASTTOPDIR)/main/ast_expr2.h
122 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
123 $(CMD_PREFIX) cp "$<" "$@"
124
125 ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c
126 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
127 $(CMD_PREFIX) cp "$<" "$@"
128 ast_expr2f.o: _ASTCFLAGS+=-I$(ASTTOPDIR)/main -Wno-unused
129
130 check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o threadstorage.o clicompat.o astmm.o
131
132 aelbison.c: $(ASTTOPDIR)/res/ael/ael.tab.c
133 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
134 $(CMD_PREFIX) cp "$<" "$@"
135 aelbison.o: _ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0
136
137 pbx_ael.c: $(ASTTOPDIR)/pbx/pbx_ael.c
138 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
139 $(CMD_PREFIX) cp "$<" "$@"
140 $(ECHO_PREFIX) echo " [SED] $@"
141 $(CMD_PREFIX) sed 's/ast_debug([[:digit:]][[:digit:]]*/ast_log(LOG_DEBUG/' "$@" > "[email protected]"
142 $(CMD_PREFIX) mv "[email protected]" "$@"
143
144 pbx_ael.o: _ASTCFLAGS+=-DAST_MODULE_SELF_SYM=__internal_pbx_ael_self
145
146 aelparse.c: $(ASTTOPDIR)/res/ael/ael_lex.c
147 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
148 $(CMD_PREFIX) cp "$<" "$@"
149 $(ECHO_PREFIX) echo " [SED] $@"
150 $(CMD_PREFIX) sed 's/ast_debug([[:digit:]][[:digit:]]*/ast_log(LOG_DEBUG/' "$@" > "[email protected]"
151 $(CMD_PREFIX) mv "[email protected]" "$@"
152
153 aelparse.o: _ASTCFLAGS+=-I$(ASTTOPDIR)/res -Wno-unused $(AST_NO_FORMAT_TRUNCATION)
154 aelparse: LIBS+=-lm $(AST_CLANG_BLOCKS_LIBS)
155 aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o lock.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o astmm.o
156
157 threadstorage.c: $(ASTTOPDIR)/main/threadstorage.c
158 $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@"
159 $(CMD_PREFIX) cp "$<" "$@"
160
161
162 extconf.o: _ASTCFLAGS+=$(call get_menuselect_cflags,DETECT_DEADLOCKS)
163 extconf.o: extconf.c
164
165 check_expr2: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h astmm.o
166 $(ECHO_PREFIX) echo " [CC] ast_expr2f.c -> ast_expr2fz.o"
167 $(CC) -g -c -I$(ASTTOPDIR)/include $(_ASTCFLAGS) -DYY_NO_INPUT $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2fz.o
168 $(ECHO_PREFIX) echo " [CC] ast_expr2.c -> ast_expr2z.o"
169 $(CC) -g -c -I$(ASTTOPDIR)/include $(_ASTCFLAGS) -DSTANDALONE2 $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2z.o
170 $(ECHO_PREFIX) echo " [LD] ast_expr2fz.o ast_expr2z.o -> check_expr2"
171 $(CC) -g -o check_expr2 ast_expr2fz.o ast_expr2z.o astmm.o -lm $(_ASTLDFLAGS)
172 $(ECHO_PREFIX) echo " [RM] ast_expr2fz.o ast_expr2z.o"
173 rm ast_expr2z.o ast_expr2fz.o
174 ifneq ($(CROSS_COMPILING),1)
175 ./check_expr2 expr2.testinput
176 endif
177
178 smsq: smsq.o strcompat.o
179 smsq: LIBS+=$(POPT_LIB)
180
181 streamplayer: streamplayer.o
182
183 CHECK_SUBDIR: # do nothing, just make sure that we recurse in the subdir/
184 db1-ast/libdb1.a: CHECK_SUBDIR
185 _ASTCFLAGS="$(_ASTCFLAGS) -Wno-strict-aliasing -Wno-old-style-definition" ASTCFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
186
187 astdb2sqlite3: LIBS+=$(SQLITE3_LIB)
188 astdb2sqlite3: _ASTCFLAGS+=$(SQLITE3_INCLUDE)
189 astdb2sqlite3: db1-ast/libdb1.a
190
191 astdb2bdb: LIBS+=$(SQLITE3_LIB)
192 astdb2bdb: _ASTCFLAGS+=$(SQLITE3_INCLUDE)
193 astdb2bdb: db1-ast/libdb1.a
194
195 conf_bridge_binaural_hrir_importer: LIBS+=$(SNDFILE_LIB)
196 conf_bridge_binaural_hrir_importer.o: _ASTCFLAGS+=$(SNDFILE_INCLUDE)
197
198 ifneq ($(wildcard .*.d),)
199 include .*.d
200 endif