e4b52adc3c68311299042f65c0aec9dec285a9fa
[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 libjvm_la_LDFLAGS += \
42         -Xlinker --version-script=$(top_srcdir)/contrib/mapfile-vers-product
43 endif
44
45 cacao_LDFLAGS += \
46         -export-dynamic
47
48 CACAO_LIBS =
49 else
50 noinst_LTLIBRARIES = \
51         libjvm.la
52
53 cacao_LDFLAGS += \
54         -export-dynamic
55
56 CACAO_LIBS = \
57         libjvm.la
58 endif
59
60 if ENABLE_RT_TIMING
61 cacao_LDFLAGS += -lrt
62 endif
63
64 if ENABLE_PYTHON
65 cacao_LDFLAGS += \
66     @PYTHON_LSPEC@
67 endif
68
69 libjvm_la_SOURCES =
70
71 # Dummy C++ source to cause C++ linking.
72 # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries
73 nodist_EXTRA_libjvm_la_SOURCES = \
74         dummy.cxx
75
76 libjvm_la_LIBADD = \
77         $(top_builddir)/src/fdlibm/libfdlibm.la \
78         $(top_builddir)/src/mm/libmm.la \
79         $(top_builddir)/src/native/libnative.la \
80         $(top_builddir)/src/threads/libthreads.la \
81         $(top_builddir)/src/toolbox/libtoolbox.la \
82         $(top_builddir)/src/vm/libvm.la \
83         $(GC_LIB)
84
85 bin_PROGRAMS = \
86         cacao
87
88 cacao_SOURCES = \
89         cacao.cpp
90
91 cacao_LDADD = \
92         $(CACAO_LIBS)
93
94 cacao_DEPENDENCIES = \
95         $(cacao_LDADD)
96
97
98 if WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
99 install-data-local:
100         $(mkdir_p) $(prefix)/jre/lib/$(JAVA_ARCH)/server
101         $(LN_S) -f $(libdir)/libjvm.so $(prefix)/jre/lib/$(JAVA_ARCH)/server
102         $(ECHO) $(ECHO_N) > $(prefix)/jre/lib/$(JAVA_ARCH)/server/Xusage.txt
103         $(ECHO) $(ECHO_N) > $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjsig.so
104
105 uninstall-local:
106         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjvm.so
107         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/Xusage.txt
108         rm -f $(prefix)/jre/lib/$(JAVA_ARCH)/server/libjsig.so
109 endif
110
111
112 ## Local variables:
113 ## mode: Makefile
114 ## indent-tabs-mode: t
115 ## c-basic-offset: 4
116 ## tab-width: 8
117 ## compile-command: "automake --add-missing"
118 ## End: