Issues

Issue #270 resolved

Makefile and variables from shell

fredj
created an issue

Hi,

I want to set the SPHINXBUILD variable from a shell script before building the doc, something like: {{{ export SPHINXBUILD=/path/to/sphinx-build make html }}} But the Makefile do not use the value.

Do I miss something ?

I've checked the make manual and the variable declaration should be replace from: {{{ SPHINXBUILD = sphinx-build }}} to: {{{ SPHINXBUILD ?= sphinx-build }}} It's the conditional variable assignment operator: the value is only set if the variable is undefined. I've updated the generated Makefile and it's works.

I'm using GNU Make 3.81 on debian etch.

Regards, fredj

Comments (4)

  1. Georg Brandl repo owner

    The "?=" syntax is not portable among Make implementations.

    You can, however, put the variables on the make command line; they will always overwrite the ones in the Makefile in that case:

    make html SPHINXBUILD=/path/to/sphinx-build
    

    or, if SPHINXBUILD is set by some calling program,

    make html SPHINXBUILD="$SPHINXBUILD"
    
  2. Log in to comment