Fixed function implemenation type
[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 # The name of the package containing the Firm JNI
15 PACKAGENAME = firmjni
16
17 # where to put libfirmjni.so
18 libdir = @libdir@
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?
22
23 .PHONY: default all clean realclean depend
24
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                               \
30         Irgmod.m Typegmod.m
31 # How to pass function pointers? Or how to obtain them?
32 #      Irgwalk.m Typewalk.m
33
34 OFILES  = $(MEMBERS:.m=.o)
35 HFILES  = $(MEMBERS:.m=.h)
36 CLASSFILES = $(MEMBERS:.m=.class)
37
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@
42
43 LDFLAGS += $(topdir)
44
45 all:    classfiles jni
46
47 # call the generator to make the implementation files
48 #impl:
49 #       -sh build_firm_jni
50
51 classfiles: $(CLASSFILES)
52
53 %.class: %.java
54         javac $<
55
56 %.h:    %.class
57         javah -classpath $(topdir) -o $(<:.class=.h) $(PACKAGENAME).$(<:.class=)
58
59 %.o:    %.c %.h
60         gcc $(CPPFLAGS) -c $< -o $@
61
62 jni:    $(HFILES) $(OFILES)  # ../libfirm.a
63         gcc -shared -fPIC -o $(LIBNAME) *.o -lfirm -L..
64
65 install:
66         cp libfirmjni.so $(libdir)
67 #       mkdir $(javadir)
68 #       cp *.java @javadir@
69 #       cp *.class @javadir@
70
71 clean:
72         rm -rf sources *.c *.h *.o
73
74 realclean: clean
75         rm -f *~ libfirmjni.so *.vcg *.java *.class