2 # Asterisk -- A telephony toolkit for Linux.
6 # Copyright (C) 1999-2006, Digium
8 # Mark Spencer <markster@digium.com>
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
15 -include $(ASTTOPDIR)/menuselect.makeopts
17 .PHONY: clean all uninstall
19 ALL_UTILS:=astman smsq stereorize streamplayer muted check_expr hashtest2 hashtest astcanary refcounter
20 # aelparse and conf2ael currently not being built because they rely on extconf, which is horribly broken
21 # ALL_UTILS:=aelparse conf2ael
24 LIBS += $(BKTR_LIB) # astobj2 with devmode uses backtrace
26 include $(ASTTOPDIR)/Makefile.rules
28 ifeq ($(OSARCH),SunOS)
30 UTILS:=$(filter-out muted,$(UTILS))
33 ifeq ($(OSARCH),OpenBSD)
34 UTILS:=$(filter-out muted,$(UTILS))
37 ifeq ($(OSARCH),cygwin)
38 UTILS:=$(filter-out muted,$(UTILS))
41 ifeq ($(OSARCH),mingw32)
45 ifneq ($(findstring darwin,$(OSARCH)),)
46 AUDIO_LIBS=-framework CoreAudio
50 UTILS:=$(filter-out smsq,$(UTILS))
54 UTILS:=$(filter-out astman,$(UTILS))
57 ifneq ($(filter pbx_ael,$(MENUSELECT_PBX)),)
58 UTILS:=$(filter-out aelparse,$(UTILS))
59 UTILS:=$(filter-out conf2ael,$(UTILS))
65 for x in $(UTILS); do \
66 if [ "$$x" != "none" ]; then \
67 $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
72 for x in $(ALL_UTILS); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done
75 rm -f *.o $(ALL_UTILS) check_expr
78 rm -f md5.c strcompat.c ast_expr2.c ast_expr2f.c pbx_ael.c pval.c hashtab.c
79 rm -f aelparse.c aelbison.c conf2ael
80 rm -f utils.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest refcounter
82 md5.c: $(ASTTOPDIR)/main/md5.c
84 md5.o: ASTCFLAGS+=-DSTANDALONE
86 astman: astman.o md5.o
87 astman: LIBS+=$(NEWT_LIB)
88 astman.o: ASTCFLAGS+=-DSTANDALONE
90 stereorize: stereorize.o frame.o
93 hashtab.c: $(ASTTOPDIR)/main/hashtab.c
95 hashtab.o: ASTCFLAGS+=-DSTANDALONE
97 strcompat.c: $(ASTTOPDIR)/main/strcompat.c
99 strcompat.o: ASTCFLAGS+=-DSTANDALONE
101 pval.c: $(ASTTOPDIR)/res/ael/pval.c
103 pval.o : ASTCFLAGS+=-DSTANDALONE
105 ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c
107 ast_expr2.o: ASTCFLAGS+=-DSTANDALONE
109 ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c
111 ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE -I$(ASTTOPDIR)/main -Wno-unused
113 check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o threadstorage.o clicompat.o
114 check_expr.o: ASTCFLAGS+=-DSTANDALONE
116 aelbison.c: $(ASTTOPDIR)/res/ael/ael.tab.c
118 aelbison.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0 -DSTANDALONE
120 pbx_ael.c: $(ASTTOPDIR)/pbx/pbx_ael.c
122 pbx_ael.o: ASTCFLAGS+=-DSTANDALONE
124 aelparse.c: $(ASTTOPDIR)/res/ael/ael_lex.c
127 ael_main.o: ASTCFLAGS+=-DSTANDALONE
129 aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE -Wno-unused
130 aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o
132 astobj2.c: $(ASTTOPDIR)/main/astobj2.c
134 astobj2.o: ASTCFLAGS+=-DSTANDALONE
136 utils.c: $(ASTTOPDIR)/main/utils.c
138 utils.o: ASTCFLAGS+=-DSTANDALONE
140 sha1.c: $(ASTTOPDIR)/main/sha1.c
142 sha1.o: ASTCFLAGS+=-DSTANDALONE
144 threadstorage.c: $(ASTTOPDIR)/main/threadstorage.c
146 threadstorage.o: ASTCFLAGS+=-DSTANDALONE
148 hashtest2.o: ASTCFLAGS+=-O0 -DSTANDALONE
149 hashtest2: hashtest2.o md5.o utils.o astobj2.o sha1.o strcompat.o threadstorage.o clicompat.o
151 hashtest: hashtest.o md5.o hashtab.o utils.o sha1.o strcompat.o threadstorage.o clicompat.o
152 hashtest.o: ASTCFLAGS+=-O0 -DSTANDALONE
154 refcounter: refcounter.o md5.o hashtab.o utils.o sha1.o strcompat.o threadstorage.o clicompat.o
155 refcounter.o: ASTCFLAGS+=-O0 -DSTANDALONE
159 conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o hashtab.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o
161 testexpr2s: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h
162 $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2f.o
163 $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2.o
164 $(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o
165 rm ast_expr2.o ast_expr2f.o
166 ./testexpr2s expr2.testinput
168 smsq: smsq.o strcompat.o
169 smsq: LIBS+=$(POPT_LIB)
171 streamplayer: streamplayer.o
174 muted: LIBS+=$(AUDIO_LIBS)
176 ifneq ($(wildcard .*.d),)