enhance check_expr to check for parsing errors in dialplans (bug #4556)
[asterisk/asterisk.git] / utils / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Various utilities
5 #
6 # Copyright (C) 1999-2005, Digium
7 #
8 # Mark Spencer <markster@digium.com>
9 #
10 # This program is free software, distributed under the terms of
11 # the GNU General Public License
12 #
13
14 #
15 # Don't use ast mm routines
16 #
17 CFLAGS+=-DNO_AST_MM
18
19 OSARCH=$(shell uname -s)
20 ifeq ($(findstring BSD,${OSARCH}),BSD)
21 CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
22 endif
23
24 TARGET=stereorize
25
26 TARGET+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/include/popt.h ]; then echo "smsq"; else if [ -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h ]; then echo "smsq"; fi ; fi)
27 TARGET+=$(shell if [ -f $(CROSS_COMPILE_TARGET)/usr/include/newt.h ]; then echo "astman"; else if [ -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h ]; then echo "astman"; fi ; fi)
28 ifeq (${OSARCH},SunOS)
29 SOL=../strcompat.o
30 endif
31
32 all: depend $(TARGET)
33
34 install:
35         for x in $(TARGET); do \
36                 if [ "$$x" != "none" ]; then \
37                         $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
38                 fi; \
39         done 
40
41 clean:
42         rm -f *.o astman smsq stereorize check_expr .depend
43
44 astman: astman.o ../md5.o
45         $(CC) $(CFLAGS) -o astman astman.o ../md5.o -lnewt
46
47 stereorize: stereorize.o frame.o
48         $(CC) $(CFLAGS) -o stereorize stereorize.o frame.o -lm
49
50 check_expr : check_expr.c ../ast_expr.a
51         $(CC) $(CFLAGS) -o check_expr check_expr.c ../ast_expr.a
52
53 smsq: smsq.o
54         $(CC) $(CFLAGS) -o smsq ${SOL} smsq.o -lpopt
55
56 ifneq ($(wildcard .depend),)
57 include .depend
58 endif
59
60 depend: .depend
61
62 .depend:
63         ../build_tools/mkdep $(CFLAGS) `ls *.c`
64