Makefile revision 3909
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
d458ef4acb25b66d39525cca3ab5a64c4f210a0bTinderbox User# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# This code is free software; you can redistribute it and/or modify it
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# under the terms of the GNU General Public License version 2 only, as
d458ef4acb25b66d39525cca3ab5a64c4f210a0bTinderbox User# published by the Free Software Foundation. Oracle designates this
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# particular file as subject to the "Classpath" exception as provided
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# by Oracle in the LICENSE file that accompanied this code.
d458ef4acb25b66d39525cca3ab5a64c4f210a0bTinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# This code is distributed in the hope that it will be useful, but WITHOUT
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# version 2 for more details (a copy is included in the LICENSE file that
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# accompanied this code).
d458ef4acb25b66d39525cca3ab5a64c4f210a0bTinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# You should have received a copy of the GNU General Public License version
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# 2 along with this work; if not, write to the Free Software Foundation,
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# or visit www.oracle.com if you need additional information or have any
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# questions.
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Java Launcher Infrastructure Library (libjli)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# This library provides shared support for the Java launcher in all of
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# its manifestations (java, javaw, javac, ...).
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserBUILDDIR = ../..
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserLIBRARY = jli
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserPRODUCT = java
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# Must be included before Defs.gmk to be functional.
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# Note that for Windows, both a dynamic and static version are built.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Doing the compiles with the static library specified can be overridden
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# by the link step, but not the reverse.
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserMS_RUNTIME_STATIC = true
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userinclude $(BUILDDIR)/common/Defs.gmk
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserLAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserLAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userifeq ($(ZERO_BUILD), true)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserERGO_FAMILY=zero
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userelse
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userifeq ($(ARCH_FAMILY), amd64)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserERGO_FAMILY=i586
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userelse
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserERGO_FAMILY=$(ARCH_FAMILY)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userendif
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userendif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Files to compile.
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserFILES_c = \
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User java.c \
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User splashscreen_stubs.c \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User java_md.c \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User parse_manifest.c \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User version_comp.c \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User wildcard.c \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User jli_util.c \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User inflate.c \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User inftrees.c \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User inffast.c \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User zadler32.c \
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User zcrc32.c \
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User zutil.c
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox Userifneq ($(PLATFORM), windows)
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User FILES_c += ergo.c
79f0eedd657d75889009226aa7ce23eeac28df5cMark Andrews ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User # if the architecture specific ergo file exists then
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # use it, else use the generic definitions from ergo.c
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User ifneq ($(wildcard $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User FILES_c += $(ERGO_ARCH_FILE)
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User else
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User endif
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# Names of arch directories
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserLIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userifeq ($(PLATFORM), solaris)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User LIBARCH_DEFINES += -DLIBARCH32NAME='"$(LIBARCH32)"'
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"'
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userendif
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserOTHER_CPPFLAGS += $(LIBARCH_DEFINES)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifneq ($(PLATFORM), windows) # UNIX systems
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User LD_RUNPATH_EXTRAS += ..
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User # Note: its important to keep this order meaning -lc is the
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User # last library otherwise it could cause compatibility issues
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User # by pulling in SUNW_private symbols from libc
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User LDLIBS = -ldl -lc
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userifeq ($(USE_PTHREADS),true)
a24330c4805a224191ab687d0291963062fe3355Tinderbox User LDLIBS += -lpthread
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userendif # USE_PTHREADS
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userendif # PLATFORM
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userifeq ($(PLATFORM), windows)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User EXTRA_LIBS = advapi32.lib \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User comctl32.lib \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User user32.lib
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User JAVALIB =
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User OTHER_LCF = -export:JLI_Launch \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User -export:JLI_ManifestIterate \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User -export:JLI_SetTraceLauncher \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User -export:JLI_ReportErrorMessage \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User -export:JLI_ReportErrorMessageSys \
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User -export:JLI_ReportMessage \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -export:JLI_ReportExceptionDescription
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userendif
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserOTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserOTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserOTHER_INCLUDES += -I$(ZIP_SRC)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# Library to compile.
a24330c4805a224191ab687d0291963062fe3355Tinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userinclude $(BUILDDIR)/common/Mapfile-vers.gmk
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox Userinclude $(BUILDDIR)/common/Library.gmk
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# On Windows, some executable objects need to be statically linked against
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# the jli library. Hence, we need both a standard library (archive) and
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# an import library (associated with a dll). These both usually have the
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# extension .LIB, so they need to be placed in different directories. The
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# import library is build (as usual) in the $(OBJDIR) directory while the
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# standard library is built in a "static" subdirectory. The standard library
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# is not delivered as part of the product, but is only needed as part of
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# the build process. The import library is built by the standard rules
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# in Library.gmk. The additional rules which follow build the standard
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User# library.
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userifeq ($(PLATFORM), windows)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox UserSTATIC_LIBRARY = $(OBJDIR)/static/$(LIBPREFIX)$(LIBRARY).lib
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User$(STATIC_LIBRARY): $(FILES_o)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @$(prep-target)
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User $(LIBEXE) -nologo -out:$@ $(FILES_o)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox Userlibrary:: $(STATIC_LIBRARY)
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userendif # PLATFORM
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User#
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User# Add to ambient vpath so we pick up the library files
9c8c1a04853db32f2578a269cab9239c4f4c8b9bTinderbox User#
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Uservpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
49f29a1d550c15d691b5a9162bc089d0fba12adfTinderbox User