2005-05-05 05:39:33 +00:00
|
|
|
#
|
|
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
|
|
#
|
|
|
|
# Makefile for dialplan functions
|
|
|
|
#
|
2006-02-11 03:14:05 +00:00
|
|
|
# Copyright (C) 2005 - 2006, Digium
|
2005-05-05 05:39:33 +00:00
|
|
|
#
|
|
|
|
# Kevin P. Fleming <kpfleming@digium.com>
|
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License
|
|
|
|
#
|
|
|
|
|
2006-02-11 03:14:05 +00:00
|
|
|
AVAILABLE_FUNCS=$(patsubst %.c,%.o,$(wildcard func*.c))
|
2005-12-22 03:49:41 +00:00
|
|
|
|
|
|
|
ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
|
|
|
|
STANDALONE_FUNCS=$(filter-out func_odbc.o,$(AVAILABLE_FUNCS))
|
|
|
|
else
|
|
|
|
STANDALONE_FUNCS=$(AVAILABLE_FUNCS)
|
|
|
|
endif
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2006-02-11 03:14:05 +00:00
|
|
|
FUNCS=$(STANDALONE_FUNCS:.o=.so)
|
2005-05-05 12:43:04 +00:00
|
|
|
|
2005-11-01 21:53:30 +00:00
|
|
|
ifeq (${OSARCH},CYGWIN)
|
|
|
|
CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
|
|
|
|
CYGSOLIB=-L.. -L. -lasterisk.dll
|
|
|
|
else
|
2005-10-05 00:17:57 +00:00
|
|
|
CFLAGS+=-fPIC
|
2005-11-01 21:53:30 +00:00
|
|
|
endif
|
2005-05-05 17:39:18 +00:00
|
|
|
|
2005-05-05 05:39:33 +00:00
|
|
|
all: $(FUNCS)
|
|
|
|
|
|
|
|
clean:
|
2005-05-05 17:39:18 +00:00
|
|
|
rm -f *.so *.o .depend pbx_functions.h
|
2005-05-05 05:39:33 +00:00
|
|
|
|
|
|
|
%.so : %.o
|
2005-11-01 21:53:30 +00:00
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
|
2005-05-05 05:39:33 +00:00
|
|
|
|
2005-12-21 18:43:10 +00:00
|
|
|
func_odbc.so: func_odbc.o
|
|
|
|
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
|
|
|
|
|
2005-05-05 05:39:33 +00:00
|
|
|
install: all
|
|
|
|
for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
|
|
|
|
|
2006-02-01 18:39:41 +00:00
|
|
|
uninstall:
|
|
|
|
|
2005-05-05 05:39:33 +00:00
|
|
|
ifneq ($(wildcard .depend),)
|
2005-08-30 02:54:02 +00:00
|
|
|
include .depend
|
2005-05-05 05:39:33 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
.depend: pbx_functions.h
|
2005-06-20 17:26:08 +00:00
|
|
|
../build_tools/mkdep $(CFLAGS) `ls *.c`
|
2005-05-05 05:39:33 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
env
|