MKDIR?=mkdir
RM?=rm -f
CP?=cp

CXX_STD=CXX11
#PKG_CPPFLAGS = -DRCPP_USE_UNWIND_PROTECT
MKDIR_P = ${MKDIR} -p

.PHONY: all create-folder make-static-lib copy-files

all: create-folder ${SHLIB} make-static-lib copy-files
#all: ${SHLIB}

create-folder:
	 ${MKDIR_P} ../inst/include&&\
	 ${MKDIR_P} ../inst/include/SharedObject&&\
	 ${MKDIR_P} ../inst/usrlib${R_ARCH}

make-static-lib:
	 ${AR} -crv SharedObject.a *.o

copy-files:
	 ${CP} "sharedMemory.h" "../inst/include/SharedObject/"&&\
	 ${CP} "SharedObject.a" "../inst/usrlib${R_ARCH}/"
