5f2a6af9be5c6b0e3a0e7728e8f30aad45156e02
[asterisk/asterisk.git] / agi / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Makefile for AGI-related stuff
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 AGIS=agi-test.agi eagi-test eagi-sphinx-test
15
16 CFLAGS+=
17
18 LIBS=
19 ifeq ($(OSARCH),SunOS)
20   LIBS=-lsocket -lnsl ../strcompat.o
21 endif
22
23 ifeq ($(findstring BSD,${OSARCH}),BSD)
24   CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
25 endif
26
27 all: depend $(AGIS)
28
29 install: all
30         mkdir -p $(DESTDIR)$(AGI_DIR)
31         for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
32
33 uninstall:
34         for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done
35
36 eagi-test: eagi-test.o
37         $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
38
39 eagi-sphinx-test: eagi-sphinx-test.o
40         $(CC) $(CFLAGS) -o eagi-sphinx-test eagi-sphinx-test.o $(LIBS) 
41
42 clean:
43         rm -f *.so *.o look .depend eagi-test eagi-sphinx-test
44
45 %.so : %.o
46         $(CC) -shared -Xlinker -x -o $@ $<
47
48 ifneq ($(wildcard .depend),)
49 include .depend
50 endif
51
52 depend: .depend
53
54 .depend:
55         ../build_tools/mkdep $(CFLAGS) `ls *.c`