linux - How can i check if some dir exist and then execute in makefile -


i have in makefile

venv:     virtualenv /var/www/env && source /var/www/env/bin/activate 

but want if /var/www/env not exist

how can that

unfortunately, make rules not support negative conditions.

a common workaround use dummy files mark condition; in case have like

var-www-env-does-not-exist:     if [ -d /var/www/env ]; touch $@; else rm -f $@; exit 1; fi  venv: var-www-env-does-not-exist /var/www/env/bin/activate     virtualenv /var/www/env && source /var/www/env/bin/activate 

another idea write , call script calls virtualenv correctly deals case of existing /var/www/env.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -