Created
February 27, 2020 13:14
-
-
Save chr15m/9540222f93eebbf8e42283f696ce5563 to your computer and use it in GitHub Desktop.
Makefile rules to activate Python virtualenv for the whole Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get makefile's own path | |
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) | |
mkfile_dir := $(dir $(mkfile_path)) | |
# add virtualenv in folder "virtualenv" to the path | |
export PATH := $(mkfile_dir)/virtualenv/bin:$(PATH) | |
export VIRTUAL_ENV=$(mkfile_dir)/virtualenv | |
example: something.py | |
python something.py # <- this will be called with virtualenv activated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment