aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/Makefile')
-rwxr-xr-xfuncs/Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/funcs/Makefile b/funcs/Makefile
index e99cde005..7ec63b407 100755
--- a/funcs/Makefile
+++ b/funcs/Makefile
@@ -29,11 +29,11 @@ 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};')
+FUNC_SOURCES=$(BUILTINS:.o=.c)
-CFLAGS+=-fPIC
+FUNC_STRUCTS=$(shell grep 'struct ast_custom_function' $(FUNC_SOURCES) | awk '{print $$3};')
-FUNC_SOURCES=$(BUILTINS:.o=.c)
+CFLAGS+=-fPIC
ifeq ($(findstring BSD,${OSARCH}),BSD)
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
@@ -49,13 +49,15 @@ clean:
#$(BUILTINS) : CFLAGS += -DBUILTIN_FUNC
-pbx_functions.h: $(BUILTINS:.o=.c)
+pbx_functions.h: $(FUNC_SOURCES)
@echo "/* Automatically generated - do not edit */" > $@
@for f in $(FUNC_SOURCES); do echo "#include \"$$f\"" >> $@; done
@echo "static struct ast_custom_function *builtins[] = {" >> $@
@for f in $(FUNC_STRUCTS); do echo "&$$f," >> $@; done
@echo "};" >> $@
+pbx_functions.o: pbx_functions.h
+
pbx_functions.so: pbx_functions.o #$(BUILTINS)
$(CC) $(SOLINK) -o $@ $<