| 1 |
# Basic R extensions info |
| 2 |
R_HOME := $(shell R RHOME) |
| 3 |
RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags) |
| 4 |
|
| 5 |
# Header files required by Rcpp |
| 6 |
RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags) |
| 7 |
|
| 8 |
# Location of RInsideC.h |
| 9 |
RINSIDECINCL := $(shell echo 'RInside:::CFlags()' | $(R_HOME)/bin/R --vanilla --slave) |
| 10 |
|
| 11 |
# Location of RInsideC library |
| 12 |
RINSIDECLIBS := $(shell echo 'RInside:::LdFlags()' | $(R_HOME)/bin/R --vanilla --slave) |
| 13 |
|
| 14 |
# C compiler |
| 15 |
CC := $(shell $(R_HOME)/bin/R CMD config CC) |
| 16 |
|
| 17 |
FLAGS := $(RLDFLAGS) $(RCPPFLAGS) $(RINSIDECLIBS) $(RINSIDECINCL) |
| 18 |
|
| 19 |
hello: |
| 20 |
$(CC) hello.c $(FLAGS) -o hello |
| 21 |
./hello |
| 22 |
|
| 23 |
pass: |
| 24 |
$(CC) passdata.c $(FLAGS) -o passdata |
| 25 |
./passdata |