appending one list to another should leave the first list empty, and not require...
[asterisk-bristuff.git] / utils / Makefile
blobf41427ddf1a3534344304d16eb9338f32358b2da
2 # Asterisk -- A telephony toolkit for Linux.
3 #
4 # Various utilities
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 ../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
20 UTILS:=$(ALL_UTILS)
22 include $(ASTTOPDIR)/Makefile.rules
24 ifeq ($(OSARCH),SunOS)
25 LIBS+=-lsocket -lnsl
26 UTILS:=$(filter-out muted,$(UTILS))
27 endif
29 ifeq ($(OSARCH),OpenBSD)
30 UTILS:=$(filter-out muted,$(UTILS))
31 endif
33 ifeq ($(POPT_LIB),)
34 UTILS:=$(filter-out smsq,$(UTILS))
35 endif
37 ifeq ($(NEWT_LIB),)
38 UTILS:=$(filter-out astman,$(UTILS))
39 endif
41 ifneq ($(filter pbx_ael,$(MENUSELECT_PBX)),)
42 UTILS:=$(filter-out aelparse,$(UTILS))
43 endif
45 all: $(UTILS)
47 install:
48 for x in $(UTILS); do \
49 if [ "$$x" != "none" ]; then \
50 $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
51 fi; \
52 done
54 uninstall:
55 for x in $(ALL_UTILS); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done
57 clean:
58 rm -f *.o $(ALL_UTILS) check_expr
59 rm -f .*.o.d .*.oo.d
60 rm -f md5.c strcompat.c ast_expr2.c ast_expr2f.c pbx_ael.c
61 rm -f aelparse.c aelbison.c
63 md5.c: ../main/md5.c
64 @cp $< $@
66 astman: astman.o md5.o
67 astman: LIBS+=$(NEWT_LIB)
69 stereorize: stereorize.o frame.o
70 stereorize: LIBS+=-lm
72 strcompat.c: ../main/strcompat.c
73 @cp $< $@
75 ../main/ast_expr2.c:
76 @echo " [BISON] ../main/ast_expr2.y -> $@"
77 @bison -o $@ -d --name-prefix=ast_yy ../main/ast_expr2.y
79 ../main/ast_expr2f.c:
80 @echo " [FLEX] ../main/ast_expr2.fl -> $@"
81 @flex -o $@ --full ../main/ast_expr2.fl
83 ast_expr2.c: ../main/ast_expr2.c
84 @cp $< $@
86 ast_expr2f.c: ../main/ast_expr2f.c
87 @cp $< $@
89 ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I../main
91 check_expr: check_expr.o ast_expr2.o ast_expr2f.o
93 aelbison.c: ../pbx/ael/ael.tab.c
94 @cp $< $@
95 aelbison.o: aelbison.c ../pbx/ael/ael.tab.h ../include/asterisk/ael_structs.h
96 aelbison.o: ASTCFLAGS+=-I../pbx
98 pbx_ael.c: ../pbx/pbx_ael.c
99 @cp $< $@
100 pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
102 ael_main.o: ael_main.c ../include/asterisk/ael_structs.h
104 aelparse.c: ../pbx/ael/ael_lex.c
105 @cp $< $@
106 aelparse.o: aelparse.c ../include/asterisk/ael_structs.h ../pbx/ael/ael.tab.h
107 aelparse.o: ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL
109 aelparse: aelparse.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o
111 testexpr2s: ../main/ast_expr2f.c ../main/ast_expr2.c ../main/ast_expr2.h
112 $(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2f.c -o ast_expr2f.o
113 $(CC) -g -c -I../include -DSTANDALONE_AEL ../main/ast_expr2.c -o ast_expr2.o
114 $(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o
115 rm ast_expr2.o ast_expr2f.o
116 ./testexpr2s expr2.testinput
118 smsq: smsq.o strcompat.o
119 smsq: LIBS+=$(POPT_LIB)
121 streamplayer: streamplayer.o
123 muted: muted.o
124 muted: LIBS+=$(AUDIO_LIBS)
126 ifneq ($(wildcard .*.d),)
127 include .*.d
128 endif