d9d10dcd375ebdba1a672868668356a4c1f1ab17
[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-depend:
43         rm -f .depend
44
45 clean: clean-depend
46         rm -f *.so *.o look eagi-test eagi-sphinx-test
47
48 %.so : %.o
49         $(CC) -shared -Xlinker -x -o $@ $<
50
51 ifneq ($(wildcard .depend),)
52 include .depend
53 endif
54
55 depend: .depend
56
57 .depend:
58         ../build_tools/mkdep $(CFLAGS) `ls *.c`