help-make
[Top][All Lists]
Advanced

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

how to have dependencies based on target?


From: Peter Kurpis
Subject: how to have dependencies based on target?
Date: Tue, 27 Nov 2001 11:08:17 -1000 (HST)

I would like to build a java jar file  x.jar  based on changes to
any  .class  files in subtree  x .  I tried the rule

%.jar: $(shell find $* -name \*.java | sed 's/\.java$$/.class/')
        @$(RM) $@
        $(JAR) cf $@ $^

but  find  doesn't like this.  When I tried hardwiring the directory
as an experiment, like so

%.jar: $(shell find x -name \*.java | sed 's/\.java$$/.class/')
        @$(RM) $@
        $(JAR) cf $@ $^

it worked as expected.  But it seems that  $@  and  $*  are not 
expanded on the target line (i.e. in the dependecies list)!  (Hence 
why  find  complains, I think.)  

Is this correct behavior, or am I doing something wrong?  How can I 
get this to work -- it seems such a basic thing?

Please CC me, as I am not a member of this list.  Thanks!



reply via email to

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