experiments with JNI;
[mate.git] / Makefile
index 6dececa0d35ad99eafa605a74e38a10a24731275..04685026df52dccae37e8038c26ef96ad9c5c21a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ PACKAGES := $(addprefix -package ,$(PACKAGES_))
 # use `cpphs'
 GHC_CPP := -cpp -pgmP cpphs -optP --cpp
 
-GHC_OPT  = -I. -O0 -Wall -fno-warn-unused-do-bind
+GHC_OPT  = -I. -O0 -Wall -fno-warn-unused-do-bind -fwarn-tabs
 # see *.gdb target. also useful for profiling (-p at call)
 GHC_OPT += -rtsopts # -prof -auto-all
 GHC_OPT += $(GHC_CPP)
@@ -54,6 +54,11 @@ COMPILEF = $(basename $@).compile
 ffi/native.o: ffi/native.c
        ghc -Wall -O2 -c $< -o $@
 
+runtime: jmate/lang/MateRuntime.java
+       javac jmate/lang/MateRuntime.java
+       javah  -o rts/mock/jmate_lang_MateRuntime.h jmate.lang.MateRuntime
+       gcc -shared -fPIC -I$(JAVA_HOME)/include rts/mock/jmate_lang_MateRuntime.c -I./rts/mock -o rts/mock/libMateRuntime.so 
+
 GHCCALL = ghc --make $(GHC_OPT) Mate.hs ffi/trap.c -o $@ $(GHC_LD) -outputdir
 mate: Mate.hs ffi/trap.c $(HS_FILES) $(HS_BOOT) ffi/native.o $(CLASS_FILES)
        @mkdir -p $(B_RELEASE)
@@ -74,13 +79,13 @@ DEBUGFLAGS = -DDBG_JIT -DDBG_MP
 else
 DEBUGFLAGS = ${DBGFLAGS}
 endif
-mate.dbg: Mate.hs ffi/trap.c $(HS_FILES) $(HS_BOOT) ffi/native.o
+mate.dbg: Mate.hs ffi/trap.c $(HS_FILES) $(HS_BOOT) ffi/native.o $(CLASS_FILES)
        @mkdir -p $(B_DEBUG)/{ffi,Mate,}
        gcc -Wall $(DEBUGFLAGS) -O0 -c ffi/trap.c -o $(B_DEBUG)/ffi/trap.o
        ghc --make $(DEBUGFLAGS) $(GHC_OPT) Mate.hs $(B_DEBUG)/ffi/trap.o -o $@ $(GHC_LD) -outputdir $(B_DEBUG)
 
 clean:
-       rm -rf $(BUILD) mate mate.static mate.dbg tags ffi/native.o \
+       rm -rf $(BUILD) mate mate.static mate.dbg ffi/native.o \
                tests/*.class Mate/*_stub.* \
                jmate/lang/*.class jmate/io/*.class java/io/*.class \
                java/lang/{Integer,Character,String,System}.class