mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-06 12:21:49 +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,32 +1,22 @@
|
||||
LCFLAGS=-fPIC
|
||||
CFLAGS += -fPIC -I$(PREFIX)/include/python2.4/
|
||||
# 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=-I$(PREFIX)/include/python2.4/
|
||||
LOCAL_LDFLAGS=-lpython2.4 -L$(PREFIX)/lib/python2.4/config/ -lutil -lstdc++
|
||||
LOCAL_OBJS=freeswitch_python.o mod_python_wrap.o
|
||||
include $(BASE)/build/modmake.rules
|
||||
|
||||
PYMOD=freeswitch
|
||||
LDFLAGS=-lpython2.4 -Xlinker -export-dynamic -L$(PREFIX)/lib/python2.4/config/ -lutil -lstdc++
|
||||
|
||||
SWIGCFILE=../../../switch_swig.c
|
||||
SWIGIFILE=../../../switch_swig.i
|
||||
CPPCC = g++
|
||||
OBJS=freeswitch_python.o mod_python_wrap.o
|
||||
|
||||
#all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PYMOD).$(DYNAMIC_LIB_EXTEN)
|
||||
all: depends $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(OBJS)
|
||||
|
||||
depends:
|
||||
local_depend:
|
||||
MAKE=$(MAKE) PY_CFLAGS=-fPIC $(BASE)/build/buildlib.sh $(BASE) install Python-2.4.3.tgz --prefix=$(PREFIX) --enable-threads
|
||||
|
||||
%.o: %.cpp
|
||||
$(CPPCC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(LCFLAGS) $(CFLAGS) -c $< -o $@
|
||||
|
||||
mod_python.c:
|
||||
$(CC) $(LCFLAGS) $(CFLAGS) -c mod_python.c -o mod_python.o
|
||||
|
||||
reswig:
|
||||
# rm -f switch_swig_wrap.c config.m4 CREDITS *${PYMOD}*
|
||||
# swig -o switch_swig_wrap.c -l$(SWIGIFILE) -ignoremissing -DMULTIPLICITY -python -module $(PYMOD) $(SWIGCFILE)
|
||||
swig -python -shadow -c++ -o mod_python_wrap.cpp mod_python.i
|
||||
# patch -p0 -i fix.diff
|
||||
|
||||
switch_swig_wrap.o: switch_swig_wrap.c Makefile
|
||||
$(CC) -w $(CFLAGS) -c $< -o $@
|
||||
@@ -34,20 +24,6 @@ switch_swig_wrap.o: switch_swig_wrap.c Makefile
|
||||
switch_swig.o: $(SWIGCFILE) Makefile
|
||||
$(CC) -w $(CFLAGS) -c $< -o $@
|
||||
|
||||
|
||||
# $(PYMOD).$(DYNAMIC_LIB_EXTEN): $(MODNAME).$(DYNAMIC_LIB_EXTEN) switch_swig_wrap.o switch_swig.o Makefile
|
||||
# $(CC) $(SOLINK) -o py_$(PYMOD).$(DYNAMIC_LIB_EXTEN) switch_swig_wrap.o switch_swig.o $(LDFLAGS)
|
||||
|
||||
# $(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).o $(OBJS) switch_swig_wrap.o switch_swig.o Makefile
|
||||
# $(CC) $(LCFLAGS) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o switch_swig_wrap.o switch_swig.o $(OBJS) $(LDFLAGS)
|
||||
|
||||
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).o $(OBJS) Makefile
|
||||
$(CC) $(LCFLAGS) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o $(OBJS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
|
||||
|
||||
install:
|
||||
$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/mod
|
||||
local_install:
|
||||
cp -f freeswitch.py $(PREFIX)/lib/python2.4/site-packages/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user