makefiles/Images.gmk
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File jdk Sdiff makefiles

makefiles/Images.gmk

Print this page




  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 $(SPEC)
  27 include MakeBase.gmk
  28 include JavaCompilation.gmk
  29 include Setup.gmk
  30 
  31 default: images
  32 
  33 include Tools.gmk
  34 


  35 # Note: This double-colon rule is intentional, to support
  36 # custom make file integration.
  37 images:: jre-image jdk-image
  38 
  39 overlay-images: jre-overlay-image jdk-overlay-image
  40 
  41 
  42 -include $(CUSTOM_MAKE_DIR)/Images.gmk
  43 
  44 
  45 # Processing license files from source area to image area
  46 # These will be modified to have the platform specific EOL chars.
  47 define process-doc-file
  48         $(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@)
  49         $(MKDIR) -p $(@D)
  50         $(RM) $@
  51         $(SED) 's/$$//g' $< > $@
  52         $(CHMOD) 444 $@
  53 endef
  54 


  64   $2/$$($2_$3_FILE): $3
  65         $(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
  66         $$(install-file)
  67 
  68   $4 += $2/$$($2_$3_FILE)
  69 endef
  70 
  71 JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image
  72 JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image
  73 
  74 JDK_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-overlay-image
  75 JRE_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-overlay-image
  76 
  77 ################################################################################
  78 #
  79 # JRE and JDK build rules
  80 #
  81 ################################################################################
  82 #
  83 # Variable prefixes explained:
  84 # JRE_ refers to files in the j2re-image.
  85 # JDK_ refers to files in the j2sdk-image outside of the jre subdir.
  86 # JDKJRE_ refers to files in the j2sdk-image inside the jre subdir.
  87 #
  88 
  89 ################################################################################
  90 # /bin dir
  91 
  92 NOT_JRE_BIN_FILES := \
  93         appletviewer$(EXE_SUFFIX) \
  94         extcheck$(EXE_SUFFIX) \
  95         idlj$(EXE_SUFFIX) \
  96         jar$(EXE_SUFFIX) \
  97         jarsigner$(EXE_SUFFIX) \
  98         java-rmi.cgi \
  99         javac$(EXE_SUFFIX) \
 100         javadoc$(EXE_SUFFIX) \
 101         javah$(EXE_SUFFIX) \
 102         javap$(EXE_SUFFIX) \
 103         jcmd$(EXE_SUFFIX) \
 104         jdb$(EXE_SUFFIX) \
 105         jps$(EXE_SUFFIX) \
 106         jrunscript$(EXE_SUFFIX) \
 107         jstat$(EXE_SUFFIX) \
 108         jstatd$(EXE_SUFFIX) \
 109         jstack$(EXE_SUFFIX) \
 110         packagebean$(SCRIPT_SUFFIX) \
 111         rmic$(EXE_SUFFIX) \
 112         serialver$(EXE_SUFFIX) \
 113         unregbean$(EXE_SUFFIX) \
 114         jconsole$(EXE_SUFFIX) \
 115         jinfo$(EXE_SUFFIX) \
 116         jmap$(EXE_SUFFIX) \
 117         native2ascii$(EXE_SUFFIX) \
 118         xjc$(EXE_SUFFIX) \
 119         wsgen$(EXE_SUFFIX) \
 120         wsimport$(EXE_SUFFIX) \
 121         schemagen$(EXE_SUFFIX) \
 122         jsadebugd$(EXE_SUFFIX) \
 123         jhat$(EXE_SUFFIX)
 124 
 125 WINDOWS_JDK_BIN_FILES = \
 126         $(EXE_SUFFIX) \
 127         $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
 128         $(notdir $(MSVCR_DLL))
 129 
 130 WINDOWS_JDKJRE_BIN_FILES := \
 131         $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
 132         $(SALIB_NAME)
 133 
 134 # Find all files in bin dir
 135 ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f)
 136 
 137 # Prevent sjavac from entering the images.
 138 ALL_BIN_LIST := $(filter-out %/sjavac,$(ALL_BIN_LIST))
 139 
 140 # For unknown reason the debuginfo files for executables are not put into images
 141 # e.g filter them out
 142 ifneq ($(OPENJDK_TARGET_OS),windows)
 143     ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
 144 else


 175 $(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
 176     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
 177 $(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
 178     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
 179 
 180 $(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\
 181     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
 182 $(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
 183     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
 184 $(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
 185     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
 186 
 187 ################################################################################
 188 # /lib dir
 189 ifneq ($(OPENJDK_TARGET_OS), macosx)
 190     JDKJRE_LIB_FILES := \
 191         $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
 192         $(SALIB_NAME)
 193 endif
 194 
 195 NOT_JRE_LIB_FILES := \
 196         tools.jar \
 197         jconsole.jar \
 198         sa-jdi.jar \
 199         dt.jar \
 200         orb.idl \
 201         ir.idl \
 202         ct.sym
 203 
 204 ifeq ($(OPENJDK_TARGET_OS), windows)
 205     NOT_JRE_LIB_FILES += jawt.lib jvm.lib
 206 endif
 207 
 208 JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
 209 ifeq ($(OPENJDK_TARGET_OS), linux)
 210     JDK_LIB_FILES += jexec
 211 endif
 212 
 213 # Find all files to copy from $(JDK_OUTPUTDIR)/lib
 214 # Jar files are not expected to be here
 215 ALL_JDKOUT_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
 216                        \( -name "_the*" -o -name "javac_state " -o -name "*.jar" \) )
 217 # Find all files to copy from $(IMAGES_OUTPUTDIR)/lib
 218 # This is were the jar files are and might not exist if building overlay-images
 219 ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib),)
 220     ALL_IMAGES_LIB_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
 221                        \( -name "_the*" -o -name "javac_state " \) )
 222 endif
 223 
 224 # Filter files to copy for each destination
 225 JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
 226                        $(ALL_JDKOUT_LIB_LIST))
 227 JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST))


 586 endef
 587 
 588 define create-info-file
 589         $(MKDIR) -p $(@D)
 590         $(RM) $@
 591         $(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
 592         $(call info-file-item, "OS_NAME",      "$(REQUIRED_OS_NAME)")
 593         $(call info-file-item, "OS_VERSION",   "$(REQUIRED_OS_VERSION)")
 594         $(call info-file-item, "OS_ARCH",      "$(OPENJDK_TARGET_CPU_LEGACY)")
 595         $(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
 596 endef
 597 
 598 ALL_SOURCE_TIPS = $(shell \
 599   if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
 600     $(CAT) $(OUTPUT_ROOT)/source_tips ; \
 601   fi)
 602 
 603 $(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 604         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 605         $(call create-info-file)



 606 
 607 $(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 608         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 609         $(call create-info-file)
 610 
 611 $(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 612         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 613         $(call create-info-file)
 614 
 615 $(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 616         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 617         $(call create-info-file)
 618 
 619 $(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip
 620         $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 621         $(install-file)
 622 
 623 ################################################################################
 624 # Post processing (strip etc)
 625 


 628         EXEC_LIST_BIN:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \
 629                 -o -name \*.dll | $(EGREP) -v -i "$(MSVCR_DLL)")
 630     else
 631         # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
 632         EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \
 633                 | $(EGREP) 'ELF' | $(CUT) -d':' -f1)
 634         # On mac, the old build searches for static libraries for stripping instead of shared.
 635         # Not clear if it's intentional.
 636         ifneq ($(OPENJDK_TARGET_OS), macosx)
 637             EXEC_LIST_LIB:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX))
 638         endif
 639     endif
 640     # Filter out sjavac
 641     EXEC_LIST_BIN:=$(filter-out %sjavac$(EXE_SUFFIX),$(EXEC_LIST_BIN))
 642 
 643     # Filter out the overlay specific bin files
 644     EXEC_LIST:=$(filter-out $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
 645     EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
 646 
 647     # Filter out non JRE files and convert to unique touch files to depend on
 648     JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped,\
 649                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
 650                                  $(EXEC_LIST)))
 651 
 652     JDKJRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 653                         $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
 654                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
 655 
 656     JDK_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 657                           $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
 658                           $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
 659 
 660     # Do the same for overlay image
 661     JRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped,\
 662                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
 663                                  $(EXEC_LIST_OVERLAY)))
 664 
 665     JDKJRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 666                         $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \
 667                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY)))
 668 
 669     JDK_OVERLAY_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 670                           $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \
 671                           $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY)))
 672 
 673     define mcs-file
 674         $(if $(POST_MCS_CMD),$(POST_MCS_CMD) $<)
 675     endef
 676 
 677     define strip-file
 678         $(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<)
 679         $(CHMOD) u+w $<
 680         $(POST_STRIP_CMD) $<
 681         $(call mcs-file)
 682         $(CHMOD) go-w $<
 683         $(MKDIR) -p $(@D)
 684         $(TOUCH) $@
 685     endef
 686 
 687     # Setup a rule for stripping files based on touch files
 688     $(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped: $(JRE_IMAGE_DIR)/%
 689         $(call strip-file)
 690 
 691     $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/%
 692         $(call strip-file)
 693 
 694     $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/%
 695         $(call strip-file)
 696 
 697     $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/%
 698         $(call strip-file)
 699 
 700 endif
 701 
 702 ################################################################################
 703 # Main targets
 704 
 705 jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \
 706         $(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
 707         $(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST)
 708 
 709 jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
 710         $(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
 711         $(JDK_IMAGE_DIR)/jre/lib/applet \
 712         $(JDK_DEMO_TARGETS) \
 713         $(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \
 714         $(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
 715         $(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
 716         $(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
 717         $(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \
 718         $(JDK_IMAGE_DIR)/src.zip
 719 
 720 jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \
 721          $(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST)
 722 
 723 jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \
 724         $(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \
 725         $(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \
 726         $(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) 


















 727 
 728 ################################################################################
 729 
 730 .PHONY: default images jre-image jdk-image


  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 $(SPEC)
  27 include MakeBase.gmk
  28 include JavaCompilation.gmk
  29 include Setup.gmk
  30 
  31 default: images
  32 
  33 include Tools.gmk
  34 
  35 include Profiles.gmk
  36 
  37 # Note: This double-colon rule is intentional, to support
  38 # custom make file integration.
  39 images:: jre-image jdk-image
  40 
  41 overlay-images: jre-overlay-image jdk-overlay-image
  42 
  43 
  44 -include $(CUSTOM_MAKE_DIR)/Images.gmk
  45 
  46 
  47 # Processing license files from source area to image area
  48 # These will be modified to have the platform specific EOL chars.
  49 define process-doc-file
  50         $(ECHO) $(LOG_INFO) Processing $(patsubst $(OUTPUT_ROOT)/%,%,$@)
  51         $(MKDIR) -p $(@D)
  52         $(RM) $@
  53         $(SED) 's/$$//g' $< > $@
  54         $(CHMOD) 444 $@
  55 endef
  56 


  66   $2/$$($2_$3_FILE): $3
  67         $(ECHO) $(LOG_INFO) Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
  68         $$(install-file)
  69 
  70   $4 += $2/$$($2_$3_FILE)
  71 endef
  72 
  73 JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image
  74 JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image
  75 
  76 JDK_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-overlay-image
  77 JRE_OVERLAY_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-overlay-image
  78 
  79 ################################################################################
  80 #
  81 # JRE and JDK build rules
  82 #
  83 ################################################################################
  84 #
  85 # Variable prefixes explained:
  86 # JRE_ refers to files in the j2re-*-image.
  87 # JDK_ refers to files in the j2sdk-image outside of the jre subdir.
  88 # JDKJRE_ refers to files in the j2sdk-image inside the jre subdir.
  89 #
  90 
  91 ################################################################################
  92 # /bin dir
  93 

































  94 WINDOWS_JDK_BIN_FILES = \
  95         $(EXE_SUFFIX) \
  96         $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
  97         $(notdir $(MSVCR_DLL))
  98 
  99 WINDOWS_JDKJRE_BIN_FILES := \
 100         $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
 101         $(SALIB_NAME)
 102 
 103 # Find all files in bin dir
 104 ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f)
 105 
 106 # Prevent sjavac from entering the images.
 107 ALL_BIN_LIST := $(filter-out %/sjavac,$(ALL_BIN_LIST))
 108 
 109 # For unknown reason the debuginfo files for executables are not put into images
 110 # e.g filter them out
 111 ifneq ($(OPENJDK_TARGET_OS),windows)
 112     ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
 113 else


 144 $(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
 145     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
 146 $(foreach f,$(filter-out $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
 147     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
 148 
 149 $(foreach f,$(filter $(OVERLAY_FILTER),$(JRE_BIN_LIST)),\
 150     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JRE_OVERLAY_IMAGE_DIR),$f,JRE_BIN_TARGETS)))
 151 $(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)),\
 152     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR),$f,JDK_BIN_TARGETS)))
 153 $(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)),\
 154     $(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
 155 
 156 ################################################################################
 157 # /lib dir
 158 ifneq ($(OPENJDK_TARGET_OS), macosx)
 159     JDKJRE_LIB_FILES := \
 160         $(LIBRARY_PREFIX)attach$(SHARED_LIBRARY_SUFFIX) \
 161         $(SALIB_NAME)
 162 endif
 163 













 164 JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
 165 ifeq ($(OPENJDK_TARGET_OS), linux)
 166     JDK_LIB_FILES += jexec
 167 endif
 168 
 169 # Find all files to copy from $(JDK_OUTPUTDIR)/lib
 170 # Jar files are not expected to be here
 171 ALL_JDKOUT_LIB_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
 172                        \( -name "_the*" -o -name "javac_state " -o -name "*.jar" \) )
 173 # Find all files to copy from $(IMAGES_OUTPUTDIR)/lib
 174 # This is were the jar files are and might not exist if building overlay-images
 175 ifneq ($(wildcard $(IMAGES_OUTPUTDIR)/lib),)
 176     ALL_IMAGES_LIB_LIST := $(shell $(FIND) $(IMAGES_OUTPUTDIR)/lib \( -type f -o -type l \) -a ! \
 177                        \( -name "_the*" -o -name "javac_state " \) )
 178 endif
 179 
 180 # Filter files to copy for each destination
 181 JRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
 182                        $(ALL_JDKOUT_LIB_LIST))
 183 JDKJRE_JDKOUT_LIB_LIST := $(filter-out $(addprefix %,$(NOT_JRE_LIB_FILES)),$(ALL_JDKOUT_LIB_LIST))


 542 endef
 543 
 544 define create-info-file
 545         $(MKDIR) -p $(@D)
 546         $(RM) $@
 547         $(call info-file-item, "JAVA_VERSION", "$(JDK_VERSION)")
 548         $(call info-file-item, "OS_NAME",      "$(REQUIRED_OS_NAME)")
 549         $(call info-file-item, "OS_VERSION",   "$(REQUIRED_OS_VERSION)")
 550         $(call info-file-item, "OS_ARCH",      "$(OPENJDK_TARGET_CPU_LEGACY)")
 551         $(call info-file-item, "SOURCE",       "$(ALL_SOURCE_TIPS)")
 552 endef
 553 
 554 ALL_SOURCE_TIPS = $(shell \
 555   if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
 556     $(CAT) $(OUTPUT_ROOT)/source_tips ; \
 557   fi)
 558 
 559 $(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 560         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 561         $(call create-info-file)
 562 ifneq ($(PROFILE),)
 563         $(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))")
 564 endif
 565 
 566 $(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 567         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 568         $(call create-info-file)
 569 
 570 $(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 571         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 572         $(call create-info-file)
 573 
 574 $(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
 575         $(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 576         $(call create-info-file)
 577 
 578 $(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip
 579         $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
 580         $(install-file)
 581 
 582 ################################################################################
 583 # Post processing (strip etc)
 584 


 587         EXEC_LIST_BIN:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \
 588                 -o -name \*.dll | $(EGREP) -v -i "$(MSVCR_DLL)")
 589     else
 590         # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
 591         EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \
 592                 | $(EGREP) 'ELF' | $(CUT) -d':' -f1)
 593         # On mac, the old build searches for static libraries for stripping instead of shared.
 594         # Not clear if it's intentional.
 595         ifneq ($(OPENJDK_TARGET_OS), macosx)
 596             EXEC_LIST_LIB:=$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f -name \*$(SHARED_LIBRARY_SUFFIX))
 597         endif
 598     endif
 599     # Filter out sjavac
 600     EXEC_LIST_BIN:=$(filter-out %sjavac$(EXE_SUFFIX),$(EXEC_LIST_BIN))
 601 
 602     # Filter out the overlay specific bin files
 603     EXEC_LIST:=$(filter-out $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
 604     EXEC_LIST_OVERLAY:=$(filter $(OVERLAY_FILTER),$(EXEC_LIST_BIN)) $(EXEC_LIST_LIB)
 605 
 606     # Filter out non JRE files and convert to unique touch files to depend on
 607     JRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped,\
 608                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
 609                                  $(EXEC_LIST)))
 610 
 611     JDKJRE_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 612                         $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
 613                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
 614 
 615     JDK_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 616                           $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
 617                           $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
 618 
 619     # Do the same for overlay image
 620     JRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped,\
 621                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES) $(JDKJRE_LIB_FILES)),\
 622                                  $(EXEC_LIST_OVERLAY)))
 623 
 624     JDKJRE_OVERLAY_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 625                         $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/jre/%.stripped, \
 626                         $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST_OVERLAY)))
 627 
 628     JDK_OVERLAY_BIN_STRIP_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
 629                           $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped, \
 630                           $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST_OVERLAY)))
 631 
 632     define mcs-file
 633         $(if $(POST_MCS_CMD),$(POST_MCS_CMD) $<)
 634     endef
 635 
 636     define strip-file
 637         $(ECHO) Stripping $(LOG_INFO) $(patsubst $(OUTPUT_ROOT)/%,%,$<)
 638         $(CHMOD) u+w $<
 639         $(POST_STRIP_CMD) $<
 640         $(call mcs-file)
 641         $(CHMOD) go-w $<
 642         $(MKDIR) -p $(@D)
 643         $(TOUCH) $@
 644     endef
 645 
 646     # Setup a rule for stripping files based on touch files
 647     $(IMAGES_OUTPUTDIR)/_strip_jre$(PROFILE)/%.stripped: $(JRE_IMAGE_DIR)/%
 648         $(call strip-file)
 649 
 650     $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped: $(JDK_IMAGE_DIR)/%
 651         $(call strip-file)
 652 
 653     $(IMAGES_OUTPUTDIR)/_strip_jre_overlay/%.stripped: $(JRE_OVERLAY_IMAGE_DIR)/%
 654         $(call strip-file)
 655 
 656     $(IMAGES_OUTPUTDIR)/_strip_jdk_overlay/%.stripped: $(JDK_OVERLAY_IMAGE_DIR)/%
 657         $(call strip-file)
 658 
 659 endif
 660 
 661 ################################################################################
 662 # Main targets
 663 
 664 jre-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) $(JRE_IMAGE_DIR)/lib/applet \
 665         $(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
 666         $(JRE_MAN_PAGE_LIST) $(JRE_DOC_TARGETS) $(JRE_INFO_FILE) $(JRE_STRIP_LIST)
 667 
 668 jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
 669         $(JDK_LIB_TARGETS) $(JDKJRE_LIB_TARGETS) \
 670         $(JDK_IMAGE_DIR)/jre/lib/applet \
 671         $(JDK_DEMO_TARGETS) \
 672         $(JDK_IMAGE_DIR)/jre/lib/meta-index $(JDK_IMAGE_DIR)/jre/lib/ext/meta-index \
 673         $(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
 674         $(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
 675         $(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
 676         $(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \
 677         $(JDK_IMAGE_DIR)/src.zip
 678 
 679 jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \
 680          $(JRE_OVERLAY_INFO_FILE) $(JRE_OVERLAY_STRIP_LIST)
 681 
 682 jdk-overlay-image: $(JDK_OVERLAY_BIN_TARGETS) $(JDKJRE_OVERLAY_BIN_TARGETS) \
 683         $(JDK_OVERLAY_LIB_TARGETS) $(JDKJRE_OVERLAY_LIB_TARGETS) \
 684         $(JDK_OVERLAY_DEMO_TARGETS) $(JDK_OVERLAY_INFO_FILE) \
 685         $(JDKJRE_OVERLAY_STRIP_LIST) $(JDK_OVERLAY_BIN_STRIP_LIST) 
 686 
 687 ifneq ($(PROFILE),)
 688 # Files in lib$(PROFILE) are excluded from the generic copying routines so
 689 # we have to add them back in here
 690 $(foreach f,$(CUSTOM_PROFILE_JARS),\
 691     $(eval $(call AddFileToCopy,$(IMAGES_OUTPUTDIR)/lib$(PROFILE),$(JRE_IMAGE_DIR)/lib,$f,JRE_LIB_TARGETS)))
 692 
 693 profile-image1:
 694         @$(ECHO) JRE_BIN_LIST = $(JRE_BIN_LIST)
 695         @$(ECHO) NOT_JRE_BIN_FILES = $(NOT_JRE_BIN_FILES)
 696 
 697 profile-image: $(JRE_BIN_TARGETS) $(JRE_LIB_TARGETS) \
 698         $(JRE_IMAGE_DIR)/lib/meta-index $(JRE_IMAGE_DIR)/lib/ext/meta-index \
 699         $(JRE_INFO_FILE) $(JRE_STRIP_LIST)
 700 
 701 .PHONY: profile-image
 702 
 703 endif # Profile
 704 
 705 ################################################################################
 706 
 707 .PHONY: default images jre-image jdk-image
makefiles/Images.gmk
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File