[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dependent Shell Commands
From: |
Soren A |
Subject: |
Re: Dependent Shell Commands |
Date: |
Wed, 2 Oct 2002 19:10:20 +0000 (UTC) |
User-agent: |
Xnews/L5 |
Steve <address@hidden> wrote around 27 Sep 2002
news:address@hidden:
> 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Dependent Shell Commands,
Soren A <=