Merge sms stuff and move to "utils" subdir (bug #2973)
[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/usr/local/include -L/usr/local/lib
9 endif
10
11 TARGET+=$(shell if [ -f /usr/include/popt.h ]; then echo "smsq"; else if [ -f /usr/local/include/popt.h ]; then echo "smsq"; fi ; fi)
12 TARGET+=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; fi ; fi)
13
14 all: depend $(TARGET)
15
16 install:
17         if [ "$(TARGET)" != "none" ]; then \
18                 for x in $(TARGET); do \
19                         install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
20                 done ; \
21         fi
22
23 none:
24         @echo Not building the Asterisk Manager "astman"
25
26 clean:
27         rm -f *.o astman .depend
28
29 astman: astman.o ../md5.o
30         $(CC) $(CFLAGS) -o astman astman.o ../md5.o -lnewt
31
32 smsq: smsq.o
33         $(CC) $(CFLAGS) -o smsq smsq.o -lpopt
34
35 ifneq ($(wildcard .depend),)
36 include .depend
37 endif
38
39 depend: .depend
40
41 .depend:
42         ../mkdep $(CFLAGS) `ls *.c`
43