summaryrefslogtreecommitdiff
path: root/funcs/Makefile
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-05-05 05:39:33 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-05-05 05:39:33 +0000
commit4d2537ae1136e6885c3b1214ebed6ccab2bdbec2 (patch)
treed1f6c678019f87fb5730998dc62af2c209dc66d6 /funcs/Makefile
parente8bd5968ff53cd8e2acc82c4f80902bc0c404d54 (diff)
major re-work of dialplan functions, including:
- locking of functions list during registration/unregistration/searching - rename of function description structure to be consistent with the rest of the API - addition of 'desc' element to description structure, for detailed description (like applications) - addition of 'show function' CLI command to show function details - conversion of existing functions to use uppercase names to match policy - creation of new 'pbx_functions.so' module to contain standard 'builtin' functions - removal of all builtin functions from pbx.c and apps and placement into new 'funcs' directory git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/Makefile')
-rwxr-xr-xfuncs/Makefile58
1 files changed, 58 insertions, 0 deletions
diff --git a/funcs/Makefile b/funcs/Makefile
new file mode 100755
index 000000000..a5228f60c
--- /dev/null
+++ b/funcs/Makefile
@@ -0,0 +1,58 @@
+#
+# Asterisk -- A telephony toolkit for Linux.
+#
+# Makefile for dialplan functions
+#
+# Copyright (C) 2005, Digium, Inc.
+#
+# Kevin P. Fleming <kpfleming@digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+FUNCS=pbx_functions.so
+
+BUILTINS=func_md5.o func_groupcount.o func_strings.o func_cdr.o func_logic.o func_env.o
+
+STANDALONE_FUNCS=$(filter-out $(BUILTINS),$(patsubst %.c,%.o,$(wildcard func*.c)))
+
+FUNCS+=$(STANDALONE_FUNCS:.o=.so)
+
+FUNC_STRUCTS=$(shell grep 'struct ast_custom_function' $(BUILTINS:.o=.c) | awk '{print $$3};')
+
+all: $(FUNCS)
+
+clean:
+ rm -f *.so *.o .depend
+
+%.so : %.o
+ $(CC) $(SOLINK) -o $@ $<
+
+$(BUILTINS) : CFLAGS += -DBUILTIN_FUNC
+
+pbx_functions.h: $(BUILTINS:.o=.c)
+ @echo "/* Automatically generated - do not edit */" > $@
+ @for f in $(FUNC_STRUCTS); do echo "extern struct ast_custom_function $$f;" >> $@; done
+ @echo "static struct ast_custom_function *builtins[] = {" >> $@
+ @for f in $(FUNC_STRUCTS); do echo "&$$f," >> $@; done
+ @echo "};" >> $@
+
+pbx_functions.so: pbx_functions.o $(BUILTINS)
+ $(CC) $(SOLINK) -o $@ $(BUILTINS) $<
+ strip $(foreach f,$(FUNC_STRUCTS),-N $(f)) $@
+
+install: all
+ for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ifneq ($(wildcard .depend),)
+include .depend
+endif
+
+depend: .depend
+
+.depend: pbx_functions.h
+ ../mkdep $(CFLAGS) `ls *.c`
+
+env:
+ env