Makefile: let testfiles be a dependency for the tests target
authorBernhard Urban <lewurm@gmail.com>
Tue, 12 Jun 2012 10:32:42 +0000 (12:32 +0200)
committerBernhard Urban <lewurm@gmail.com>
Tue, 12 Jun 2012 19:50:20 +0000 (21:50 +0200)
- just compile java files needed for executing mate (e.g. java/* stuff)
- also satisify a dependency with a wrong classfile as we test something
  different here (see ClassPath3.*). yes, it's a hack, as our "test framework"
  isn't really mature :-)

Makefile
tests/ClassPath3.compile

index 8d91b35f111b9ad407a29e6886a1dfa27fdc83b4..41d3ee547766e9857e2ab4b01edd63a120bdbb9d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 SHELL := bash
 
 JAVAC := javac
-JAVA_FILES := $(wildcard tests/*.java java/lang/*.java java/io/*.java)
+JAVA_FILES := $(wildcard java/lang/*.java java/io/*.java)
 CLASS_FILES := $(JAVA_FILES:.java=.class)
 TEST_JAVA_FILES := $(wildcard tests/*.java)
 TEST_CLASS_FILES := $(TEST_JAVA_FILES:.java=.test)
@@ -17,13 +17,13 @@ GHC_LD := -optl-Xlinker -optl-x
 
 .PHONY: all test clean ghci
 
-all: mate $(CLASS_FILES)
+all: mate
 
 %: %.class mate
        ./mate $(basename $<)
 
 
-tests: mate $(TEST_CLASS_FILES)
+tests: mate $(TEST_JAVA_FILES:.java=.class) $(TEST_CLASS_FILES)
 
 CALLF = $(basename $@).call
 testcase = ./tools/openjdktest.sh "$(1) $(basename $@)"
@@ -42,7 +42,7 @@ COMPILEF = $(basename $@).compile
 ffi/native.o: ffi/native.c
        ghc -Wall -O2 -c $< -o $@
 
-mate: Mate.hs ffi/trap.c $(HS_FILES) $(HS_BOOT) ffi/native.o
+mate: Mate.hs ffi/trap.c $(HS_FILES) $(HS_BOOT) ffi/native.o $(CLASS_FILES)
        @mkdir -p build/release
        ghc --make $(GHC_OPT) Mate.hs ffi/trap.c -o $@ $(GHC_LD) -outputdir build/release
 
index 2498b45aa08625be32785494ed94d80b5b1ba73e..9cca39e5a38ce1115bb32690288e9fbc285b002b 100644 (file)
@@ -1 +1,3 @@
 javac tests/this/is/a/class/path/test/ClassPath2.java
+# and make `make' happy by providing a class file at a proper place:
+cp tests/this/is/a/class/path/test/ClassPath2.class tests/ClassPath3.class