jdk/make/java/jli/Makefile
author ohair
Tue, 18 Sep 2012 12:16:37 -0700
changeset 13703 dd844a010010
parent 13567 b124faa29aef
permissions -rw-r--r--
7198325: Fix more $(sort) issues on lnk commands in makefiles, making binaries more consistent 7130909: Add a more general mechanism for customizing the build logic Reviewed-by: dholmes, tbell, erikj, ihse, ohrstrom
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
     2
# Copyright (c) 2005, 2012, 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 = ../..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
LIBRARY = jli
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
PRODUCT = java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
# Must be included before Defs.gmk to be functional.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
# Note that for Windows, both a dynamic and static version are built.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
# Doing the compiles with the static library specified can be overridden
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# by the link step, but not the reverse.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
MS_RUNTIME_STATIC = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
include $(BUILDDIR)/common/Defs.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    47
ifneq ($(SYSTEM_ZLIB),true)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    48
  ZIP_SRC = $(SHARE_SRC)/native/java/util/zip/zlib-$(ZLIB_VERSION)
13567
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 13411
diff changeset
    49
else # SYSTEM_ZLIB
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 13411
diff changeset
    50
  OTHER_CFLAGS += $(ZLIB_CFLAGS)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    51
endif #SYSTEM_ZLIB
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    53
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    54
# set the platform specific directory for macosx, also this platform shares
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    55
# substantial family ties with its siblings (solaris and linux), thus we add
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    56
# solaris src path to its compilation dependencies.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    57
ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    58
 LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx/bin
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    59
 LAUNCHER_SOLARIS_PLATFORM_SRC  = $(BUILDDIR)/../src/solaris/bin
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    60
else # !MACOSX
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    61
 LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    62
endif #PLATFORM
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 3704
diff changeset
    64
ifeq ($(ZERO_BUILD), true)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    65
  ERGO_FAMILY=zero
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    66
else # !ZERO_BUILD
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    67
  ifneq (,$(findstring $(ARCH_FAMILY), amd64 x86_64))
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    68
    ERGO_FAMILY=i586
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    69
  else # !X86 FAMILY
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    70
    ERGO_FAMILY=$(ARCH_FAMILY)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    71
  endif #ARCH_FAMILY
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    72
endif # ZERO_BUILD
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
# Files to compile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    77
FILES_c = java.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    78
          splashscreen_stubs.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    79
          parse_manifest.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    80
          version_comp.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    81
          wildcard.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    82
          jli_util.c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    83
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    84
ifneq ($(SYSTEM_ZLIB),true)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    85
  FILES_c += inflate.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    86
             inftrees.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    87
             inffast.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    88
             zadler32.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    89
             zcrc32.c \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    90
             zutil.c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    91
endif # SYSTEM_ZLIB
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    93
# add platform specific files
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    94
ifeq ($(PLATFORM), windows)
13411
224a28370893 7146424: Wildcard expansion for single entry classpath
ksrini
parents: 12047
diff changeset
    95
  FILES_c += java_md.c \
