< prev index next >

make/Images.gmk

Print this page

        

@@ -1,7 +1,7 @@
 #
-# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 only, as
 # published by the Free Software Foundation.  Oracle designates this

@@ -25,13 +25,13 @@
 
 default: all
 
 include $(SPEC)
 include MakeBase.gmk
-include Execute.gmk
 include Modules.gmk
 
+TOOL_TARGETS :=
 JDK_TARGETS :=
 JRE_TARGETS :=
 
 # Hook to include the corresponding custom file, if present.
 $(eval $(call IncludeCustomExtension, Images-pre.gmk))

@@ -54,10 +54,13 @@
 
 BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
 
 JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod)
 
+# Use this file inside the image as target for make rule
+JIMAGE_TARGET_FILE := release
+
 JLINK_ORDER_RESOURCES := **module-info.class
 JLINK_JLI_CLASSES :=
 ifeq ($(ENABLE_GENERATE_CLASSLIST), true)
   JLINK_ORDER_RESOURCES += @$(SUPPORT_OUTPUTDIR)/link_opt/classlist
   JLINK_JLI_CLASSES := --generate-jli-classes=@$(SUPPORT_OUTPUTDIR)/link_opt/default_jli_trace.txt

@@ -83,65 +86,44 @@
 
 ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
   JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
 endif
 
-$(eval $(call SetupExecute, jlink_jdk, \
-    WARN := Creating jdk image, \
-    DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
-        $(call DependOnVariable, JDK_MODULES_LIST), \
-    OUTPUT_DIR := $(JDK_IMAGE_DIR), \
-    SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
-    PRE_COMMAND := $(RM) -r $(JDK_IMAGE_DIR), \
-    COMMAND := $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
-        $(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR), \
-))
-
-JLINK_JDK_TARGETS := $(jlink_jdk)
-
-$(eval $(call SetupExecute, jlink_jre, \
-    WARN := Creating legacy jre image, \
-    DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
-        $(call DependOnVariable, JDK_MODULES_LIST), \
-    OUTPUT_DIR := $(JDK_IMAGE_DIR), \
-    SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
-    PRE_COMMAND := $(RM) -r $(JRE_IMAGE_DIR), \
-    COMMAND := $(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
-        $(JLINK_JRE_EXTRA_OPTS) --output $(JRE_IMAGE_DIR), \
-))
-
-JLINK_JRE_TARGETS := $(jlink_jre)
-
-ifeq ($(BUILD_CDS_ARCHIVE), true)
-  ifeq ($(OPENJDK_TARGET_OS), windows)
-    CDS_ARCHIVE := bin/server/classes.jsa
-  else
-    CDS_ARCHIVE := lib/server/classes.jsa
-  endif
-
-  $(eval $(call SetupExecute, gen_cds_archive_jdk, \
-      WARN := Creating CDS archive for jdk image, \
-      DEPS := $(jlink_jdk), \
-      OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_ARCHIVE), \
-      SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
-      COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
-          -Xmx128M -Xms128M $(LOG_INFO), \
-  ))
-
-  JDK_TARGETS += $(gen_cds_archive_jdk)
-
-  $(eval $(call SetupExecute, gen_cds_archive_jre, \
-      WARN := Creating CDS archive for jre image, \
-      DEPS := $(jlink_jre), \
-      OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_ARCHIVE), \
-      SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
-      COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
-          -Xmx128M -Xms128M $(LOG_INFO), \
-  ))
+$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
+    $(call DependOnVariable, JDK_MODULES_LIST) $(BASE_RELEASE_FILE)
+        $(call LogWarn, Creating jdk image)
+        $(RM) -r $(JDK_IMAGE_DIR)
+        $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jdk, \
+            $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
+                $(JLINK_JDK_EXTRA_OPTS) \
+                --output $(JDK_IMAGE_DIR) \
+        )
+        ifeq ($(BUILD_CDS_ARCHIVE), true)
+          $(call LogWarn, Creating CDS archive for jdk image)
+          $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java \
+              -Xshare:dump -Xmx128M -Xms128M $(LOG_INFO)
+        endif
+        $(TOUCH) $@
+
+$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
+    $(call DependOnVariable, JRE_MODULES_LIST) $(BASE_RELEASE_FILE)
+        $(call LogWarn, Creating legacy jre image)
+        $(RM) -r $(JRE_IMAGE_DIR)
+        $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/images/jre, \
+            $(JLINK_TOOL) --add-modules $(JRE_MODULES_LIST) \
+                $(JLINK_JRE_EXTRA_OPTS) \
+                --output $(JRE_IMAGE_DIR) \
+        )
+        ifeq ($(BUILD_CDS_ARCHIVE), true)
+          $(call LogWarn, Creating CDS archive for jre image)
+          $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java \
+              -Xshare:dump -Xmx128M -Xms128M $(LOG_INFO)
+        endif
+        $(TOUCH) $@
 
-  JDK_TARGETS += $(gen_cds_archive_jdk)
-endif
+TOOL_JRE_TARGETS := $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
+TOOL_JDK_TARGETS := $(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
 
 ################################################################################
 # src.zip
 
 $(JDK_IMAGE_DIR)/lib/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip

@@ -181,18 +163,25 @@
 ################################################################################
 # Code coverage data files
 
 ifeq ($(GCOV_ENABLED), true)
 
-  $(eval $(call SetupCopyFiles,COPY_GCOV_GCNO, \
+  GCOV_FIND_EXPR := -type f -name "*.gcno"
+
+  $(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
       SRC := $(OUTPUTDIR), \
       DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
-      FILES := $(call FindFiles, $(HOTSPOT_OUTPUTDIR) \
-          $(SUPPORT_OUTPUTDIR)/native, *.gcno) \
-  ))
+      FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
+
+  SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
+
+  $(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
+      SRC := $(OUTPUTDIR), \
+      DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
+      FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
 
-  SYMBOLS_TARGETS += $(COPY_GCOV_GCNO)
+  SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
 
 endif
 
 ################################################################################
 # Debug symbols

@@ -221,14 +210,14 @@
 else
   DEBUGINFO_SUFFIXES := .debuginfo .pdb .map
   # On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
   # dirs.
   ifeq ($(call isTargetOs, macosx), true)
-    $(call FillFindCache, \
-        $(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs)
+    $(eval $(call FillCacheFind, \
+        $(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs))
     FindDebuginfoFiles = \
-        $(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
+        $(if $(wildcard $1), $(call containing, .dSYM/, $(call CacheFind, $1)))
   endif
 endif
 
 # Param 1 - either JDK or JRE
 SetupCopyDebuginfo = \

@@ -253,15 +242,15 @@
 # before actual target prerequisites are declared.
 $(eval $(call IncludeCustomExtension, Images-post.gmk))
 
 ################################################################################
 
-$(JRE_TARGETS): $(JLINK_JRE_TARGETS)
-$(JDK_TARGETS): $(JLINK_JDK_TARGETS)
+$(JRE_TARGETS): $(TOOL_JRE_TARGETS)
+$(JDK_TARGETS): $(TOOL_JDK_TARGETS)
 
-jdk: $(JLINK_JDK_TARGETS) $(JDK_TARGETS)
-jre: $(JLINK_JRE_TARGETS) $(JRE_TARGETS)
+jdk: $(TOOL_JDK_TARGETS) $(JDK_TARGETS)
+jre: $(TOOL_JRE_TARGETS) $(JRE_TARGETS)
 symbols: $(SYMBOLS_TARGETS)
 
 all: jdk jre symbols
 
 .PHONY: default all jdk jre symbols
< prev index next >