help-make
[Top][All Lists]
Advanced

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

possible simplification?


From: Charles Owen
Subject: possible simplification?
Date: Tue, 10 Sep 2002 14:27:47 -0700

Hello all.

I wonder if there is a simpler, more direct way to do the following:

package := example

$(classfiles)/$(package)/%.class: $(src)/$(package)/%.java
        @echo "Compiling address@hidden"
        @$(javac) $^

$(classfiles)/$(package)/%.class: $(tests)/$(package)/%.java
        @echo "Compiling address@hidden"
        @$(javac) $^

package := util

$(classfiles)/$(package)/%.class: $(src)/$(package)/%.java
        @echo "Compiling address@hidden"
        @$(javac) $^

$(classfiles)/$(package)/%.class: $(tests)/$(package)/%.java
        @echo "Compiling address@hidden"
        @$(javac) $^


I typically use a single make file for each project, and I'm developing in
Java.
For each package, I define two pattern rules: one for ordinary classes, and
another for test cases. Test source code is kept in a separate directory
tree
so that it won't show up in the API documentation (if such documentation is
necessary).

I'd like to not have to edit this portion of my make file each time I add a
new package. I know this isn't much of a burden, but I still wonder if there
is a more elegant solution.

Thanks in advance,

Charles.




reply via email to

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