Fixed functionality for firm jni.
[libfirm] / firmjni / Makefile.in
1
2 # $Id$
3
4 top_srcdir := @top_srcdir@
5 srcdir = @srcdir@
6 topdir = ..
7 subdir = firmjni
8
9 # The library implementing the JNI methods.  This name is also
10 # known to the generator for the JNI interface and used in the
11 # static initializer.
12 LIBNAME = libfirmjni.so
13
14 # where to put libfirmjni.so
15 libdir = @libdir@
16 # where to put the directory firmjni containing the generated
17 # .java and .class files
18 #javadir = @javadir@         @@@ how to specify a dir in configure.in?
19
20 .PHONY: default all clean realclean depend
21
22 MEMBERS = Firm.m Firm.m Firm_common.m Dbginfo.m Ident.m Tv.m            \
23         Type.m Entity.m Type_or_entity.m Tpop.m Mangle.m                \
24         Irprog.m Irgraph.m Irnode.m Irmode.m Irop.m Ircons.m Ircgcons.m \
25         Irflag.m Irvrfy.m Irdump.m Iropt.m Irgopt.m Ircgopt.m           \
26         Irouts.m Irdom.m Irloop.m Cgana.m                               \
27         Irgmod.m Typegmod.m
28 # How to pass function pointers? Or how to obtain them?
29 #      Irgwalk.m Typewalk.m
30
31 OFILES  = $(MEMBERS:.m=.o)
32 HFILES  = $(MEMBERS:.m=.h)
33 CLASSFILES = $(MEMBERS:.m=.class)
34
35 CPPFLAGS =      -I$(top_srcdir)/ir/ir  -I$(top_srcdir)/ir/common        \
36                 -I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr          \
37                 -I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/debug          \
38                 -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/st @CPPFLAGS@
39
40 LDFLAGS += $(topdir)
41
42 all:    classfiles jni
43
44 # call the generator to make the implementation files
45 #impl:
46 #       -sh build_firm_jni
47
48 classfiles: $(CLASSFILES)
49
50 %.class: %.java
51         javac $<
52
53 %.h:    %.class
54         javah $(<:.class=)
55
56 %.o:    %.c %.h
57         gcc $(CPPFLAGS) -c $< -o $@
58
59 jni:    $(HFILES) $(OFILES)  # ../libfirm.a
60         gcc -shared -fPIC -o $(LIBNAME) *.o -lfirm -L..
61
62 install:
63         cp libfirmjni.so $(libdir)
64 #       mkdir $(javadir)
65 #       cp *.java @javadir@
66 #       cp *.class @javadir@
67
68 clean:
69         rm -rf sources *.c *.h *.o
70
71 realclean: clean
72         rm -f *~ libfirmjni.so *.vcg *.java *.class