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

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World