4 top_srcdir := @top_srcdir@
9 # The library implementing the JNI methods. This name is also
10 # known to the generator for the JNI interface and used in the
12 LIBNAME = libfirmjni.so
14 # The name of the package containing the Firm JNI
17 # where to put libfirmjni.so
19 # where to put the directory firmjni containing the generated
20 # .java and .class files
21 #javadir = @javadir@ @@@ how to specify a dir in configure.in?
23 .PHONY: default all clean realclean depend
25 MEMBERS = Firm.m Firm.m Firm_common.m Dbginfo.m Ident.m Tv.m \
26 Type.m Entity.m Type_or_entity.m Tpop.m Mangle.m \
27 Irprog.m Irgraph.m Irnode.m Irmode.m Irop.m Ircons.m Ircgcons.m \
28 Irflag.m Irvrfy.m Irdump.m Iropt.m Irgopt.m Ircgopt.m \
29 Irouts.m Irdom.m Irloop.m Cgana.m \
31 # How to pass function pointers? Or how to obtain them?
32 # Irgwalk.m Typewalk.m
34 OFILES = $(MEMBERS:.m=.o)
35 HFILES = $(MEMBERS:.m=.h)
36 CLASSFILES = $(MEMBERS:.m=.class)
38 CPPFLAGS = -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \
39 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr \
40 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/debug \
41 -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st @CPPFLAGS@
47 # call the generator to make the implementation files
51 classfiles: $(CLASSFILES)
57 javah -classpath $(topdir) -o $(<:.class=.h) $(PACKAGENAME).$(<:.class=)
60 gcc $(CPPFLAGS) -c $< -o $@
62 jni: $(HFILES) $(OFILES) # ../libfirm.a
63 gcc -shared -fPIC -o $(LIBNAME) *.o -lfirm -L..
66 cp libfirmjni.so $(libdir)
69 # cp *.class @javadir@
72 rm -rf sources *.c *.h *.o
75 rm -f *~ libfirmjni.so *.vcg *.java *.class