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
Post a Comment