Steve <[EMAIL PROTECTED]> wrote around 27 Sep 2002
[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]:
> If this is a silly question then please forgive me, but I'm new to GNU
> Make.
It isn't really a silly question, but it does show your lack of familiarity
with 'make'.
> [...] can't assume that the strfile command [...] is going to be in
> the users $PATH. For example, SuSE puts strfile in /usr/sbin, which
> isn't automatically in $PATH.
Basically this sort of thing, generally, is why 'configure' build setups
exist.
{snip}
> Testing the command within a for loop sucks, but I can't seem to
> define the command on the fly and then us it within the loop without
> getting an error. So, my question is really this: how do I test for a
> shell command and define it on the fly?
Hmmmph. If you _have to_ do it in make, then i would suggest trying
something like this (untested in the specific sense but I have used similar
approaches in my own Makefiles in the past, rarely...):
POSS_PATHS = /usr/bin /usr/sbin /usr/local/bin
my_CMD = $(firstword $(wildcard \
$(addsuffix /strfile$(EXEEXT),$(POSS_PATHS))))
ifeq "$(strip $(my_CMD))" ""
$(error No strfile found, edit POSS_PATHS to help me out!)
endif
HTH,
Soren A
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make