0N/A#
3208N/A# Copyright (c) 2002, 2012, Oracle and/or its affiliates. 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#
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A# or visit www.oracle.com if you need additional information or have any
1472N/A# questions.
0N/A#
0N/A#
0N/A
0N/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 )
0N/AGCC = gcc
0N/A
0N/AJAVAH = ${JAVA_HOME}/bin/javah
0N/A
0N/ASOURCES = salibelf.c \
0N/A symtab.c \
0N/A libproc_impl.c \
0N/A ps_proc.c \
0N/A ps_core.c \
0N/A LinuxDebuggerLocal.c
0N/A
0N/AINCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux
0N/A
0N/AOBJS = $(SOURCES:.c=.o)
0N/A
0N/ALIBS = -lthread_db
0N/A
3208N/ACFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -D_FILE_OFFSET_BITS=64
0N/A
0N/ALIBSA = $(ARCH)/libsaproc.so
0N/A
0N/Aall: $(LIBSA)
0N/A
0N/ALinuxDebuggerLocal.o: LinuxDebuggerLocal.c
0N/A $(JAVAH) -jni -classpath ../../../build/classes \
0N/A sun.jvm.hotspot.debugger.x86.X86ThreadContext \
0N/A sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \
0N/A sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
0N/A $(GCC) $(CFLAGS) $<
0N/A
0N/A.c.obj:
0N/A $(GCC) $(CFLAGS)
0N/A
0N/Aifndef LDNOMAP
0N/A LFLAGS_LIBSA = -Xlinker --version-script=mapfile
0N/Aendif
0N/A
754N/A# If this is a --hash-style=gnu system, use --hash-style=both
754N/A# The gnu .hash section won't work on some Linux systems like SuSE 10.
754N/A_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu')
754N/Aifneq ($(_HAS_HASH_STYLE_GNU),)
754N/A LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
754N/Aendif
754N/ALFLAGS_LIBSA += $(LDFLAGS_HASH_STYLE)
754N/A
0N/A$(LIBSA): $(OBJS) mapfile
0N/A if [ ! -d $(ARCH) ] ; then mkdir $(ARCH) ; fi
0N/A $(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS)
0N/A
0N/Atest.o: test.c
0N/A $(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c
0N/A
0N/Atest: test.o
0N/A $(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS)
0N/A
0N/Aclean:
0N/A rm -rf $(LIBSA)
0N/A rm -rf $(OBJS)
0N/A rmdir $(ARCH)
0N/A