2046N/A#
2046N/A# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
2046N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2046N/A#
2046N/A# This code is free software; you can redistribute it and/or modify it
2046N/A# under the terms of the GNU General Public License version 2 only, as
2046N/A# published by the Free Software Foundation.
2046N/A#
2046N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2046N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2046N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2046N/A# version 2 for more details (a copy is included in the LICENSE file that
2046N/A# accompanied this code).
2046N/A#
2046N/A# You should have received a copy of the GNU General Public License version
2046N/A# 2 along with this work; if not, write to the Free Software Foundation,
2046N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2046N/A#
2046N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2046N/A# or visit www.oracle.com if you need additional information or have any
2046N/A# questions.
2046N/A#
2046N/A#
2046N/A
3339N/AARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
2046N/AGCC = gcc
2046N/A
2046N/AJAVAH = ${JAVA_HOME}/bin/javah
2046N/A
2046N/ASOURCES = salibelf.c \
3339N/A symtab.c \
3339N/A libproc_impl.c \
2046N/A ps_proc.c \
3234N/A ps_core.c \
3234N/A LinuxDebuggerLocal.c
2046N/A
2046N/AINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux
2046N/A
2147N/AOBJS = $(SOURCES:.c=.o)
2085N/A
2223N/ALIBS = -lthread_db
2046N/A
2046N/ACFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -D_FILE_OFFSET_BITS=64
2046N/A
2046N/ALIBSA = $(ARCH)/libsaproc.so
2046N/A
2046N/Aall: $(LIBSA)
2046N/A
2046N/ALinuxDebuggerLocal.o: LinuxDebuggerLocal.c
3339N/A $(JAVAH) -jni -classpath ../../../build/classes \
3339N/A sun.jvm.hotspot.debugger.x86.X86ThreadContext \
3339N/A sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \
2434N/A sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
2434N/A $(GCC) $(CFLAGS) $<
2434N/A
2434N/A.c.obj:
3234N/A $(GCC) $(CFLAGS)
2434N/A
2046N/Aifndef LDNOMAP
2046N/A LFLAGS_LIBSA = -Xlinker --version-script=mapfile
2046N/Aendif
2434N/A
2434N/A# If this is a --hash-style=gnu system, use --hash-style=both
2434N/A# The gnu .hash section won't work on some Linux systems like SuSE 10.
2434N/A_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu')
2434N/Aifneq ($(_HAS_HASH_STYLE_GNU),)
3234N/A LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
3171N/Aendif
2434N/ALFLAGS_LIBSA += $(LDFLAGS_HASH_STYLE)
3158N/A
3158N/A$(LIBSA): $(OBJS) mapfile
2434N/A if [ ! -d $(ARCH) ] ; then mkdir $(ARCH) ; fi
3339N/A $(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS)
3339N/A
3339N/Atest.o: test.c
3339N/A $(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c
3339N/A
3339N/Atest: test.o
3339N/A $(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS)
3339N/A
2434N/Aclean:
3339N/A rm -rf $(LIBSA)
3339N/A rm -rf $(OBJS)
3339N/A rmdir $(ARCH)
3339N/A
3339N/A