224a28370893 7146424: Wildcard expansion for single entry classpath
ksrini
parents: 12047
diff changeset
    96
	     cmdtoargs.c
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    97
else # NIXES
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    98
  FILES_c += java_md_common.c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
    99
  ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   100
    FILES_c += java_md_macosx.c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   101
  else # SOLARIS/LINUX
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   102
    FILES_c += java_md_solinux.c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   103
    FILES_c += ergo.c 
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   104
    ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   105
    # if the architecture specific ergo file exists then
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   106
    # use it, else use the generic definitions from ergo.c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   107
    ifneq ($(wildcard $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   108
      FILES_c += $(ERGO_ARCH_FILE)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   109
    else # !ERGO_ARCH_FILE
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   110
      OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   111
    endif # ERGO_ARCH_FILE
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   112
  endif #MACOSX
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   113
endif #WINDOWS
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
# Names of arch directories
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
LIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
  LIBARCH_DEFINES += -DLIBARCH32NAME='"$(LIBARCH32)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
  LIBARCH_DEFINES += -DLIBARCH64NAME='"$(LIBARCH64)"'
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   120
endif # PLATFORM
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   122
ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   123
  OTHER_CPPFLAGS += $(LIBARCH_DEFINES) -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   124
else # ! MACOSX
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   125
  OTHER_CPPFLAGS += $(LIBARCH_DEFINES)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   126
endif #PLATFORM
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
ifneq ($(PLATFORM), windows)	# UNIX systems
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   129
  ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   130
    LIB_LOCATION = $(LIBDIR)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   131
  else # SOLARIS/LINUX
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   132
    LD_RUNPATH_EXTRAS += ..
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   133
    LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   134
    # Note: it is important to keep this order, meaning -lc as the
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   135
    # last library, otherwise it could cause compatibility issues
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   136
    # by pulling in SUNW_private symbols from libc
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   137
    LDLIBS = -ldl -lc
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   138
    ifeq ($(USE_PTHREADS),true)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   139
      LDLIBS += -lpthread
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   140
    endif # USE_PTHREADS 
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   141
  endif # PLATFORM
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
endif # PLATFORM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
ifeq ($(PLATFORM), windows)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   145
  EXTRA_LIBS = advapi32.lib \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   146
               comctl32.lib \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   147
               user32.lib
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   148
  JAVALIB =
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   149
  OTHER_LCF = -export:JLI_Launch \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   150
              -export:JLI_ManifestIterate \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   151
              -export:JLI_SetTraceLauncher \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   152
              -export:JLI_ReportErrorMessage \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   153
              -export:JLI_ReportErrorMessageSys \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   154
              -export:JLI_ReportMessage \
13411
224a28370893 7146424: Wildcard expansion for single entry classpath
ksrini
parents: 12047
diff changeset
   155
              -export:JLI_ReportExceptionDescription \
224a28370893 7146424: Wildcard expansion for single entry classpath
ksrini
parents: 12047
diff changeset
   156
	      -export:JLI_MemAlloc \
224a28370893 7146424: Wildcard expansion for single entry classpath
ksrini
parents: 12047
diff changeset
   157
	      -export:JLI_CmdToArgs \
224a28370893 7146424: Wildcard expansion for single entry classpath
ksrini
parents: 12047
diff changeset
   158
	      -export:JLI_GetStdArgc \
224a28370893 7146424: Wildcard expansion for single entry classpath
ksrini
parents: 12047
diff changeset
   159
	      -export:JLI_GetStdArgs
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   160
endif # PLATFORM
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
OTHER_INCLUDES += -I$(LAUNCHER_PLATFORM_SRC)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   164
ifneq ($(SYSTEM_ZLIB),true)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   165
  OTHER_INCLUDES += -I$(ZIP_SRC)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   166
else # !SYSTEM_ZLIB
13567
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 13411
diff changeset
   167
  LDLIBS += $(ZLIB_LIBS)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   168
endif # SYSTEM_ZLIB
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
# Library to compile.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
include $(BUILDDIR)/common/Mapfile-vers.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
include $(BUILDDIR)/common/Library.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
# On Windows, some executable objects need to be statically linked against
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
# the jli library.  Hence, we need both a standard library (archive) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
# an import library (associated with a dll).  These both usually have the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
# extension .LIB, so they need to be placed in different directories.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
# import library is build (as usual) in the $(OBJDIR) directory while the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
# standard library is built in a "static" subdirectory.  The standard library
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
# is not delivered as part of the product, but is only needed as part of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
# the build process.  The import library is built by the standard rules
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
# in Library.gmk.  The additional rules which follow build the standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
# library.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
ifeq ($(PLATFORM), windows)
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   189
  STATIC_LIBRARY = $(OBJDIR)/static/$(LIBPREFIX)$(LIBRARY).lib
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   191
  $(STATIC_LIBRARY): $(FILES_o)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
	@$(prep-target)
13703
dd844a010010 7198325: Fix more $(sort) issues on lnk commands in makefiles, making binaries more consistent
ohair
parents: 13567
diff changeset
   193
	$(LIBEXE) -nologo -out:$@ $(sort $(FILES_o))
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   195
  library:: $(STATIC_LIBRARY)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   196
endif # PLATFORM
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   197
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   198
ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   199
  # Some Obj-C code is embedded in java_md_macosx.c, we stipulate so, using
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   200
  # "-x" option. Not doing so will cause the compiler to choose the language
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   201
  # based on the filename suffix, also "-Os" optimizes the file for size.
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   202
  CFLAGS_$(VARIANT)/java_md_macosx.o = -Os -x objective-c
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   203
  # Needed for linking the various launchers
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   204
  LDFLAGS += -framework Cocoa -framework Security \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   205
             -framework ApplicationServices
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   206
  # Add solaris sources containing common logic to the header path
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   207
  OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   208
endif # PLATFORM
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   209
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   210
STATIC_LIBRARY_DIR = $(OBJDIR)/static
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   211
STATIC_LIBRARY_NAME = lib$(LIBRARY).a
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   212
STATIC_LIBRARY = $(STATIC_LIBRARY_DIR)/$(STATIC_LIBRARY_NAME)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   213
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   214
$(STATIC_LIBRARY_DIR): | $(OBJDIR)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   215
	@$(MKDIR) $(STATIC_LIBRARY_DIR)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   216
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   217
$(STATIC_LIBRARY): $(STATIC_LIBRARY_DIR)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   218
	@$(prep-target)
13703
dd844a010010 7198325: Fix more $(sort) issues on lnk commands in makefiles, making binaries more consistent
ohair
parents: 13567
diff changeset
   219
	$(AR) $(ARFLAGS) $@ $(sort $(FILES_o))
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   220
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
library:: $(STATIC_LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   223
vpath %.c $(LAUNCHER_SHARE_SRC) $(LAUNCHER_PLATFORM_SRC)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   224
ifneq ($(SYSTEM_ZLIB),true)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   225
  vpath %.c $(ZIP_SRC)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   226
else # !SYSTEM_ZLIB
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   227
  #
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   228
  # Add to ambient vpath so we pick up the library files, for macos we add 
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   229
  # solaris sources which contains the common logic for all nixes
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   230
  #
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   231
  ifeq ($(PLATFORM), macosx)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   232
    vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC) \
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   233
          $(LAUNCHER_SOLARIS_PLATFORM_SRC)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   234
  else # !MACOSX
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   235
    vpath %.c $(LAUNCHER_SHARE_SRC) $(ZIP_SRC) $(LAUNCHER_PLATFORM_SRC)
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   236
  endif # MACOSX
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 9035
diff changeset
   237
endif # SYSTEM_LIB