Fixes to Octave examples
- rename example modules from "example" to "swigexample", to avoid a warning from shadowing the Octave built-in function "example" - remove deprecated "static" Makefile targets: there is no longer an option to build static Octave modules in the Examples Makefile - emacs whitespace cleanup run on all files
This commit is contained in:
parent
7964ebe34f
commit
c28d0c6c80
63 changed files with 211 additions and 345 deletions
|
|
@ -1,10 +1,10 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
CXXSRCS =
|
||||
TARGET = example
|
||||
CXXSRCS =
|
||||
TARGET = swigexample
|
||||
INTERFACE = example.i
|
||||
LIBS = -lm
|
||||
SWIGOPT =
|
||||
SWIGOPT =
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile octave_run
|
||||
|
|
@ -13,9 +13,5 @@ build:
|
|||
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
|
||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave_cpp
|
||||
|
||||
static:
|
||||
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
|
||||
TARGET='myoctave' INTERFACE='$(INTERFACE)' octave_cpp_static
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(TOP)/Makefile octave_clean
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
%module swigexample
|
||||
|
||||
|
||||
%inline %{
|
||||
|
|
@ -23,7 +23,3 @@ public:
|
|||
// Instantiate a few versions
|
||||
%template(intSum) Sum<int>;
|
||||
%template(doubleSum) Sum<double>;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# Operator overloading example
|
||||
example
|
||||
swigexample
|
||||
|
||||
a = example.intSum(0);
|
||||
b = example.doubleSum(100.0);
|
||||
a = swigexample.intSum(0);
|
||||
b = swigexample.doubleSum(100.0);
|
||||
|
||||
# Use the objects. They should be callable just like a normal
|
||||
# python function.
|
||||
|
|
@ -14,5 +14,3 @@ endfor
|
|||
|
||||
a.result()
|
||||
b.result()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue