remove various commands that remove old modules since they have been there a
[asterisk/asterisk.git] / apps / Makefile
1 #
2 # Asterisk -- A telephony toolkit for Linux.
3
4 # Makefile for PBX applications
5 #
6 # Copyright (C) 1999-2006, Digium, Inc.
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 .PHONY: clean clean-depend all depend uninstall
15
16 ifneq ($(wildcard ../menuselect.makeopts),)
17   include ../menuselect.makeopts
18 endif
19
20 SELECTED_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
21
22 MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
23
24 app_voicemail.o: CFLAGS+=$(patsubst %,-D%,$(MENUSELECT_app_voicemail))
25
26 all: $(MODS)
27
28 clean-depend:
29         rm -f .depend
30
31 clean: clean-depend
32         rm -f *.so *.o
33
34 %.so: %.o
35         $(CC) $(SOLINK) -o $@ $<
36
37 app_rpt.so: app_rpt.o
38         $(CC) $(SOLINK) -o $@ $< $(ZAPTEL_LIB)
39
40 app_rpt.o: app_rpt.c
41         $(CC) -c -o $@ $(CFLAGS) $(ZAPTEL_INCLUDE) $<
42
43 install: all
44         for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
45
46 uninstall:
47
48 ifeq (SunOS,$(shell uname))
49 app_chanspy.so: app_chanspy.o
50         $(CC) $(SOLINK) -o $@ $< -lrt
51 endif
52
53 ifneq ($(wildcard .depend),)
54  include .depend
55 endif
56
57 depend: .depend
58
59 .depend:
60         ../build_tools/mkdep $(CFLAGS) `ls *.c`
61
62 env:
63         env