mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-16 08:14:13 +00:00
an attempt to simplify the module make files. More changes to come on the modules building soon
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4562 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
52b40252ef
commit
514bde18c7
45 files changed
+461
-634
No files matched your search
@@ -1,50 +1,43 @@
|
||||
# define these targets in your makefile if you wish
|
||||
# local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
|
||||
|
||||
# and define these variables to imapact your build
|
||||
LOCAL_CFLAGS=-DMULTIPLICITY $(shell $(PERL) -MExtUtils::Embed -e ccopts) -DEMBED_PERL
|
||||
LOCAL_LDFLAGS=$(shell $(PERL) -MExtUtils::Embed -e ldopts) $(shell $(PERL) -MConfig -e 'print $$Config{libs}')
|
||||
LOCAL_OBJS=perlxsi.o
|
||||
include $(BASE)/build/modmake.rules
|
||||
|
||||
PERL = $(shell which perl)
|
||||
PERL_LIBDIR =-L$(shell perl -MConfig -e 'print $$Config{archlib}')/CORE
|
||||
PERL_LIBS =$(shell perl -MConfig -e 'print $$Config{libs}')
|
||||
CFLAGS += -DMULTIPLICITY $(shell $(PERL) -MExtUtils::Embed -e ccopts)
|
||||
CFLAGS += -DEMBED_PERL
|
||||
LDFLAGS += $(shell $(PERL) -MExtUtils::Embed -e ldopts)
|
||||
LDFLAGS += $(shell $(PERL) -MConfig -e 'print $$Config{libs}')
|
||||
OBJS += perlxsi.o
|
||||
|
||||
SWIGCFILE=../../../switch_swig.c
|
||||
SWIGIFILE=../../../switch_swig.i
|
||||
|
||||
|
||||
all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) fs_perl.$(DYNAMIC_LIB_EXTEN)
|
||||
local_all: fs_perl.$(DYNAMIC_LIB_EXTEN)
|
||||
|
||||
.perlok:
|
||||
@(${PERL} -V | grep -i usemultiplicity=define >/dev/null && echo Phew, You have the right perl.) \
|
||||
|| ((echo Sorry, you need to compile perl with threads and multiplicity.&& exit 1))
|
||||
@touch .perlok
|
||||
|
||||
depends:
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
reswig:
|
||||
rm switch_swig_wrap.c
|
||||
swig -o switch_swig_wrap.c -l$(SWIGIFILE) -ignoremissing -DMULTIPLICITY -perl5 -module fs_perl $(SWIGCFILE)
|
||||
|
||||
switch_swig.o: $(SWIGCFILE) Makefile
|
||||
$(CC) -w $(CFLAGS) -c $< -o $@
|
||||
$(CC) -w $(ALL_CFLAGS) -c $< -o $@
|
||||
|
||||
switch_swig_wrap.o: switch_swig_wrap.c
|
||||
$(CC) -w $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(CC) -w $(ALL_CFLAGS) -c $< -o $@
|
||||
|
||||
fs_perl.$(DYNAMIC_LIB_EXTEN): $(MODNAME).$(DYNAMIC_LIB_EXTEN) switch_swig_wrap.o switch_swig.o
|
||||
$(LINK) $(SOLINK) -o fs_perl.$(DYNAMIC_LIB_EXTEN) switch_swig_wrap.o switch_swig.o $(LDFLAGS)
|
||||
|
||||
local_clean:
|
||||
rm -fr *~ .perlok
|
||||
|
||||
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).o $(OBJS)
|
||||
$(LINK) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o $(OBJS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~ .perlok .libs
|
||||
|
||||
install:
|
||||
depend_install:
|
||||
mkdir -p $(PREFIX)/perl
|
||||
$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/mod
|
||||
$(LTINSTALL) fs_perl.$(DYNAMIC_LIB_EXTEN) fs_perl.pm $(PREFIX)/perl
|
||||
if [ ! -f $(PREFIX)/perl/freeswitch.pm ] ; then $(LTINSTALL) freeswitch.pm $(PREFIX)/perl ; fi
|
||||
Reference in new issue
Block a user