jdk/make/launcher/LauncherCommon.gmk
author ihse
Fri, 21 Nov 2014 16:05:11 +0100
changeset 27736 8c9bd4be4a86
parent 25859 3317bb8137f4
child 27799 097b1d6f6894
permissions -rw-r--r--
8058631: Rename posix to unix in build system to match file name changes Reviewed-by: simonis, erikj, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     1
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     2
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     4
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    10
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    15
# accompanied this code).
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    16
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    20
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    23
# questions.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    24
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    25
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    26
default: all
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    27
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    28
include $(SPEC)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    29
include MakeBase.gmk
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    30
include NativeCompilation.gmk
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    31
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    32
# Prepare the find cache.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    33
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    34
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    35
# Build tools
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    36
include Tools.gmk
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    37
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    38
# When building a legacy overlay image (on solaris 64 bit), the launchers
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    39
# need to be built with a different rpath and a different output dir.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    40
ifeq ($(OVERLAY_IMAGES), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    41
  ORIGIN_ROOT := /../..
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    42
  OUTPUT_SUBDIR := $(OPENJDK_TARGET_CPU_ISADIR)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    43
else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    44
  ORIGIN_ROOT := /..
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    45
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    46
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    47
ifeq ($(OPENJDK_TARGET_OS), macosx)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    48
  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    49
else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    50
  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    51
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    52
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    53
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    54
# Applications expect to be able to link against libjawt without invoking
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    55
# System.loadLibrary("jawt") first. This was the behaviour described in the
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    56
# devloper documentation of JAWT and what worked with OpenJDK6.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    57
#
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    58
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    59
  ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    60
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    61
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    62
LAUNCHER_SRC := $(JDK_TOPDIR)/src/java.base/share/native/launcher
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    63
LAUNCHER_CFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/launcher \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    64
    -I$(JDK_TOPDIR)/src/java.base/share/native/libjli \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    65
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjli \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    66
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libjli \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    67
    #
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    68
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    69
JAVA_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.rc
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    70
MACOSX_PLIST_DIR := $(JDK_TOPDIR)/src/java.base/macosx/native/launcher
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    71
# Until the shuffle is permanent, we can't add this in configure
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    72
CFLAGS_JDKEXE := $(filter-out %javavm/export, $(CFLAGS_JDKEXE))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    73
CFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    74
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    75
CXXFLAGS_JDKEXE := $(filter-out %javavm/export, $(CXXFLAGS_JDKEXE))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    76
CXXFLAGS_JDKEXE += -I$(JDK_TOPDIR)/src/java.base/share/native/include \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    77
    -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    78
JAVA_MANIFEST := $(JDK_TOPDIR)/src/java.base/windows/native/launcher/java.manifest
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    79
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    80
define SetupLauncher
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    81
  # TODO: Fix mapfile on solaris. Won't work with ld as linker.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    82
  # Parameter 1 is the name of the launcher (java, javac, jar...)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    83
  # Parameter 2 is extra CFLAGS
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    84
  # Parameter 3 is extra LDFLAGS
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
    85
  # Parameter 4 is extra LDFLAGS_SUFFIX_unix
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    86
  # Parameter 5 is extra LDFLAGS_SUFFIX_windows
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    87
  # Parameter 6 is optional Windows JLI library (full path)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    88
  # Parameter 7 is optional Windows resource (RC) flags
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    89
  # Parameter 8 is optional Windows version resource file (.rc)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    90
  # Parameter 9 is different output dir
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    91
  # Parameter 10 if set, link statically with c runtime on windows.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    92
  # Parameter 11 if set, override plist file on macosx.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    93
  $(call LogSetupMacroEntry,SetupLauncher($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    94
  $(if $(13),$(error Internal makefile error: Too many arguments to SetupLauncher, please update CompileLaunchers.gmk))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    95
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    96
  $1_WINDOWS_JLI_LIB := $(JDK_OUTPUTDIR)/objs/libjli/jli.lib
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    97
  ifneq ($6, )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    98
    $1_WINDOWS_JLI_LIB := $6
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
    99
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   100
  $1_VERSION_INFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   101
  ifneq ($8, )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   102
    $1_VERSION_INFO_RESOURCE := $8
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   103
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   104
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   105
  $1_LDFLAGS := $3
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   106
  $1_LDFLAGS_SUFFIX :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   107
  ifeq ($(OPENJDK_TARGET_OS), macosx)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   108
    $1_PLIST_FILE := Info-cmdline.plist
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   109
    ifneq ($(11), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   110
      $1_PLIST_FILE := $(11)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   111
      ifneq ($$(findstring privileged, $$($1_PLIST_FILE)), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   112
        $1_CODESIGN := true
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   113
      endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   114
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   115
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   116
    $1_LDFLAGS += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   117
        -framework Cocoa -framework Security -framework ApplicationServices \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   118
        -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   119
        $1_LDFLAGS_SUFFIX += -pthread
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   120
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   121
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   122
  ifeq ($(OPENJDK_TARGET_OS), aix)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   123
    $1_LDFLAGS_SUFFIX += -L$(JDK_OUTPUTDIR)/objs -ljli_static
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   124
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   125
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   126
  ifeq ($(USE_EXTERNAL_LIBZ), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   127
    $1_LDFLAGS_SUFFIX += -lz
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   128
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   129
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   130
  $1_OUTPUT_DIR_ARG := $9
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   131
  ifeq (, $$($1_OUTPUT_DIR_ARG))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   132
    $1_OUTPUT_DIR_ARG := $(JDK_OUTPUTDIR)/bin
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   133
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   134
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   135
  # TODO: maybe it's better to move this if-statement out of this function
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   136
  ifeq ($1, java)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   137
    $1_OPTIMIZATION_ARG := HIGH
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   138
    $1_LDFLAGS_solaris := -R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   139
  else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   140
  $1_OPTIMIZATION_ARG := LOW
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   141
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   142
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   143
  $1_CFLAGS := $(CFLAGS_JDKEXE)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   144
  ifeq ($(10), true)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   145
    $1_CFLAGS := $(filter-out -MD, $(CFLAGS_JDKEXE))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   146
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   147
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   148
  # The linker on older SuSE distros (e.g. on SLES 10) complains with:
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   149
  # "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   150
  # if feeded with a version script which contains named tags.
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   151
  ifeq ($(USING_BROKEN_SUSE_LD),yes)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   152
    ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   153
      $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU).anonymous
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   154
    else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   155
      $1_MAPFILE :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   156
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   157
  else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   158
    ifneq ($(wildcard $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)), )
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   159
      $1_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   160
    else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   161
      $1_MAPFILE :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   162
    endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   163
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   164
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   165
  $(call SetupNativeCompilation,BUILD_LAUNCHER_$1, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   166
      SRC := $(LAUNCHER_SRC), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   167
      INCLUDE_FILES := main.c, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   168
      LANG := C, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   169
      OPTIMIZATION := $$($1_OPTIMIZATION_ARG), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   170
      CFLAGS := $$($1_CFLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   171
          $(LAUNCHER_CFLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   172
          -DFULL_VERSION='"$(FULL_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   173
          -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   174
          -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   175
          -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   176
          -DPROGNAME='"$1"' $(DPACKAGEPATH) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   177
          $2, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   178
      CFLAGS_linux := -fPIC, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   179
      CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   180
      LDFLAGS := $(LDFLAGS_JDKEXE) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   181
          $(ORIGIN_ARG) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   182
          $$($1_LDFLAGS), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   183
      LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_NAME,$1), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   184
      LDFLAGS_linux := -lpthread \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   185
          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   186
      LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   187
          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   188
      MAPFILE := $$($1_MAPFILE), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   189
      LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \
27736
8c9bd4be4a86 8058631: Rename posix to unix in build system to match file name changes
ihse
parents: 25859
diff changeset
   190
      LDFLAGS_SUFFIX_unix := $4, \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   191
      LDFLAGS_SUFFIX_windows := $$($1_WINDOWS_JLI_LIB) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   192
          $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   193
      LDFLAGS_SUFFIX_linux := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   194
      LDFLAGS_SUFFIX_solaris := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   195
      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/$1_objs$(OUTPUT_SUBDIR), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   196
      OUTPUT_DIR := $$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   197
      PROGRAM := $1, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   198
      DEBUG_SYMBOLS := true, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   199
      VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   200
      RC_FLAGS := $(RC_FLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   201
          -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   202
          -D "JDK_INTERNAL_NAME=$1" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   203
          -D "JDK_FTYPE=0x1L" \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   204
          $7, \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   205
      MANIFEST := $(JAVA_MANIFEST), \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   206
      CODESIGN := $$($1_CODESIGN))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   207
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   208
  LAUNCHERS += $$(BUILD_LAUNCHER_$1)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   209
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   210
  ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix))
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   211
    $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjli_static.a
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   212
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   213
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   214
  ifeq ($(OPENJDK_TARGET_OS), windows)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   215
    $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   216
        $$($1_WINDOWS_JLI_LIB)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   217
  endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   218
endef
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   219
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   220
##########################################################################################
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   221
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   222
XLIBS := $(X_LIBS) -lX11
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   223
ifeq ($(OPENJDK_TARGET_OS), macosx)
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   224
  DPACKAGEPATH := -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   225
  XLIBS :=
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   226
endif
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   227
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   228
JAVA_RC_FLAGS += -i $(JDK_TOPDIR)/src/java.base/windows/native/common
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   229
ifdef OPENJDK
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   230
  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/java.base/windows/native/launcher/icons"
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   231
else
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   232
  JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/java.base/windows/native/launcher/icons"
3317bb8137f4 8054834: Modular Source Code
chegar
parents:
diff changeset
   233
endif