Skip to content

Commit 5614c21

Browse files
authored
make generate_makevars_sources.R slightly more portable (#73)
1 parent 4a34774 commit 5614c21

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RCPP_PARALLEL_CPPFLAGS=`"${R_HOME}/bin/Rscript" -e "cat(RcppParallel::CxxFlags()
55
RCPP_PARALLEL_LIBS=`"${R_HOME}/bin/Rscript" -e "cat(RcppParallel::LdFlags())"`
66

77
# Generate sources.mk using R
8-
"${R_HOME}/bin/Rscript" R/generate_makevars_sources.R > src/sources.mk
8+
"${R_HOME}/bin/Rscript" inst/generate_makevars_sources.R > src/sources.mk
99

1010
# Substitute into Makevars
1111
sed -e "s|@RCPP_PARALLEL_CPPFLAGS@|${RCPP_PARALLEL_CPPFLAGS}|" \

configure.win

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RCPP_PARALLEL_CPPFLAGS=`"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "cat(RcppPar
55
RCPP_PARALLEL_LIBS=`"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "cat(RcppParallel::LdFlags())"`
66

77
# Generate sources.mk using R
8-
"${R_HOME}/bin/Rscript" R/generate_makevars_sources.R > src/sources.mk
8+
"${R_HOME}/bin/Rscript" inst/generate_makevars_sources.R > src/sources.mk
99

1010
# Substitute into Makevars.win
1111
sed -e "s|@RCPP_PARALLEL_CPPFLAGS@|${RCPP_PARALLEL_CPPFLAGS}|" \
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ cpp <- list.files(
55
full.names = TRUE
66
)
77

8-
# strip leading "src/"
9-
cpp <- sub("^src/", "", cpp)
8+
# strip leading "src/" (MacOs/ Linux) or leading "src\\" (Windows)
9+
cpp <- sub("^src[\\\\/]", "", cpp)
1010

11-
con <- file("src/sources.mk", open = "w")
11+
con <- file(file.path("src", "sources.mk"), open = "w")
1212

1313
writeLines(c(
1414
"# ------------------------------------------------------------------",

0 commit comments

Comments
 (0)