2362N/A# Copyright (c) 2010, Oracle
and/or its affiliates. All rights reserved.
2106N/A# Redistribution and use in source and binary forms, with or without
2106N/A# modification, are permitted provided that the following conditions
2106N/A# - Redistributions of source code must retain the above copyright
2106N/A# notice, this list of conditions and the following disclaimer.
2106N/A# - Redistributions in binary form must reproduce the above copyright
2106N/A# notice, this list of conditions and the following disclaimer in the
2106N/A# documentation
and/or other materials provided with the distribution.
2362N/A# - Neither the name of Oracle nor the names of its
2106N/A# contributors may be used to endorse or promote products derived
2106N/A# from this software without specific prior written permission.
2106N/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
2106N/A# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
2106N/A# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2106N/A# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
2106N/A# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2106N/A# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2106N/A# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
2106N/A# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
2106N/A# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
2106N/A# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2106N/A# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2106N/A########################################################################
2106N/A# Sample GNU Makefile for building JVMTI Demo compiledMethodLoad
2106N/A# gnumake JDK=<java_home> OSNAME=solaris [OPT=true] [LIBARCH=sparc]
2106N/A# gnumake JDK=<java_home> OSNAME=solaris [OPT=true] [LIBARCH=sparcv9]
2106N/A# gnumake JDK=<java_home> OSNAME=linux [OPT=true]
2106N/A# gnumake JDK=<java_home> OSNAME=win32 [OPT=true]
2106N/A########################################################################
2106N/A# Solaris Sun C Compiler Version 5.5
2106N/A # Sun Solaris Compiler options needed
2106N/A # Options that help find errors
2106N/A COMMON_FLAGS+= -Xa -v -xstrconst -xc99=%none
2106N/A # Check LIBARCH for any special compiler options
2106N/A COMMON_FLAGS+=-xarch=v8 -xregs=no%appl
2106N/A COMMON_FLAGS+=-xarch=v9 -xregs=no%appl
2106N/A CFLAGS=-xO2 $(COMMON_FLAGS)
2106N/A # Object files needed to create library
2106N/A # Library name and options needed to build it
2106N/A # Libraries we are dependent on
2106N/A # Building a shared library
2106N/A # GNU Compiler options needed to build it
2106N/A COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer
2106N/A # Options that help find errors
2106N/A COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses
2106N/A # Object files needed to create library
2106N/A # Library name and options needed to build it
5029N/A LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc
2106N/A # Libraries we are dependent on
2106N/A # Building a shared library
2106N/A# Windows Microsoft C/C++ Optimizing Compiler Version 12
2106N/A # Compiler options needed to build it
2106N/A # Options that help find errors
2106N/A CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS)
2106N/A CFLAGS= -Od -Zi $(COMMON_FLAGS)
2106N/A # Object files needed to create library
2106N/A OBJECTS=$(SOURCES:%.c=%.obj)
2106N/A # Library name and options needed to build it
2106N/A # Libraries we are dependent on
2106N/A # Building a shared library
2106N/A LINK_SHARED=link -dll -out:$@
2106N/ACFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME)
2106N/A $(LINK_SHARED) $(OBJECTS) $(LIBRARIES)
2106N/A rm -f $(LIBRARY) $(OBJECTS)
2106N/A# Compilation rule only needed on Windows