[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: On the fly expansion of make targets
From: |
Ossama Othman |
Subject: |
Re: On the fly expansion of make targets |
Date: |
Fri, 1 Mar 2002 23:18:22 -0800 |
User-agent: |
Mutt/1.3.27i |
On Fri, Mar 01, 2002 at 10:58:17PM -0800, Ossama Othman wrote:
> Is there any way to achieve the following portably?
>
> source = test.foo # assume it exists
> source_suffixes = bar baz
> targets = \
> $(shell base=`echo $(source) | sed -e 's/\..*$$//'`; t= ; for p in
> $(source_suffixes); do t="$$t $$base$$p"; done; echo $$t)
>
> $(targets): $(source)
> $(SOME_COMMAND) $?
>
> The is to generate the following on-the-fly:
>
> testbar testbaz: test.foo
> $(SOME_COMMAND) $?
To be clear, I mean generate on-the-fly at make-time.
-Ossama
--
Ossama Othman <address@hidden>
Distributed Object Computing Laboratory, Univ. of California at Irvine
1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068 70E6 5EB7 5E71 F7A3 94A8