--- a/jdk/makefiles/Images.gmk Wed Jul 05 18:14:56 2017 +0200
+++ b/jdk/makefiles/Images.gmk Tue Jul 03 16:10:44 2012 -0700
@@ -34,15 +34,20 @@
images: jre-image jdk-image
-ifeq ($(HOST_OS),solaris)
+ifeq ($(OPENJDK_TARGET_OS),solaris)
define install-file
$(MKDIR) -p $(@D)
- $(CP) -r -P '$<' '$(@D)'
+ $(CP) -f -r -P '$<' '$(@D)'
+endef
+else ifeq ($(OPENJDK_TARGET_OS),macosx)
+define install-file
+ $(MKDIR) -p $(@D)
+ $(CP) -fpRP '$<' '$@'
endef
else
define install-file
$(MKDIR) -p $(@D)
- $(CP) -P '$<' '$@'
+ $(CP) -fP '$<' '$@'
endef
endif
@@ -67,7 +72,7 @@
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
-NOT_JRE_BIN_FILES = \
+NOT_JRE_BIN_FILES := \
appletviewer$(EXE_SUFFIX) \
extcheck$(EXE_SUFFIX) \
idlj$(EXE_SUFFIX) \
@@ -107,7 +112,12 @@
# Find all files in bin dir
ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f)
-ifeq ($(HOST_OS),windows)
+
+# For unknown reason the debuginfo files for binaries are not put into images
+# e.g filter them out
+ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
+
+ifeq ($(OPENJDK_TARGET_OS),windows)
JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
else
JDK_BIN_LIST := $(ALL_BIN_LIST)
@@ -147,7 +157,7 @@
ct.sym
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
JDK_LIB_FILES += jexec
endif
@@ -236,14 +246,21 @@
wsimport.1 \
xjc.1
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/linux/doc
MAN1_SUBDIR:=man
endif
-ifeq ($(HOST_OS), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/solaris/doc
MAN1_SUBDIR:=sun/man/man1
endif
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+ MAN_SRC_DIR:=$(JDK_TOPDIR)/src/bsd/doc
+ MAN1_SUBDIR:=man
+ JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES))
+ JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES))
+endif
+
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
@@ -286,7 +303,7 @@
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(call install-ja-manpage,PCK)
-ifeq ($(HOST_OS), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
@@ -302,7 +319,17 @@
$(MKDIR) -p $(@D)
$(TOUCH) $@
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
+ $(JRE_IMAGE_DIR)/man/ja:
+ $(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+ $(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
+
+ $(JDK_IMAGE_DIR)/man/ja:
+ $(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
+ $(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
+endif
+
+ifeq ($(OPENJDK_TARGET_OS), macosx)
$(JRE_IMAGE_DIR)/man/ja:
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
@@ -312,7 +339,7 @@
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
endif
-ifeq ($(HOST_OS), linux)
+ifeq ($(OPENJDK_TARGET_OS), linux)
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
$(JRE_IMAGE_DIR)/man/ja
@@ -322,7 +349,7 @@
$(JDK_IMAGE_DIR)/man/ja
endif
-ifeq ($(HOST_OS), solaris)
+ifeq ($(OPENJDK_TARGET_OS), solaris)
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
@@ -334,6 +361,16 @@
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES))
endif
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+ JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
+ $(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
+ $(JRE_IMAGE_DIR)/man/ja
+
+ JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
+ $(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
+ $(JDK_IMAGE_DIR)/man/ja
+endif
+
################################################################################
# /demo dir
@@ -383,6 +420,7 @@
$(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
$(install-file)
+ $(CHMOD) 644 $(@)
JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\
$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*.zip" ! -name "*demo*")) \
@@ -411,7 +449,7 @@
else
JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt
- ifeq ($(HOST_OS), windows)
+ ifeq ($(OPENJDK_TARGET_OS), windows)
JRE_DOC_FILES += README.txt
else
JRE_DOC_FILES += README
@@ -432,32 +470,39 @@
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
+ $(CHMOD) 444 $(@)
$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
+ $(CHMOD) 444 $(@)
$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D)
$(CP) $< $@
+ $(CHMOD) 444 $(@)
$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D)
$(CP) $< $@
+ $(CHMOD) 444 $(@)
$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
+ $(CHMOD) 444 $(@)
$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
+ $(CHMOD) 444 $(@)
$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(install-file)
+ $(CHMOD) 444 $(@)
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
@@ -500,7 +545,7 @@
# Post processing (strip etc)
ifneq ($(POST_STRIP_CMD),)
- ifeq ($(HOST_OS), windows)
+ ifeq ($(OPENJDK_TARGET_OS), windows)
EXEC_LIST:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \
-o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)")
else
@@ -510,17 +555,43 @@
| $(EGREP) 'ELF' | $(CUT) -d':' -f1)
endif
# Filter out non JRE files and convert to unique touch files to depend on
- JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip/%.stripped,\
+ JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped,\
+ $(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
+
+ JDK_JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
+ $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
+ JDK_BIN_EXEC_TOUCH_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
+ $(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
+ $(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
+
# Setup a rule for stripping files based on touch files
- $(IMAGES_OUTPUTDIR)/_strip/%.stripped: $(JRE_IMAGE_DIR)/%
+ $(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped: $(JRE_IMAGE_DIR)/%
$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
$(CHMOD) u+w $<
$(POST_STRIP_CMD) $<
$(CHMOD) go-w $<
$(MKDIR) -p $(@D)
$(TOUCH) $@
+
+ $(IMAGES_OUTPUTDIR)/_strip_jdk/bin/%.stripped: $(JDK_IMAGE_DIR)/bin/%
+ $(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
+ $(CHMOD) u+w $<
+ $(POST_STRIP_CMD) $<
+ $(CHMOD) go-w $<
+ $(MKDIR) -p $(@D)
+ $(TOUCH) $@
+
+ # Setup a rule for stripping files based on touch files
+ $(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped: $(JDK_IMAGE_DIR)/jre/%
+ $(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
+ $(CHMOD) u+w $<
+ $(POST_STRIP_CMD) $<
+ $(CHMOD) go-w $<
+ $(MKDIR) -p $(@D)
+ $(TOUCH) $@
+
endif
################################################################################
@@ -538,7 +609,8 @@
$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
- $(JDK_INFO_FILE) $(JDK_IMAGE_DIR)/src.zip
+ $(JDK_INFO_FILE) $(JDK_JRE_EXEC_TOUCH_LIST) $(JDK_BIN_EXEC_TOUCH_LIST) \
+ $(JDK_IMAGE_DIR)/src.zip
################################################################################