| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
R_HOME := $(shell R RHOME) |
| 10 |
|
| 11 |
|
| 12 |
RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflags) |
| 13 |
RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags) |
| 14 |
RBLAS := $(shell $(R_HOME)/bin/R CMD config BLAS_LIBS) |
| 15 |
RLAPACK := $(shell $(R_HOME)/bin/R CMD config LAPACK_LIBS) |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
RCPPINCL := $(shell echo 'Rcpp:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave) |
| 22 |
RCPPLIBS := $(shell echo 'Rcpp:::LdFlags()' | $(R_HOME)/bin/R --vanilla --slave) |
| 23 |
|
| 24 |
## include headers and libraries for RInside embedding classes |
| 25 |
RINSIDEINCL := $(shell echo 'RInside:::CxxFlags()' | $(R_HOME)/bin/R --vanilla --slave) |
| 26 |
RINSIDELIBS := $(shell echo 'RInside:::LdFlags()' | $(R_HOME)/bin/R --vanilla --slave) |
| 27 |
|
| 28 |
|
| 29 |
## minimal Boost libs -- works for me on Ubuntu, may need -L switches elsewhere... |
| 30 |
BOOSTLIBS := -lboost_thread |
| 31 |
|
| 32 |
|
| 33 |
## compiler etc settings used in default make rules |
| 34 |
CXX := $(shell $(R_HOME)/bin/R CMD config CXX) |
| 35 |
CPPFLAGS := -Wall $(shell $(R_HOME)/bin/R CMD config CPPFLAGS) |
| 36 |
CXXFLAGS := $(RCPPFLAGS) $(RCPPINCL) $(RINSIDEINCL) $(shell $(R_HOME)/bin/R CMD config CXXFLAGS) |
| 37 |
LDLIBS := $(RLDFLAGS) $(RRPATH) $(RBLAS) $(RLAPACK) $(RCPPLIBS) $(RINSIDELIBS) $(BOOSTLIBS) |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
all: boostEx |
| 42 |
|
| 43 |
boostEx: boostEx.cpp |
| 44 |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $^ $(LDLIBS) |
| 45 |
strip $@ |
| 46 |
|
| 47 |
clean: |
| 48 |
rm -f boostEx |