git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8530 626c5289-ae23-0410-ae9c-e8d60b6d4f22
37 lines
654 B
Makefile
37 lines
654 B
Makefile
|
|
SWIGFLAGS = -c++
|
|
|
|
C_SOURCES =
|
|
CXX_SOURCES = example.cxx
|
|
|
|
SWIG = ../../../preinst-swig
|
|
|
|
all: check
|
|
|
|
example_wrap.cpp: example.i
|
|
$(SWIG) -php4 $(SWIGFLAGS) example.i
|
|
|
|
OBJS= example_wrap.o $(C_SOURCES:.c=.o) $(CXX_SOURCES:.cxx=.o)
|
|
|
|
PROG=php_example.so
|
|
|
|
PHP_INC=`php-config --includes`
|
|
|
|
CFLAGS = -fpic
|
|
LDFLAGS = -shared
|
|
|
|
$(PROG): $(OBJS)
|
|
$(CXX) $(LDFLAGS) $(OBJS) -o $(PROG) $(EXTRA_LIB)
|
|
|
|
%.o: %.cpp
|
|
$(CXX) $(PHP_INC) $(CFLAGS) -c $<
|
|
%.o: %.cxx
|
|
$(CXX) $(PHP_INC) $(CFLAGS) -c $<
|
|
%.o: %.c
|
|
$(CC) $(PHP_INC) $(CFLAGS) -c $<
|
|
|
|
check: $(PROG)
|
|
@php -d extension_dir=. runme.php4
|
|
|
|
clean:
|
|
rm -f example_wrap.* *.o *~ *.so core example.php php_example.h
|