jdk/make/java/jli/Makefile
author ohair
Tue, 28 Dec 2010 15:53:50 -0800
changeset 7668 d4a77089c587
parent 7041 07f4ed79094e
child 8583 15dea0fdc2ea
child 8768 4e98f3b11578
permissions -rw-r--r--
6962318: Update copyright year Reviewed-by: xdono
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 7041
diff changeset
     2
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2
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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
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
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Java Launcher Infrastructure Library (libjli)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
# This library provides shared support for the Java launcher in all of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# its manifestations (java, javaw, javac, ...).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
BUILDDIR = ../..
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4521
diff changeset
    33
MODULE  = base
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
LIBRARY = jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
PRODUCT = java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
# Must be included before Defs.gmk to be functional.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
# Note that for Windows, both a dynamic and static version are built.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# Doing the compiles with the static library specified can be overridden
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
# by the link step, but not the reverse.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
MS_RUNTIME_STATIC = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
include $(BUILDDIR)/common/Defs.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    52
ifeq ($(ZERO_BUILD), true)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    53
ERGO_FAMILY=zero
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    54
else
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
ifeq ($(ARCH_FAMILY), amd64)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
ERGO_FAMILY=i586
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
ERGO_FAMILY=$(ARCH_FAMILY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
endif
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    60
endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
# Files to compile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
FILES_c = \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
	java.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
	splashscreen_stubs.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
	java_md.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
	parse_manifest.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
	version_comp.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
	wildcard.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
	jli_util.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
	inflate.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
	inftrees.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
	inffast.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
	zadler32.c \
3704
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 1145
diff changeset
    78
	zcrc32.c \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
	zutil.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
ifneq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
FILES_c += \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
	$(CTARGDIR)ergo.c \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
	$(CTARGDIR)ergo_$(ERGO_FAMILY).c
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
# Names of arch directories
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
LIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
  LIBARCH_DEFINES += -DLIBARCH32NAME='"$(LIBARCH32)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
  LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
OTHER_CPPFLAGS += $(LIBARCH_DEFINES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
ifneq ($(PLATFORM), windows)	# UNIX systems
4340
ec6ba551fa78 6367077: Purge LD_LIBRARY_PATH usage from the launcher
ksrini
parents: 4111
diff changeset
   100
        LD_RUNPATH_EXTRAS += ..
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
	LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
	# Note: its important to keep this order meaning -lc is the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
	# last library otherwise it could cause compatibility issues
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
	# by pulling in SUNW_private symbols from libc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
	LDLIBS = -ldl -lc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
ifeq ($(USE_PTHREADS),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
	LDLIBS += -lpthread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
endif # USE_PTHREADS 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
	EXTRA_LIBS = advapi32.lib \
39
560da37936db 6596475: (launcher) javaw should call InitCommonControls
ksrini
parents: 2
diff changeset
   113
		     comctl32.lib \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
		     user32.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
	JAVALIB =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
	OTHER_LCF =  -export:JLI_Launch \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
		     -export:JLI_ManifestIterate \
1145
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   119
		     -export:JLI_SetTraceLauncher \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   120
		     -export:JLI_ReportErrorMessage \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   121
		     -export:JLI_ReportErrorMessageSys \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   122
		     -export:JLI_ReportMessage \
404b11752c57 6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
ksrini
parents: 849
diff changeset
   123
		     -export:JLI_ReportExceptionDescription
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
OTHER_INCLUDES += -I$(ZIP_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
# Library to compile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
include $(BUILDDIR)/common/Mapfile-vers.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
include $(BUILDDIR)/common/Library.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
# On Windows, some executable objects need to be statically linked against
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
# the jli library.  Hence, we need both a standard library (archive) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
# an import library (associated with a dll).  These both usually have the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
# extension .LIB, so they need to be placed in different directories.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
# import library is build (as usual) in the $(OBJDIR) directory while the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
# standard library is built in a "static" subdirectory.  The standard library
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
# is not delivered as part of the product, but is only needed as part of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
# the build process.  The import library is built by the standard rules
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
# in Library.gmk.  The additional rules which follow build the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
# library.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
7041
07f4ed79094e 6995674: (launcher) make of jli fails on windows if directory exists
ksrini
parents: 5506
diff changeset
   151
STATIC_LIBRARY = $(OBJDIR)/static/$(LIBPREFIX)$(LIBRARY).lib
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
7041
07f4ed79094e 6995674: (launcher) make of jli fails on windows if directory exists
ksrini
parents: 5506
diff changeset
   153
$(STATIC_LIBRARY): $(FILES_o)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
	@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
	$(LIBEXE) -nologo -out:$@ $(FILES_o)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
library:: $(STATIC_LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
endif	# PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
# Add to ambient vpath so we pick up the library files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)