help-make
[Top][All Lists]
Advanced

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

Compiling multiple sources at once


From: Ray Ontko
Subject: Compiling multiple sources at once
Date: Fri, 31 Aug 2001 11:28:46 -0500 (EST)

Howdy,

I'm stumped.  I've been using make for about 10 years, and I found
something that I just can't figure out how to do.

The basic problem is this: It's much faster to compile many java
(or c) programs at once than it is to compile each separately.
What I want to do is compile all files that are out of date at once.

My Makefile looks something like this:

%.class : %.java
        javac $@

JAVA_FILES = a.java b.java c.java

CLASS_FILES = $(JAVA_FILES:.java=.class)

all : $(CLASS_FILES)

What happens:

  javac a.java
  javac b.java
  javac c.java

What I want to have happen:

  javac a.java b.java c.java

When I do a "make all", I want the a _single_ javac command to be 
executed, but only for those .class files which are out of date
with respect to their .java files.  It takes about 10 times as
long to do a separate javac for each file as it does to do a 
javac for all files.

Has anyone got a clever solution that allows multiple targets
to be coallesced into a single implicit rule?  Are there other
work-arounds?

Ray
----------------------------------------------------------------------
Ray Ontko   address@hidden   Phone 1.765.935.4283   Fax 1.765.962.9788
Ray Ontko & Co.   Software Consulting Services   http://www.ontko.com/



reply via email to

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