summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Examples/Makefile.in10
-rw-r--r--Examples/r/class/Makefile10
-rw-r--r--Examples/r/simple/Makefile10
3 files changed, 19 insertions, 11 deletions
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index 94d4eecac..37ba120d0 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -1359,6 +1359,7 @@ R = R
RCXXSRCS = $(INTERFACE:.i=_wrap.cpp) #Need to use _wrap.cpp for R build system as it does not understand _wrap.cxx
RRSRC = $(INTERFACE:.i=.R)
R_CFLAGS=-fPIC
+R_SCRIPT=$(RUNME).R
# need to compile .cxx files outside of R build system to make sure that
# we get -fPIC
@@ -1387,6 +1388,13 @@ endif
+( PKG_CPPFLAGS="$(INCLUDES)" $(COMPILETOOL) $(R) CMD SHLIB -o $(LIBPREFIX)$(TARGET)$(SO) $(RCXXSRCS) $(OBJS) > /dev/null )
# -----------------------------------------------------------------
+# Run R example
+# -----------------------------------------------------------------
+
+r_run:
+ $(RUNTOOL) $(R) CMD BATCH $(R_SCRIPT) $(RUNPIPE)
+
+# -----------------------------------------------------------------
# Version display
# -----------------------------------------------------------------
@@ -1401,7 +1409,7 @@ r_clean:
rm -f *_wrap* *~ .~*
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@SO@ NAMESPACE
- rm -f $(RRSRC) runme.Rout .RData
+ rm -f $(RRSRC) $(RUNME).Rout .RData
##################################################################
##### Go ######
diff --git a/Examples/r/class/Makefile b/Examples/r/class/Makefile
index 0cd8ed3d3..8a64f49a9 100644
--- a/Examples/r/class/Makefile
+++ b/Examples/r/class/Makefile
@@ -4,12 +4,12 @@ CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
-all::
+check: build
+ $(MAKE) -f $(TOP)/Makefile r_run
+
+build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' r_cpp
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' r_clean
-
-check: all
- R CMD BATCH runme.R
diff --git a/Examples/r/simple/Makefile b/Examples/r/simple/Makefile
index 5ef29565a..8a8e0e1c1 100644
--- a/Examples/r/simple/Makefile
+++ b/Examples/r/simple/Makefile
@@ -4,12 +4,12 @@ SRCS = example.c
TARGET = example
INTERFACE = example.i
-all::
+check: build
+ $(MAKE) -f $(TOP)/Makefile r_run
+
+build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' r
-clean::
+clean:
$(MAKE) -f $(TOP)/Makefile INTERFACE='$(INTERFACE)' r_clean
-
-check: all
- R CMD BATCH runme.R