[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On the fly expansion of make targets

From: Ossama Othman
Subject: On the fly expansion of make targets
Date: Fri, 1 Mar 2002 22:58:17 -0800
User-agent: Mutt/1.3.27i


Is there any way to achieve the following portably?

source =              # 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:
        $(SOME_COMMAND) $?

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]