Q:

Makefile shell function and environment vars

I'm playing around with Multicorn for Postgres, and its Makefile doesn't seem to play nice with Python virtual environments. It wants to install itself to the system Python in spite of pyenv. I think this is happening because its Makefile is doing this to find the Python version:
$(shell ${PYTHON} --version 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1-2)

From what I've read, shell starts an entirely new shell, and it doesn't seem to carry over the environment variables that pyenv sets to point everything to a certain Python version.
Wondering if anybody has had a similar problem and how they might have gotten around it.
Thanks!

A:

You can pass the pyenv version via the PYENV_VERSION environment variable. I'd imagine something like:
PYENV_VERSION=your_virtualenv make

to work.

