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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -