hi,
I'm putting together a makefile to build a set of packages for a backend
java API. there are just shy of 1200 source (.java) files and with the
makefile I have so far, make recompiles all of them everytime I run
make. this is not quite what I had in mind, as a complete build takes
about 20 minutes. I've tried setting the VPATH variable and also the
vpath directive (not at the same time), but with no luck. here are some
relavant bits from my makefile:
#####
# set vpath to look for class files in all of the package directories
# and subdirectories where the compiled classes should end up. I
suspect
# this might be where my mistake is, but I'm not entirely clear on how
# vpath helps out with figuring out if a target is out of date.
vpath %.class $(COLON_DELIMITED_LIST_OF_PACKAGE_DIRECTORIES)
default: src
# I create the list of class files by getting a list of all my java
source
# files and then using patsubst to swap .class in for .java in each list
element
src: $(LIST_OF_CLASS_FILES_TO_MAKE)
# here's the rule I've defined for building class files from java files
%.class : %.java
$(JAVAC) $(JFLAGS) $<
#
#####
the commands to the java compiler tell it to put the compiled class
files into the directory that I've set vpath to look in. from me
reading, I was under the impression that if a target, say x.class, was
found in the vpath search directory and it's mod date was later than the
prerequisite, say x.java, that x.java would not be recompiled. where am
I going wrong here?
many thanks,
e