Fix to makefile (bug #4215)
[asterisk/asterisk.git] / utils / Makefile
1 #
2 # Don't use ast mm routines
3 #
4 CFLAGS+=-DNO_AST_MM
5
6 OSARCH=$(shell uname -s)
7 ifeq ($(findstring BSD,${OSARCH}),BSD)
8 CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
9 endif
10
11 TARGET=stereorize
12
13 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)
14 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)
15 ifeq (${OSARCH},SunOS)
16 SOL=../strcompat.o
17 endif
18
19 all: depend $(TARGET)
20
21 install:
22         for x in $(TARGET); do \
23                 if [ "$$x" != "none" ]; then \
24                         $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
25                 fi; \
26         done 
27
28 clean:
29         rm -f *.o astman smsq stereoize .depend
30
31 astman: astman.o ../md5.o
32         $(CC) $(CFLAGS) -o astman astman.o ../md5.o -lnewt
33
34 stereorize: stereorize.o frame.o
35         $(CC) $(CFLAGS) -o stereorize stereorize.o frame.o -lm
36
37 smsq: smsq.o
38         $(CC) $(CFLAGS) -o smsq ${SOL} smsq.o -lpopt
39
40 ifneq ($(wildcard .depend),)
41 include .depend
42 endif
43
44 depend: .depend
45
46 .depend:
47         ../mkdep $(CFLAGS) `ls *.c`
48