Thanks to the fine work of Russell Bryant and Dancho Lazarov, we now have autoconf...
[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-2006, 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 jukebox.agi
15
16 LIBS=
17 ifeq ($(OSARCH),SunOS)
18   LIBS=-lsocket -lnsl ../strcompat.o
19 endif
20
21 all: depend $(AGIS)
22
23 install: all
24         mkdir -p $(DESTDIR)$(AGI_DIR)
25         for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
26
27 uninstall:
28         for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done
29
30 eagi-test: eagi-test.o
31         $(CC) $(CFLAGS) -include ../include/autoconfig.h -o eagi-test eagi-test.o $(LIBS)
32
33 eagi-sphinx-test: eagi-sphinx-test.o
34         $(CC) $(CFLAGS) -include ../include/autoconfig.h -o eagi-sphinx-test eagi-sphinx-test.o $(LIBS) 
35
36 clean-depend:
37         rm -f .depend
38
39 clean: clean-depend
40         rm -f *.so *.o look eagi-test eagi-sphinx-test
41
42 %.so : %.o
43         $(CC) -shared -Xlinker -x -o $@ $<
44
45 ifneq ($(wildcard .depend),)
46 include .depend
47 endif
48
49 depend: .depend
50
51 .depend:
52         ../build_tools/mkdep $(CFLAGS) `ls *.c`