cook question: dealing with unpredictable target names

Aryeh Friedman <[email protected]>
Newsgroups gmane.comp.version-control.aegis.user
Message-ID <CAGBxaXkbqZcd3_vaY-OtC-cKRbceZKXHyx0ihs+VZdW4=co_Dw@mail.gmail.com>
When Java compiles an inner class or something like them (enums for
example) a separate .class file is generated for each inner class file
that has a $x where x is a internal compiler count of inner classes.
For example

public enum Foo
{
             FOO, ACK, BAR;
}

would get compiled as:

Foo$1.class
Foo$2.class
Foo$3.class

(there are no rules about what order "x" is assigned in).

Now the problem I have the following for determining what classes need
to be compiled:

java=[fromto src/%0%.java [tomcat]/WEB-INF/classes/%0%.class
[match_mask src/%0%.java [manifest]];

all: [java];

[tomcat]/WEB-INF/classes/%0%.class: deploy/classes/%0%.class
   set mkdir
{
   cp [resolve [need]] [target];
}

deploy/classes/%0%.class: src/%0%.java
   set mkdir
{
   javac -d deploy/classes -sourcepath [unsplit ':' [resolve src]] [need];
}

The problem is the above doesn't handle the xxx$y.class files because
they are not a direct off shot of [java]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.