0f59f3228b95e4d90472c359f992b8cae152cd2a
[cacao.git] / src / cacao / Makefile.am
1 ## src/cacao/Makefile.am
2 ##
3 ## Copyright (C) 1996-2005, 2006, 2007, 2008
4 ## CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5 ##
6 ## This file is part of CACAO.
7 ##
8 ## This program is free software; you can redistribute it and/or
9 ## modify it under the terms of the GNU General Public License as
10 ## published by the Free Software Foundation; either version 2, or (at
11 ## your option) any later version.
12 ##
13 ## This program is distributed in the hope that it will be useful, but
14 ## WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 ## General Public License for more details.
17 ##
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program; if not, write to the Free Software
20 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 ## 02110-1301, USA.
22
23
24 AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR)
25
26 if ENABLE_STATICVM
27 cacao_LDFLAGS = \
28         -all-static
29 else
30 cacao_LDFLAGS =
31 endif
32
33 if ENABLE_LIBJVM
34 lib_LTLIBRARIES = \
35         libjvm.la
36
37 libjvm_la_LDFLAGS = \
38         -avoid-version
39
40 if WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
41 if WITH_GNU_LD
42 libjvm_la_LDFLAGS += \
43         -Xlinker --version-script=$(top_srcdir)/contrib/mapfile-vers-product
44 else
45 # This is for the Solaris LD.
46 libjvm_la_LDFLAGS += \
47         -Xlinker -M$(top_srcdir)/contrib/mapfile-vers-product
48 endif
49 endif
50
51 cacao_LDFLAGS += \
52         -export-dynamic
53
54 CACAO_LIBS =
55 else
56 noinst_LTLIBRARIES = \
57         libjvm.la
58
59 cacao_LDFLAGS += \
60         -export-dynamic
61
62 CACAO_LIBS = \
63         libjvm.la
64 endif
65
66 if ENABLE_RT_TIMING
67 cacao_LDFLAGS += -lrt
68 endif
69
70 if ENABLE_PYTHON
71 cacao_LDFLAGS += \
72     @PYTHON_LSPEC@
73 endif
74
75 libjvm_la_SOURCES =
76
77 # Dummy C++ source to cause C++ linking.
78 # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries
79 nodist_EXTRA_libjvm_la_SOURCES = \
80         dummy.cxx
81
82 libjvm_la_LIBADD = \
83         $(top_builddir)/src/fdlibm/libfdlibm.la \
84         $(top_builddir)/src/mm/libmm.la \
85         $(top_builddir)/src/native/libnative.la \
86         $(top_builddir)/src/threads/libthreads.la \
87         $(top_builddir)/src/toolbox/libtoolbox.la \
88         $(top_builddir)/src/vm/libvm.la \
89         $(GC_LIB)
90
91 bin_PROGRAMS = \
92         cacao
93
94 cacao_SOURCES = \
95         cacao.cpp
96
97 cacao_LDADD = \
98         $(CACAO_LIBS)
99
100 cacao_DEPENDENCIES = \
101         $(cacao_LDADD)
102
103
104 if WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
105 install-data-local:
106         $(mkdir_p) $(prefix)/jre/lib/$(JAVA_ARCH)/server
107         $(LN_S) -f $(libdir)/libjvm.so $(prefix)/jre/lib/$(JAVA_ARCH)/server
108         $(ECHO) $(ECHO_N) > $(prefix)/jre/lib/$(JAVA_ARCH)/server/Xusage.txt
109         $(ECHO) $(ECHO_N) > $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjsig.so
110
111 uninstall-local:
112         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjvm.so
113         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/Xusage.txt
114         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjsig.so
115 endif
116
117
118 ## Local variables:
119 ## mode: Makefile
120 ## indent-tabs-mode: t
121 ## c-basic-offset: 4
122 ## tab-width: 8
123 ## compile-command: "automake --add-missing"
124 ## End: