delete streamplayer with 'make clean'
[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 ifeq ($(findstring BSD,${OSARCH}),BSD)
20   CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
21 endif
22
23 TARGET=stereorize streamplayer
24
25 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
26   TARGET+=smsq
27 endif
28
29 ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
30   TARGET+=astman
31 endif
32
33 ifeq (${OSARCH},SunOS)
34   SOL=../strcompat.o
35 endif
36
37 all: depend $(TARGET)
38
39 install:
40         for x in $(TARGET); do \
41                 if [ "$$x" != "none" ]; then \
42                         $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
43                 fi; \
44         done 
45
46 clean:
47         rm -f *.o astman smsq stereorize streamplayer check_expr .depend
48         rm -f ast_expr2.o ast_expr2f.o
49
50 astman: astman.o ../md5.o
51         $(CC) $(CFLAGS) -o astman astman.o ../md5.o -lnewt
52
53 stereorize: stereorize.o frame.o
54         $(CC) $(CFLAGS) -o stereorize stereorize.o frame.o -lm
55
56 ast_expr2.o: ../ast_expr2.c
57         gcc -g -c -o $@ $<
58
59 ast_expr2f.o: ../ast_expr2f.c
60         gcc -g -c -DSTANDALONE -o $@ $<
61
62 check_expr: check_expr.c ast_expr2.o ast_expr2f.o
63         $(CC) $(CFLAGS) -o $@ $^
64
65 smsq: smsq.o
66         $(CC) $(CFLAGS) -o smsq ${SOL} smsq.o -lpopt
67
68 streamplayer: streamplayer.o
69         $(CC) $(CFLAGS) -o streamplayer ${SOL} streamplayer.o
70
71 ifneq ($(wildcard .depend),)
72   include .depend
73 endif
74
75 depend: .depend
76
77 .depend:
78         ../build_tools/mkdep $(CFLAGS) `ls *.c`
79