1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
include ../Makefile.config
OCAMLC=ocamlc -g
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
OCAMLLIB=`ocamlc -where`
CAMLJAVALIB=$(OCAMLLIB)/camljava
all: jni.cma jni.cmxa camljava.jar
byte: jni.cma camljava.jar
install:
mkdir -p $(CAMLJAVALIB)
cp jni.cma jni.cmi $(wildcard jni.cmxa jni.a) libcamljni.a jni.mli camljava.jar $(CAMLJAVALIB)
jni.cma: jni.cmo libcamljni.a
$(OCAMLC) -linkall -a -o jni.cma jni.cmo \
-ccopt "$(JNILIBOPTS)" -cclib -lcamljni -cclib "$(JNILIBS)"
jni.cmxa: jni.cmx libcamljni.a
$(OCAMLOPT) -linkall -a -o jni.cmxa jni.cmx \
-ccopt "$(JNILIBOPTS)" -cclib -lcamljni -cclib "$(JNILIBS)"
libcamljni.a: jnistubs.o
rm -f libcamljni.a
ar rcs libcamljni.a jnistubs.o
clean::
rm -f libcamljni.a
jni.ml: jni.mlp jni.mli ../Makefile.config
rm -f jni.ml
sed -e 's|%PATH%|'$(CAMLJAVALIB)/camljava.jar'|' \
jni.mlp > jni.ml
chmod -w jni.ml
clean::
rm -f jni.ml
beforedepend:: jni.ml
camljava.jar: javaclasses
jar cf camljava.jar fr/inria/caml/camljava/*.class
clean::
rm -f camljava.jar
javaclasses:
$(JAVAC) fr/inria/caml/camljava/*.java
clean::
rm -f fr/inria/caml/camljava/*.class
clean::
rm -f *.cm? *.[oa] *.cmxa
.SUFFIXES: .ml .mli .cmo .cmi .cmx
.c.o:
$(CC) -c $(CFLAGS) $(JNIINCLUDES) -I$(OCAMLLIB) $*.c
.ml.cmo:
$(OCAMLC) -c $*.ml
.ml.cmx:
$(OCAMLOPT) -c $*.ml
.mli.cmi:
$(OCAMLC) -c $*.mli
depend: beforedepend
$(OCAMLDEP) *.mli *.ml > .depend
include .depend
|