Skip to content
Prev 6894 / 21312 Next

[Bioc-devel] portable make syntax

On 01/27/2015 02:58 AM, Gordon Brown wrote:
Also it seems like include() is an extension too (though used in the R source)?

I guess the backtick example from R-exts implies variable use in the target, 
where shell processing occurs, rather than in the Makefile. So perhaps something 
like

SAMTOOLS_PATH=\
     `echo 'cat(system.file("usrlib", .Platform[["r_arch"]],\
                          package="Rsamtools", mustWork=TRUE))' |\
                  "${R_HOME}/bin/R" --vanilla --slave`
PKG_LIBS="$(SAMTOOLS_PATH)/libbam.a" "$(SAMTOOLS_PATH)/libbcf.a"\
	"$(SAMTOOLS_PATH)/libtabix.a" -lz -pthread
PKG_CPPFLAGS=-D_USE_KNETFILE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE

(which removes a level of indirection provided by SAMVARS= / include $(SAMVARS)) 
is closer to best practice?

Martin