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