~ubuntu-branches/ubuntu/maverick/swig1.3/maverick

« back to all changes in this revision

Viewing changes to Examples/php4/reference/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2006-12-20 14:43:24 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20061220144324-bps3kb06xp5oy9w1
Tags: 1.3.31-1ubuntu1
* Merge from debian unstable, remaining changes:
  - drop support for pike
  - use php5 instead of php4
  - clean Runtime/ as well
  - force a few environment variables

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
SWIGFLAGS   = -c++ -noproxy
3
 
 
4
 
C_SOURCES   = 
5
 
CXX_SOURCES = example.cxx
6
 
 
7
 
SWIG = ../../../preinst-swig
8
 
 
9
 
all: check
10
 
 
11
 
example_wrap.cpp: example.i
12
 
        $(SWIG) -php4 $(SWIGFLAGS) example.i
13
 
 
14
 
OBJS= example_wrap.o $(C_SOURCES:.c=.o) $(CXX_SOURCES:.cxx=.o)
15
 
 
16
 
PROG=php_example.so
17
 
 
18
 
PHP_INC=`php-config --includes`
19
 
 
20
 
CFLAGS  = -fpic
21
 
LDFLAGS = -shared
22
 
 
23
 
$(PROG): $(OBJS)
24
 
        $(CXX) $(LDFLAGS) $(OBJS) -o $(PROG) $(EXTRA_LIB)
25
 
 
26
 
%.o: %.cpp
27
 
        $(CXX) $(PHP_INC) $(CFLAGS) -c $<
28
 
%.o: %.cxx
29
 
        $(CXX) $(PHP_INC) $(CFLAGS) -c $<
30
 
%.o: %.c
31
 
        $(CC) $(PHP_INC) $(CFLAGS) -c $<
32
 
 
33
 
check: $(PROG)
34
 
        @php -d extension_dir=. runme.php4
35
 
 
36
 
clean:
37
 
        rm -f example_wrap.* *.o *~ *.so core example.php php_example.h
 
1
TOP        = ../..
 
2
SWIG       = $(TOP)/../preinst-swig
 
3
CXXSRCS    = example.cxx
 
4
TARGET     = example
 
5
INTERFACE  = example.i
 
6
LIBS       =
 
7
SWIGOPT    = -noproxy
 
8
 
 
9
all::
 
10
        $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
 
11
        SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
 
12
        php4_cpp
 
13
 
 
14
static::
 
15
        $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
 
16
        SWIGOPT='$(SWIGOPT)' TARGET='myphp4' INTERFACE='$(INTERFACE)' \
 
17
        php4_cpp_static
 
18
 
 
19
clean::
 
20
        $(MAKE) -f $(TOP)/Makefile php4_clean
 
21
        rm -f $(TARGET).php
 
22
 
 
23
check: all
 
24
        $(MAKE) -f $(TOP)/Makefile php4_run