jdk/make/java/instrument/Makefile
changeset 2 90ce3da70b43
child 4111 ffc9c33335f4
equal deleted inserted replaced
0:fd16c54261b3 2:90ce3da70b43
       
     1 #
       
     2 # Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
       
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4 #
       
     5 # This code is free software; you can redistribute it and/or modify it
       
     6 # under the terms of the GNU General Public License version 2 only, as
       
     7 # published by the Free Software Foundation.  Sun designates this
       
     8 # particular file as subject to the "Classpath" exception as provided
       
     9 # by Sun in the LICENSE file that accompanied this code.
       
    10 #
       
    11 # This code is distributed in the hope that it will be useful, but WITHOUT
       
    12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14 # version 2 for more details (a copy is included in the LICENSE file that
       
    15 # accompanied this code).
       
    16 #
       
    17 # You should have received a copy of the GNU General Public License version
       
    18 # 2 along with this work; if not, write to the Free Software Foundation,
       
    19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20 #
       
    21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
       
    23 # have any questions.
       
    24 #
       
    25 
       
    26 # Makefile for building the Java Programming Language Instrumentation Services
       
    27 # agent, supporting java.lang.instrument
       
    28 
       
    29 BUILDDIR = ../..
       
    30 PACKAGE = sun.instrument
       
    31 LIBRARY = instrument
       
    32 PRODUCT = sun
       
    33 
       
    34 # Configure the CFLAGS for this library.  Use static binding so that there
       
    35 # are not dependencies on modules not on the search patch when invoked from
       
    36 # the Windows system directory (or elsewhere).
       
    37 MS_RUNTIME_STATIC=true
       
    38 
       
    39 FILES_m = mapfile-vers
       
    40 
       
    41 include $(BUILDDIR)/common/Defs.gmk
       
    42 
       
    43 # Use the mapfile-vers (See the mapfile located with this Makefile)
       
    44 ifdef FILES_m
       
    45 include $(BUILDDIR)/common/Mapfile-vers.gmk
       
    46 endif
       
    47 
       
    48 #
       
    49 # Files to compile.
       
    50 #
       
    51 FILES_c = \
       
    52 	EncodingSupport.c \
       
    53 	EncodingSupport_md.c \
       
    54 	FileSystemSupport_md.c \
       
    55 	InstrumentationImplNativeMethods.c \
       
    56 	InvocationAdapter.c \
       
    57 	JarFacade.c \
       
    58 	JPLISAgent.c \
       
    59 	JPLISAssert.c \
       
    60 	JavaExceptions.c \
       
    61 	PathCharsValidator.c \
       
    62 	Reentrancy.c \
       
    63 	Utilities.c
       
    64 
       
    65 #
       
    66 # -jaragent support requires zip and jar manfiest parser to be compiled
       
    67 # into the instrument library.
       
    68 #
       
    69 IO_PLATFORM_SRC = $(PLATFORM_SRC)/native/java/io
       
    70 LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
       
    71 LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
       
    72 
       
    73 FILES_c += \
       
    74 	canonicalize_md.c
       
    75 
       
    76 FILES_export = \
       
    77 	sun/instrument/InstrumentationImpl.java
       
    78 
       
    79 #
       
    80 # This controls the ability to do logging in the library.
       
    81 #
       
    82 CPPFLAGS_DBG += -DJPLIS_LOGGING
       
    83 CPPFLAGS_OPT += -DNO_JPLIS_LOGGING
       
    84 
       
    85 OTHER_INCLUDES = -I$(SHARE_SRC)/instrument
       
    86 OTHER_INCLUDES += -I$(PLATFORM_SRC)/instrument
       
    87 OTHER_INCLUDES += -I$(IO_PLATFORM_SRC)
       
    88 OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC) -I$(LAUNCHER_PLATFORM_SRC)
       
    89 
       
    90 #
       
    91 # Create a dependency on libjli (Java Launcher Infrastructure)
       
    92 #
       
    93 # On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
       
    94 # do this reliably on Linux takes a different syntax than Solaris.
       
    95 #
       
    96 # On Windows, this is done by using the same directory as the executable
       
    97 # itself, as with all the Windows libraries.
       
    98 #
       
    99 ifeq ($(PLATFORM), windows)
       
   100   OTHER_LDLIBS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/jli.lib
       
   101   OTHER_LCF += -export:Agent_OnAttach
       
   102   # equivalent of strcasecmp is stricmp on Windows
       
   103   CPPFLAGS_COMMON += -Dstrcasecmp=stricmp
       
   104 else
       
   105   LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
       
   106   OTHER_LDLIBS += -ljli
       
   107   OTHER_LDLIBS += -ldl 
       
   108   ifeq ($(PLATFORM), solaris)
       
   109     LDFLAGS += -R \$$ORIGIN/jli
       
   110   endif
       
   111   ifeq ($(PLATFORM), linux)
       
   112     LDFLAGS += -z origin
       
   113     LDFLAGS += -Wl,--allow-shlib-undefined
       
   114     LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
       
   115   endif
       
   116 endif
       
   117 
       
   118 #
       
   119 # Library to compile.
       
   120 #
       
   121 include $(BUILDDIR)/common/Library.gmk
       
   122 
       
   123 # We don't want to link against -ljava
       
   124 JAVALIB=
       
   125 
       
   126 #
       
   127 # Add to ambient vpath so we pick up the library files
       
   128 #
       
   129 vpath %.c $(SHARE_SRC)/instrument $(PLATFORM_SRC)/instrument
       
   130 vpath %.c $(IO_PLATFORM_SRC)
       
   131