[R-pkg-devel] Alternative to ifeq for Makevars

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Fri Nov 8 20:33:45 CET 2024


В Fri, 8 Nov 2024 11:21:16 -0800
Josiah Parry <josiah.parry using gmail.com> пишет:

> I want to conditionally set the value of CRAN_FLAGS like so in my
> Makevars files
> 
> ifeq ($(NOT_CRAN), false)
>   CRAN_FLAGS = -j 2 --offline
> else
>   CRAN_FLAGS =
> endif

Unless a better approach surfaces (detect the environment variable in
the configure script and generate src/Makevars from src/Makevars.in?),
you may be interested in the following movfuscator-like
POSIX-compatible trick: https://nullprogram.com/blog/2016/04/30/

EXTRA_FLAGS_true =
EXTRA_FLAGS_ = -j 2 --offline
EXTRA_FLAGS = $(EXTRA_FLAGS_$(NOT_CRAN))

(This one is untested, sorry.)

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list