1
|
1 |
#
|
|
2 |
# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
#
|
|
5 |
# This code is free software; you can redistribute it and/or modify it
|
|
6 |
# under the terms of the GNU General Public License version 2 only, as
|
|
7 |
# published by the Free Software Foundation.
|
|
8 |
#
|
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
# accompanied this code).
|
|
14 |
#
|
|
15 |
# You should have received a copy of the GNU General Public License version
|
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
#
|
|
19 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
20 |
# CA 95054 USA or visit www.sun.com if you need additional information or
|
|
21 |
# have any questions.
|
|
22 |
#
|
|
23 |
#
|
|
24 |
|
|
25 |
# Rules to build serviceability agent library, used by vm.make
|
|
26 |
|
|
27 |
# libsaproc[_g].so: serviceability agent
|
|
28 |
SAPROC = saproc$(G_SUFFIX)
|
|
29 |
LIBSAPROC = lib$(SAPROC).so
|
|
30 |
|
|
31 |
AGENT_DIR = $(GAMMADIR)/agent
|
|
32 |
|
|
33 |
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc
|
|
34 |
|
|
35 |
SASRCFILES = $(SASRCDIR)/saproc.cpp
|
|
36 |
|
|
37 |
SAMAPFILE = $(SASRCDIR)/mapfile
|
|
38 |
|
|
39 |
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
|
|
40 |
|
|
41 |
# if $(AGENT_DIR) does not exist, we don't build SA
|
|
42 |
|
|
43 |
checkAndBuildSA:
|
|
44 |
$(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \
|
|
45 |
$(MAKE) -f vm.make $(LIBSAPROC); \
|
|
46 |
fi
|
|
47 |
|
|
48 |
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
|
|
49 |
|
|
50 |
ifdef USE_GCC
|
|
51 |
SA_LFLAGS += -D_REENTRANT
|
|
52 |
else
|
|
53 |
SA_LFLAGS += -mt -xnolib -norunpath
|
|
54 |
endif
|
|
55 |
|
|
56 |
$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
|
|
57 |
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
|
|
58 |
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
|
|
59 |
exit 1; \
|
|
60 |
fi
|
|
61 |
@echo Making SA debugger back-end...
|
|
62 |
$(QUIETLY) $(CPP) \
|
|
63 |
$(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
|
|
64 |
-I$(SASRCDIR) \
|
|
65 |
-I$(GENERATED) \
|
|
66 |
-I$(BOOT_JAVA_HOME)/include \
|
|
67 |
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
|
|
68 |
$(SASRCFILES) \
|
|
69 |
$(SA_LFLAGS) \
|
|
70 |
-o $@ \
|
|
71 |
-ldl -ldemangle -lthread -lc
|
|
72 |
|
|
73 |
install_saproc: checkAndBuildSA
|
|
74 |
$(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \
|
|
75 |
echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
|
|
76 |
cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
|
|
77 |
fi
|
|
78 |
|
|
79 |
.PHONY: checkAndBuildSA install_saproc
|