saproc.make revision 844
0N/A#
844N/A# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
0N/A# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A# CA 95054 USA or visit www.sun.com if you need additional information or
0N/A# have any questions.
0N/A#
0N/A#
0N/A
0N/A# Rules to build serviceability agent library, used by vm.make
0N/A
0N/A# libsaproc[_g].so: serviceability agent
0N/ASAPROC = saproc$(G_SUFFIX)
0N/ALIBSAPROC = lib$(SAPROC).so
0N/A
0N/AAGENT_DIR = $(GAMMADIR)/agent
0N/A
0N/ASASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
0N/A
0N/ASASRCFILES = $(SASRCDIR)/salibelf.c \
0N/A $(SASRCDIR)/symtab.c \
0N/A $(SASRCDIR)/libproc_impl.c \
0N/A $(SASRCDIR)/ps_proc.c \
0N/A $(SASRCDIR)/ps_core.c \
0N/A $(SASRCDIR)/LinuxDebuggerLocal.c
0N/A
0N/ASAMAPFILE = $(SASRCDIR)/mapfile
0N/A
0N/ADEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
0N/A
767N/A# DEBUG_BINARIES overrides everything, use full -g debug information
767N/Aifeq ($(DEBUG_BINARIES), true)
767N/A SA_DEBUG_CFLAGS = -g
767N/Aendif
767N/A
0N/A# if $(AGENT_DIR) does not exist, we don't build SA
0N/A# also, we don't build SA on Itanium.
0N/A
0N/AcheckAndBuildSA:
0N/A $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \
0N/A $(MAKE) -f vm.make $(LIBSAPROC); \
0N/A fi
0N/A
757N/ASA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
0N/A
0N/A$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
0N/A $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
0N/A echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
0N/A exit 1; \
0N/A fi
0N/A @echo Making SA debugger back-end...
0N/A $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
0N/A $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
0N/A -I$(SASRCDIR) \
0N/A -I$(GENERATED) \
0N/A -I$(BOOT_JAVA_HOME)/include \
0N/A -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
0N/A $(SASRCFILES) \
0N/A $(SA_LFLAGS) \
767N/A $(SA_DEBUG_CFLAGS) \
0N/A -o $@ \
0N/A -lthread_db
0N/A
0N/Ainstall_saproc: checkAndBuildSA
0N/A $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
0N/A echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
0N/A cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
0N/A fi
0N/A
0N/A.PHONY: checkAndBuildSA install_saproc