Makefile revision 0
0N/A#
0N/A# Copyright 2002-2006 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/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
0N/ACFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES)
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
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