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
14 -include $(ASTTOPDIR)/menuselect.makeopts
16 .PHONY: clean all uninstall
18 # to get check_expr, add it to the ALL_UTILS list
19 ALL_UTILS:=astman smsq stereorize streamplayer aelparse muted check_expr conf2ael hashtest2 hashtest
22 LIBS += $(BKTR_LIB) # astobj2 with devmode uses backtrace
24 include $(ASTTOPDIR)/Makefile.rules
26 ifeq ($(OSARCH),SunOS)
28 UTILS:=$(filter-out muted,$(UTILS))
31 ifeq ($(OSARCH),OpenBSD)
32 UTILS:=$(filter-out muted,$(UTILS))
35 ifeq ($(OSARCH),cygwin)
36 UTILS:=$(filter-out muted,$(UTILS))
39 ifeq ($(OSARCH),mingw32)
43 ifneq ($(findstring darwin,$(OSARCH)),)
44 AUDIO_LIBS=-framework CoreAudio
48 UTILS:=$(filter-out smsq,$(UTILS))
52 UTILS:=$(filter-out astman,$(UTILS))
55 ifneq ($(filter pbx_ael,$(MENUSELECT_PBX)),)
56 UTILS:=$(filter-out aelparse,$(UTILS))
57 UTILS:=$(filter-out conf2ael,$(UTILS))
63 for x in $(UTILS); do \
64 if [ "$$x" != "none" ]; then \
65 $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
70 for x in $(ALL_UTILS); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done
73 rm -f *.o $(ALL_UTILS) check_expr
76 rm -f md5.c strcompat.c ast_expr2.c ast_expr2f.c pbx_ael.c pval.c hashtab.c
77 rm -f aelparse.c aelbison.c conf2ael
78 rm -f utils.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest
83 astman: astman.o md5.o
84 astman: LIBS+=$(NEWT_LIB)
86 stereorize: stereorize.o frame.o
89 hashtab.c: ../main/hashtab.c
92 strcompat.c: ../main/strcompat.c
96 @echo " [BISON] ../main/ast_expr2.y -> $@"
97 @bison -o $@ -d --name-prefix=ast_yy ../main/ast_expr2.y
100 @echo " [FLEX] ../main/ast_expr2.fl -> $@"
101 @flex -o $@ --full ../main/ast_expr2.fl
103 pval.c: ../res/ael/pval.c
106 ast_expr2.c: ../main/ast_expr2.c
109 ast_expr2f.c: ../main/ast_expr2f.c
112 ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I../main
114 pval.o : ASTCFLAGS+=-DSTANDALONE
116 check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o threadstorage.o clicompat.o
118 aelbison.c: ../res/ael/ael.tab.c
121 aelbison.o: ASTCFLAGS+=-I../res/ael -DYYENABLE_NLS=0
123 pbx_ael.c: ../pbx/pbx_ael.c
126 pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
128 aelparse.c: ../res/ael/ael_lex.c
131 aelparse.o: ASTCFLAGS+=-I../res -DSTANDALONE_AEL
133 aelparse: aelparse.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o
135 astobj2.c: ../main/astobj2.c
138 utils.c: ../main/utils.c
141 sha1.c: ../main/sha1.c
144 threadstorage.c: ../main/threadstorage.c
147 hashtest2.o: ASTCFLAGS+=-O0
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
153 hashtest.o: ASTCFLAGS+=-O0
157 conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o
159 testexpr2s: ../main/ast_expr2f.c ../main/ast_expr2.c ../main/ast_expr2.h
160 $(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2f.c -o ast_expr2f.o
161 $(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2.c -o ast_expr2.o
162 $(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o
163 rm ast_expr2.o ast_expr2f.o
164 ./testexpr2s expr2.testinput
166 smsq: smsq.o strcompat.o
167 smsq: LIBS+=$(POPT_LIB)
169 streamplayer: streamplayer.o
172 muted: LIBS+=$(AUDIO_LIBS)
174 ifneq ($(wildcard .*.d),)