summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2013-04-13 00:50:19 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2013-04-19 22:47:26 +0100
commit92ffedceb50188d309dfc9587dc0f83b31020209 (patch)
tree546be8e6ceefaa09c67306dd3707876d60b1e657
parent14a89fac86129a1d876cdc253d82046ea6fd1a0a (diff)
downloadswig-92ffedceb50188d309dfc9587dc0f83b31020209.tar.gz
Perl examples makefiles clean target fixed and use RUNPIPE and tidyup
-rw-r--r--Examples/Makefile.in11
-rw-r--r--Examples/perl5/class/Makefile11
-rw-r--r--Examples/perl5/constants/Makefile12
-rw-r--r--Examples/perl5/constants2/Makefile12
-rw-r--r--Examples/perl5/funcptr/Makefile12
-rw-r--r--Examples/perl5/import/Makefile10
-rw-r--r--Examples/perl5/inline/Makefile7
-rw-r--r--Examples/perl5/java/Makefile14
-rw-r--r--Examples/perl5/multimap/Makefile12
-rw-r--r--Examples/perl5/multiple_inheritance/Makefile11
-rw-r--r--Examples/perl5/pointer/Makefile12
-rw-r--r--Examples/perl5/reference/Makefile11
-rw-r--r--Examples/perl5/simple/Makefile12
-rw-r--r--Examples/perl5/value/Makefile12
-rw-r--r--Examples/perl5/variables/Makefile12
-rw-r--r--Examples/perl5/xmlstring/Makefile15
16 files changed, 102 insertions, 84 deletions
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index f0659dc56..07b375e66 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -189,6 +189,8 @@ PERL5_INCLUDE= @PERL5EXT@
PERL5_DLNK = @PERL5DYNAMICLINKING@
PERL5_CCFLAGS = @PERL5CCFLAGS@
PERL = @PERL@
+PERL5_LIB = -L$(PERL5_INCLUDE) -l@PERL5LIB@ @LIBS@ $(SYSLIBS)
+PERL5_SCRIPT = $(RUNME).pl
# ----------------------------------------------------------------
# Build a Perl5 dynamically loadable module (C)
@@ -219,8 +221,6 @@ perl5_xs: $(SRCS)
# Build a statically linked Perl5 executable
# ----------------------------------------------------------------
-PERL5_LIB = -L$(PERL5_INCLUDE) -l@PERL5LIB@ @LIBS@ $(SYSLIBS)
-
perl5_static: $(SRCS)
$(SWIG) -perl5 -static -lperlmain.i $(SWIGOPT) $(INTERFACEPATH)
$(CC) $(CFLAGS) -Dbool=char $(SRCS) $(ISRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
@@ -230,6 +230,13 @@ perl5_static_cpp: $(SRCS)
$(CXX) $(CFLAGS) $(SRCS) $(CXXSRCS) $(ICXXSRCS) $(INCLUDES) -I$(PERL5_INCLUDE) $(PERL5_LIB) $(LIBS) -o $(TARGET)
# -----------------------------------------------------------------
+# Running a Perl5 example
+# -----------------------------------------------------------------
+
+perl5_run:
+ $(RUNTOOL) $(PERL) $(PERL5_SCRIPT) $(RUNPIPE)
+
+# -----------------------------------------------------------------
# Version display
# -----------------------------------------------------------------
diff --git a/Examples/perl5/class/Makefile b/Examples/perl5/class/Makefile
index f53361730..544d13642 100644
--- a/Examples/perl5/class/Makefile
+++ b/Examples/perl5/class/Makefile
@@ -5,15 +5,16 @@ TARGET = example
INTERFACE = example.i
LIBS = -lm
-all::
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5_cpp
-static::
+static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/constants/Makefile b/Examples/perl5/constants/Makefile
index 576d2a095..899282913 100644
--- a/Examples/perl5/constants/Makefile
+++ b/Examples/perl5/constants/Makefile
@@ -4,15 +4,17 @@ SRCS =
TARGET = example
INTERFACE = example.i
SWIGOPT =
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/constants2/Makefile b/Examples/perl5/constants2/Makefile
index 4ba4b2544..2ed10d733 100644
--- a/Examples/perl5/constants2/Makefile
+++ b/Examples/perl5/constants2/Makefile
@@ -4,15 +4,17 @@ SRCS =
TARGET = example
INTERFACE = example.i
SWIGOPT = -const
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/funcptr/Makefile b/Examples/perl5/funcptr/Makefile
index ce2bbb5b9..c4d100020 100644
--- a/Examples/perl5/funcptr/Makefile
+++ b/Examples/perl5/funcptr/Makefile
@@ -4,15 +4,17 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
SWIGOPT =
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/import/Makefile b/Examples/perl5/import/Makefile
index 60dfdfcee..baa8277fd 100644
--- a/Examples/perl5/import/Makefile
+++ b/Examples/perl5/import/Makefile
@@ -3,7 +3,10 @@ SWIG = $(TOP)/../preinst-swig
SWIGOPT =
LIBS =
-all::
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
LIBS='$(LIBS)' TARGET='baseclass' INTERFACE='base.i' perl5_cpp
$(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
@@ -13,8 +16,5 @@ all::
$(MAKE) -f $(TOP)/Makefile SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' \
LIBS='$(LIBS)' TARGET='spam' INTERFACE='spam.i' perl5_cpp
-
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/inline/Makefile b/Examples/perl5/inline/Makefile
index 4ac085ec3..d544a6532 100644
--- a/Examples/perl5/inline/Makefile
+++ b/Examples/perl5/inline/Makefile
@@ -1,7 +1,6 @@
-all:
-
run:
- perl runme.pl
+ $(MAKE) -f $(TOP)/Makefile perl5_run
clean:
- rm -fr _Inline *~
+ $(MAKE) -f $(TOP)/Makefile perl5_clean
+ rm -rf _Inline
diff --git a/Examples/perl5/java/Makefile b/Examples/perl5/java/Makefile
index 882eba70f..b007cfdbb 100644
--- a/Examples/perl5/java/Makefile
+++ b/Examples/perl5/java/Makefile
@@ -5,22 +5,18 @@ TARGET = example
INTERFACE = example.i
LIBS = -lm
-all:: Example.class
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build: Example.class
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' CXX="gcj" \
CXXSHARED="gcj -fpic -shared Example.class" PERL5_CCFLAGS='' PERL5_EXP='' LIBS="-lstdc++" perl5_cpp
-
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
rm -f *.class Example.h
-check: all
-
-run:
- perl runme.pl
-
Example.class: Example.java
gcj -fPIC -C -c -g Example.java
gcjh Example
-
diff --git a/Examples/perl5/multimap/Makefile b/Examples/perl5/multimap/Makefile
index ce2bbb5b9..c4d100020 100644
--- a/Examples/perl5/multimap/Makefile
+++ b/Examples/perl5/multimap/Makefile
@@ -4,15 +4,17 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
SWIGOPT =
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/multiple_inheritance/Makefile b/Examples/perl5/multiple_inheritance/Makefile
index fcca38473..18c3058f9 100644
--- a/Examples/perl5/multiple_inheritance/Makefile
+++ b/Examples/perl5/multiple_inheritance/Makefile
@@ -5,15 +5,16 @@ TARGET = example
INTERFACE = example.i
LIBS =
-all::
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5_cpp
-static::
+static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/pointer/Makefile b/Examples/perl5/pointer/Makefile
index ce2bbb5b9..c4d100020 100644
--- a/Examples/perl5/pointer/Makefile
+++ b/Examples/perl5/pointer/Makefile
@@ -4,15 +4,17 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
SWIGOPT =
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/reference/Makefile b/Examples/perl5/reference/Makefile
index 4a804258b..d33dd89fe 100644
--- a/Examples/perl5/reference/Makefile
+++ b/Examples/perl5/reference/Makefile
@@ -6,15 +6,16 @@ INTERFACE = example.i
LIBS = -lm
SWIGOPT = -noproxy
-all::
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' SWIGOPT='$(SWIGOPT)' perl5_cpp
-static::
+static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='myperl' INTERFACE='$(INTERFACE)' SWIGOPT='$(SWIGOPT)' perl5_cpp_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/simple/Makefile b/Examples/perl5/simple/Makefile
index ce2bbb5b9..c4d100020 100644
--- a/Examples/perl5/simple/Makefile
+++ b/Examples/perl5/simple/Makefile
@@ -4,15 +4,17 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
SWIGOPT =
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/value/Makefile b/Examples/perl5/value/Makefile
index ce2bbb5b9..c4d100020 100644
--- a/Examples/perl5/value/Makefile
+++ b/Examples/perl5/value/Makefile
@@ -4,15 +4,17 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
SWIGOPT =
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/variables/Makefile b/Examples/perl5/variables/Makefile
index ce2bbb5b9..c4d100020 100644
--- a/Examples/perl5/variables/Makefile
+++ b/Examples/perl5/variables/Makefile
@@ -4,15 +4,17 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
SWIGOPT =
-all::
+
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' perl5
-static::
+static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
diff --git a/Examples/perl5/xmlstring/Makefile b/Examples/perl5/xmlstring/Makefile
index 36143fc3a..df9dabd11 100644
--- a/Examples/perl5/xmlstring/Makefile
+++ b/Examples/perl5/xmlstring/Makefile
@@ -5,19 +5,16 @@ TARGET = example
INTERFACE = example.i
LIBS = -lxerces-c -lxerces-depdom -lm
-all::
+check: build
+ $(MAKE) -f $(TOP)/Makefile perl5_run
+
+build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' LIBS=$(LIBS) CXX="g++ -g3" perl5_cpp
-static::
+static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='myperl' INTERFACE='$(INTERFACE)' perl5_cpp_static
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile perl5_clean
-
-check: all
-
-
-run:
- perl runme.pl