diff --git a/java/Makefile b/java/Makefile index 4096d9039..d3676a403 100644 --- a/java/Makefile +++ b/java/Makefile @@ -1220,8 +1220,8 @@ check-serialize: .PHONY: junit junit: daikon/Daikon.class - @# This is not a prerequisite, so that "make -j" does not run it concurrently - @# with compiling Daikon, whose classes the SplitterFactoryTest rules use. + @# This is not a prerequisite: when the daikon/Daikon.class recipe runs, its + @# sub-make builds SplitterFactoryTest, and this make would redo that work. ${MAKE} ${AUTO_GENERATED_CLASSES_2} @echo "Running unit (not system) tests..." LC_ALL=en_US.UTF-8 ${JAVA_COMMAND} org.junit.runner.JUnitCore daikon.test.AllTestsSuite @@ -1468,8 +1468,9 @@ list_java_files: showvar_JAVA_FILES ### Automatically generated files ### -# This must NOT depend on "daikon/Daikon.class", as that would lead to infinite regress. -daikon/test/split/SplitterFactoryTestUpdater.class: daikon/test/split/SplitterFactoryTestUpdater.java +# The updater uses Daikon's classes, so it must be compiled after Daikon; this order-only +# prerequisite also orders the SplitterFactoryTest rules after Daikon, even under "make -j". +daikon/test/split/SplitterFactoryTestUpdater.class: daikon/test/split/SplitterFactoryTestUpdater.java | daikon/Daikon.class ${JAVAC_COMMAND} $< ## First, a file not generated via java-cpp. @@ -1488,7 +1489,8 @@ daikon/test/split/SplitterFactoryTest.java: daikon/Daikon.class \ || ${JAVA_COMMAND} daikon.test.split.SplitterFactoryTestUpdater ${SPLITTER_UPDATER_ARGS} chmod a-w $@ -${AUTO_GENERATED_CLASSES_2}: ${AUTO_GENERATED_FILES_2} +# SplitterFactoryTest calls Daikon's methods, so recompile it when Daikon changes. +${AUTO_GENERATED_CLASSES_2}: ${AUTO_GENERATED_FILES_2} daikon/Daikon.class ${JAVAC_COMMAND} ${AUTO_GENERATED_FILES_2} # Overwrites SplitterFactoryTest's goal files with the current SplitterFactory output.