PKG_CXXFLAGS += $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "RcppParallel::CxxFlags()")

# Needed due to RcppArmadillo
PKG_LIBS += $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
# Needed due to RcppParallel
PKG_LIBS += $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "RcppParallel::RcppParallelLibs()")

# Get source files (see https://stackoverflow.com/a/27794283/5793905 but note the quotes)
CPP_SOURCES = $(shell find . -type f -name '*.cpp')

# Change extension (see https://www.gnu.org/software/make/manual/make.html#Text-Functions)
OBJECTS = $(CPP_SOURCES:.cpp=.o)
