In Makefile assign path variable dependent if path exists II -


i helped in makefile assign path variable dependent if path exists , setting of var works fine if condition true.

informixdir=$(shell test -d /opt/ibm/informix && echo /opt/ibm/informix ) 

so did both possible conditions in row

informixdir=$(shell test -d /opt/ibm/informix && echo /opt/ibm/informix ) informixdir=$(shell test -d /usr/informix && echo /usr/informix ) 

but shell command returns kind of null if condition false it's unset again, won't work on system first condition true.

sometimes informixdir set in shell environment, nice consider too.

could changed $(shell test -d /opt/ibm/informix && echo /opt/ibm/informix || echo )? or use fallback value , check after: $(shell test -d /opt/ibm/informix && echo /opt/ibm/informix || echo notset )


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -