summaryrefslogtreecommitdiff
path: root/Examples/modula3
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/modula3')
-rw-r--r--Examples/modula3/class/Makefile6
-rw-r--r--Examples/modula3/class/example.cxx10
-rw-r--r--Examples/modula3/enum/Makefile6
-rw-r--r--Examples/modula3/exception/Makefile8
-rw-r--r--Examples/modula3/reference/Makefile6
-rw-r--r--Examples/modula3/reference/example.cxx2
-rw-r--r--Examples/modula3/reference/example.h4
-rw-r--r--Examples/modula3/simple/Makefile6
-rw-r--r--Examples/modula3/typemap/Makefile6
9 files changed, 27 insertions, 27 deletions
diff --git a/Examples/modula3/class/Makefile b/Examples/modula3/class/Makefile
index af8e099cc..2e2f37526 100644
--- a/Examples/modula3/class/Makefile
+++ b/Examples/modula3/class/Makefile
@@ -8,10 +8,10 @@ SWIGOPT = -c++
MODULA3SRCS = *.[im]3
check: build
- $(MAKE) -f $(TOP)/Makefile modula3_run
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run
build:
- $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3
m3ppinplace $(MODULA3SRCS)
# compilation of example_wrap.cxx is started by cm3
@@ -21,4 +21,4 @@ build:
cm3
clean:
- $(MAKE) -f $(TOP)/Makefile modula3_clean
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean
diff --git a/Examples/modula3/class/example.cxx b/Examples/modula3/class/example.cxx
index 1e8e203dd..046304519 100644
--- a/Examples/modula3/class/example.cxx
+++ b/Examples/modula3/class/example.cxx
@@ -1,4 +1,4 @@
-/* File : example.c */
+/* File : example.cxx */
#include "example.h"
#define M_PI 3.14159265358979323846
@@ -11,18 +11,18 @@ void Shape::move(double dx, double dy) {
int Shape::nshapes = 0;
-double Circle::area(void) {
+double Circle::area() {
return M_PI*radius*radius;
}
-double Circle::perimeter(void) {
+double Circle::perimeter() {
return 2*M_PI*radius;
}
-double Square::area(void) {
+double Square::area() {
return width*width;
}
-double Square::perimeter(void) {
+double Square::perimeter() {
return 4*width;
}
diff --git a/Examples/modula3/enum/Makefile b/Examples/modula3/enum/Makefile
index a351cb1b9..3915e5405 100644
--- a/Examples/modula3/enum/Makefile
+++ b/Examples/modula3/enum/Makefile
@@ -8,18 +8,18 @@ SWIGOPT = -c++
MODULA3SRCS = *.[im]3
check: build
- $(MAKE) -f $(TOP)/Makefile modula3_run
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run
build:
$(SWIG) -modula3 $(SWIGOPT) -module Example -generateconst $(CONSTNUMERIC) $(TARGET).h
$(CXX) -Wall $(CONSTNUMERIC).c -o $(CONSTNUMERIC)
$(CONSTNUMERIC) >$(CONSTNUMERIC).i
- $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3
m3ppinplace $(MODULA3SRCS)
mv m3makefile $(MODULA3SRCS) src/
cm3
clean:
- $(MAKE) -f $(TOP)/Makefile modula3_clean
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean
diff --git a/Examples/modula3/exception/Makefile b/Examples/modula3/exception/Makefile
index 8d4525512..1dbf1a156 100644
--- a/Examples/modula3/exception/Makefile
+++ b/Examples/modula3/exception/Makefile
@@ -8,15 +8,15 @@ MODULA3SRCS = *.[im]3
MODULA3FLAGS= -o runme
check: build
- $(MAKE) -f $(TOP)/Makefile modula3_run
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run
build:
- $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3_cpp
-# $(MAKE) -f $(TOP)/Makefile MODULA3SRCS='$(MODULA3SRCS)' MODULA3FLAGS='$(MODULA3FLAGS)' modula3_compile
+# $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' MODULA3SRCS='$(MODULA3SRCS)' MODULA3FLAGS='$(MODULA3FLAGS)' modula3_compile
m3ppinplace $(MODULA3SRCS)
mv m3makefile $(MODULA3SRCS) src/
cm3
clean:
- $(MAKE) -f $(TOP)/Makefile modula3_clean
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean
diff --git a/Examples/modula3/reference/Makefile b/Examples/modula3/reference/Makefile
index 1a5fdeb30..3b68fe822 100644
--- a/Examples/modula3/reference/Makefile
+++ b/Examples/modula3/reference/Makefile
@@ -7,14 +7,14 @@ SWIGOPT = -c++
MODULA3SRCS = *.[im]3
check: build
- $(MAKE) -f $(TOP)/Makefile modula3_run
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run
build:
- $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3
m3ppinplace $(MODULA3SRCS)
mv m3makefile $(MODULA3SRCS) src/
cm3
clean:
- $(MAKE) -f $(TOP)/Makefile modula3_clean
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean
diff --git a/Examples/modula3/reference/example.cxx b/Examples/modula3/reference/example.cxx
index 649b0169c..9dbaed2ee 100644
--- a/Examples/modula3/reference/example.cxx
+++ b/Examples/modula3/reference/example.cxx
@@ -19,7 +19,7 @@ Vector operator+(const Vector &a, const Vector &b) {
char *Vector::print() {
static char temp[512];
- sprintf(temp,"Vector %x (%g,%g,%g)", (int)this, x,y,z);
+ sprintf(temp,"Vector %p (%g,%g,%g)", (void *)this, x,y,z);
return temp;
}
diff --git a/Examples/modula3/reference/example.h b/Examples/modula3/reference/example.h
index 0a9cd447f..7b4ba8fb8 100644
--- a/Examples/modula3/reference/example.h
+++ b/Examples/modula3/reference/example.h
@@ -4,8 +4,8 @@ struct Vector {
private:
double x,y,z;
public:
- Vector() : x(0), y(0), z(0) { };
- Vector(double x, double y, double z) : x(x), y(y), z(z) { };
+ Vector() : x(0), y(0), z(0) { }
+ Vector(double x, double y, double z) : x(x), y(y), z(z) { }
Vector operator+(const Vector &b) const;
char *print();
};
diff --git a/Examples/modula3/simple/Makefile b/Examples/modula3/simple/Makefile
index 6287dac20..2796b25f8 100644
--- a/Examples/modula3/simple/Makefile
+++ b/Examples/modula3/simple/Makefile
@@ -7,14 +7,14 @@ SWIGOPT =
MODULA3SRCS = *.[im]3
check: build
- $(MAKE) -f $(TOP)/Makefile modula3_run
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run
build:
- $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3
m3ppinplace $(MODULA3SRCS)
mv m3makefile $(MODULA3SRCS) src/
cm3
clean:
- $(MAKE) -f $(TOP)/Makefile modula3_clean
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean
diff --git a/Examples/modula3/typemap/Makefile b/Examples/modula3/typemap/Makefile
index 6287dac20..2796b25f8 100644
--- a/Examples/modula3/typemap/Makefile
+++ b/Examples/modula3/typemap/Makefile
@@ -7,14 +7,14 @@ SWIGOPT =
MODULA3SRCS = *.[im]3
check: build
- $(MAKE) -f $(TOP)/Makefile modula3_run
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_run
build:
- $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' modula3
m3ppinplace $(MODULA3SRCS)
mv m3makefile $(MODULA3SRCS) src/
cm3
clean:
- $(MAKE) -f $(TOP)/Makefile modula3_clean
+ $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' modula3_clean