make-alpha
[Top][All Lists]
Advanced

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

Re: GNU Make enhansment patch - batching compiles


From: Paul D. Smith
Subject: Re: GNU Make enhansment patch - batching compiles
Date: Thu, 3 May 2001 12:44:15 -0400

I'm redirecting this because it doesn't belong on the devel list.

%% Eli Zaretskii <address@hidden> writes:

  ez> I thought about this, but with a twist: the "%.class : %.java" rules add 
  ez> file names to a file which will eventually look like this:

  ez>    FILES_TO_COMPILE = \
  ez>    foo.java \
  ez>    bar.java \
  ez>    baz.java \

  ez> and then in the Makefile you say

  ez> include files_list

  ez> all:
  ez>   compile -c $(FILES_TO_COMPILE)

  ez> Doesn't this do what is needed?

You left out one crucial rule: how is files_list built?  In the scenario
you specify above there _must_ be a rule like this:

  files_list: $(OBJECTS)

but this makes actually writing the %.class : %.java rule very
difficult, at best... mainly because there's no good way to know when
you are building the first one of the objects, and you have to know
that.


Another way to go would be something like:

  files_list: $(SOURCES)
        @echo 'FILES_TO_COMPILE = $?' > $@

Note that this changes the makefile to build everything that is newer
than the files_list file, _NOT_ everything that is newer than its
corresponding .class (.o).  I think this is an important, and probably
undesirable, distinction.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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