1 #
   2 # Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 include LauncherCommon.gmk
  27 
  28 # Hook to include the corresponding custom file, if present.
  29 $(eval $(call IncludeCustomExtension, modules/java.base/Launcher.gmk))
  30 
  31 JAVA_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/launcher/java.rc
  32 
  33 JAVA_RC_FLAGS += -I$(TOPDIR)/src/java.base/windows/native/common
  34 JAVA_RC_FLAGS += -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
  35 
  36 ################################################################################
  37 
  38 $(eval $(call SetupBuildLauncher, java, \
  39     CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
  40     EXTRA_RC_FLAGS := $(JAVA_RC_FLAGS), \
  41     VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
  42     OPTIMIZATION := HIGH, \
  43 ))
  44 
  45 ifeq ($(call isTargetOs, windows), true)
  46   $(eval $(call SetupBuildLauncher, javaw, \
  47       CFLAGS := -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
  48       EXTRA_RC_FLAGS := $(JAVA_RC_FLAGS), \
  49       VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
  50   ))
  51 endif
  52 
  53 $(eval $(call SetupBuildLauncher, keytool, \
  54     MAIN_CLASS := sun.security.tools.keytool.Main, \
  55 ))
  56 
  57 ################################################################################
  58 
  59 ifeq ($(call isTargetOs, linux), true)
  60   $(eval $(call SetupJdkExecutable, BUILD_JEXEC, \
  61       NAME := jexec, \
  62       SRC := $(TOPDIR)/src/$(MODULE)/unix/native/launcher, \
  63       INCLUDE_FILES := jexec.c, \
  64       OPTIMIZATION := LOW, \
  65       CFLAGS := $(CFLAGS_JDKEXE) \
  66           -I$(TOPDIR)/src/$(MODULE)/share/native/libjli, \
  67       CFLAGS_linux := -fPIC, \
  68       LDFLAGS := $(LDFLAGS_JDKEXE), \
  69       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
  70   ))
  71 
  72   TARGETS += $(BUILD_JEXEC)
  73 endif
  74 
  75 ################################################################################
  76 
  77 ifeq ($(call isTargetOs, macosx aix linux), true)
  78   $(eval $(call SetupJdkExecutable, BUILD_JSPAWNHELPER, \
  79       NAME := jspawnhelper, \
  80       SRC := $(TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \
  81       OPTIMIZATION := LOW, \
  82       CFLAGS := $(CFLAGS_JDKEXE) -I$(TOPDIR)/src/$(MODULE)/unix/native/libjava, \
  83       EXTRA_OBJECT_FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc.o, \
  84       LDFLAGS := $(LDFLAGS_JDKEXE), \
  85       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
  86   ))
  87 
  88   TARGETS += $(BUILD_JSPAWNHELPER)
  89 endif
  90 
  91 ################################################################################