common/makefiles/Jprt.gmk

changeset 839
174a54ce39c4
parent 806
5ec3c4948863
equal deleted inserted replaced
838:ec48d637778a 839:174a54ce39c4
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 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 22 # or visit www.oracle.com if you need additional information or have any
23 # questions. 23 # questions.
24 # 24 #
25 25
26 # This file is included by the root NewerMakefile and contains targets 26 # This file is included by the root NewerMakefile and contains targets
27 # and utilities needed by JPRT. 27 # and utilities needed by JPRT.
28 28
29 # Utilities used in this Makefile. Most of this makefile executes without 29 # Utilities used in this Makefile. Most of this makefile executes without
30 # the context of a spec file from configure. 30 # the context of a spec file from configure.
31 CAT=cat 31 CAT=cat
34 ECHO=echo 34 ECHO=echo
35 MKDIR=mkdir 35 MKDIR=mkdir
36 PRINTF=printf 36 PRINTF=printf
37 PWD=pwd 37 PWD=pwd
38 # Insure we have a path that looks like it came from pwd 38 # Insure we have a path that looks like it came from pwd
39 # (This is mostly for Windows sake and drive letters) 39 # (This is mostly for Windows sake and drive letters)
40 define UnixPath # path 40 define UnixPath # path
41 $(shell (cd "$1" && $(PWD))) 41 $(shell (cd "$1" && $(PWD)))
42 endef 42 endef
43 43
44 BUILD_DIR_ROOT:=$(root_dir)/build 44 BUILD_DIR_ROOT:=$(root_dir)/build
45 45
46 ifdef OPENJDK 46 ifdef OPENJDK
47 OPEN_BUILD=true 47 OPEN_BUILD=true
48 else 48 else
49 OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \ 49 OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \
50 $(wildcard $(root_dir)/jdk/make/closed), \ 50 $(wildcard $(root_dir)/jdk/make/closed), \
51 $(wildcard $(root_dir)/jdk/test/closed), \ 51 $(wildcard $(root_dir)/jdk/test/closed), \
52 $(wildcard $(root_dir)/hotspot/src/closed), \ 52 $(wildcard $(root_dir)/hotspot/src/closed), \
53 $(wildcard $(root_dir)/hotspot/make/closed), \ 53 $(wildcard $(root_dir)/hotspot/make/closed), \
54 $(wildcard $(root_dir)/hotspot/test/closed)), \ 54 $(wildcard $(root_dir)/hotspot/test/closed)), \
55 false,true) 55 false,true)
56 endif 56 endif
57 57
58 HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false) 58 HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false)
59 59
60 ########################################################################### 60 ###########################################################################
61 # To help in adoption of the new configure&&make build process, a bridge 61 # To help in adoption of the new configure&&make build process, a bridge
62 # build will use the old settings to run configure and do the build. 62 # build will use the old settings to run configure and do the build.
63 63
64 # Build with the configure bridge. After running configure, restart make 64 # Build with the configure bridge. After running configure, restart make
65 # to parse the new spec file. 65 # to parse the new spec file.
66 BRIDGE_TARGETS := all 66 BRIDGE_TARGETS := all
67 # Add bootcycle-images target if legacy variable is set. 67 # Add bootcycle-images target if legacy variable is set.
83 # Use this file to only change when obvious things have changed 83 # Use this file to only change when obvious things have changed
84 $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC 84 $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC
85 $(RM) $@.tmp 85 $(RM) $@.tmp
86 $(MKDIR) -p $(BUILD_DIR_ROOT) 86 $(MKDIR) -p $(BUILD_DIR_ROOT)
87 @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp 87 @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp
88 ifdef ARCH_DATA_MODEL 88 ifdef ARCH_DATA_MODEL
89 @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp 89 @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp
90 endif 90 endif
91 ifeq ($(ARCH_DATA_MODEL),32) 91 ifeq ($(ARCH_DATA_MODEL),32)
92 @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp 92 @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp
93 endif 93 endif
94 ifdef ALT_PARALLEL_COMPILE_JOBS 94 ifdef ALT_PARALLEL_COMPILE_JOBS
95 @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp 95 @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp
96 endif 96 endif
97 ifdef ALT_BOOTDIR 97 ifdef ALT_BOOTDIR
98 @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp 98 @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp
99 endif 99 endif
100 ifdef ALT_CUPS_HEADERS_PATH 100 ifdef ALT_CUPS_HEADERS_PATH
101 @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp 101 @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp
102 endif 102 endif
103 ifdef ALT_FREETYPE_HEADERS_PATH 103 ifdef ALT_FREETYPE_HEADERS_PATH
104 @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp 104 @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp
105 endif 105 endif
106 ifdef ENABLE_SJAVAC 106 ifdef ENABLE_SJAVAC
107 @$(ECHO) " --enable-sjavac" >> $@.tmp 107 @$(ECHO) " --enable-sjavac" >> $@.tmp
108 endif 108 endif
109 ifeq ($(HOTSPOT_AVAILABLE),false) 109 ifeq ($(HOTSPOT_AVAILABLE),false)
110 ifdef ALT_JDK_IMPORT_PATH 110 ifdef ALT_JDK_IMPORT_PATH
111 @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp 111 @$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> $@.tmp
112 endif 112 endif
113 endif 113 endif
114 ifeq ($(OPEN_BUILD),true) 114 ifeq ($(OPEN_BUILD),true)
115 @$(ECHO) " --enable-openjdk-only " >> $@.tmp 115 @$(ECHO) " --enable-openjdk-only " >> $@.tmp
116 else 116 else
117 # Todo: move to closed? 117 # Todo: move to closed?
118 ifdef ALT_MOZILLA_HEADERS_PATH 118 ifdef ALT_MOZILLA_HEADERS_PATH
119 @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp 119 @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp
120 endif 120 endif
121 ifdef ALT_JUNIT_DIR 121 ifdef ALT_JUNIT_DIR
122 @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp 122 @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp
123 endif 123 endif
124 ifdef ANT_HOME 124 ifdef ANT_HOME
125 @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp 125 @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp
126 endif 126 endif
127 ifdef ALT_JAVAFX_ZIP_DIR 127 ifdef ALT_JAVAFX_ZIP_DIR
128 @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp 128 @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp
129 endif 129 endif
130 ifdef ALT_JMC_ZIP_DIR 130 ifdef ALT_JMC_ZIP_DIR
131 @$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp 131 @$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp
132 endif 132 endif
133 ifdef ALT_WIXDIR 133 ifdef ALT_WIXDIR
134 @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp 134 @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp
135 endif 135 endif
136 ifdef ALT_INSTALL_LZMA_PATH 136 ifdef ALT_INSTALL_LZMA_PATH
137 @$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp 137 @$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp
138 endif 138 endif
139 ifdef ALT_INSTALL_UPX_PATH 139 ifdef ALT_INSTALL_UPX_PATH
140 @$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp 140 @$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp
141 endif 141 endif
142 ifdef ALT_INSTALL_UPX_FILENAME 142 ifdef ALT_INSTALL_UPX_FILENAME
143 @$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp 143 @$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp
144 endif 144 endif
145 ifdef ALT_CCSS_SIGNING_DIR 145 ifdef ALT_CCSS_SIGNING_DIR
146 @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp 146 @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp
147 endif 147 endif
148 ifdef ALT_SLASH_JAVA 148 ifdef ALT_SLASH_JAVA
149 @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp 149 @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp
150 endif 150 endif
151 ifdef ALT_SPARKLE_FRAMEWORK_DIR 151 ifdef ALT_SPARKLE_FRAMEWORK_DIR
152 @$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp 152 @$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> $@.tmp
153 endif 153 endif
154 endif 154 endif
155 @if [ -f $@ ] ; then \ 155 @if [ -f $@ ] ; then \
156 if ! $(CMP) $@ $@.tmp > /dev/null ; then \ 156 if ! $(CMP) $@ $@.tmp > /dev/null ; then \
157 $(CP) $@.tmp $@ ; \ 157 $(CP) $@.tmp $@ ; \
158 fi ; \ 158 fi ; \
159 else \ 159 else \
160 $(CP) $@.tmp $@ ; \ 160 $(CP) $@.tmp $@ ; \
161 fi 161 fi
162 $(RM) $@.tmp 162 $(RM) $@.tmp
163 163
164 PHONY_LIST += bridge2configure bridgeBuild 164 PHONY_LIST += bridge2configure bridgeBuild
165 165
166 ########################################################################### 166 ###########################################################################
168 168
169 ifndef JPRT_ARCHIVE_BUNDLE 169 ifndef JPRT_ARCHIVE_BUNDLE
170 JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip 170 JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
171 endif 171 endif
172 ifndef JPRT_ARCHIVE_INSTALL_BUNDLE 172 ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
173 JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip 173 JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
174 endif 174 endif
175 175
176 # These targets execute in a SPEC free context, before calling bridgeBuild 176 # These targets execute in a SPEC free context, before calling bridgeBuild
177 # to generate the SPEC. 177 # to generate the SPEC.
178 jprt_build_product: DEBUG_LEVEL=release 178 jprt_build_product: DEBUG_LEVEL=release
210 bundles-only: start-make 210 bundles-only: start-make
211 @$(call TargetEnter) 211 @$(call TargetEnter)
212 $(MKDIR) -p $(BUILD_OUTPUT)/bundles 212 $(MKDIR) -p $(BUILD_OUTPUT)/bundles
213 $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip . 213 $(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
214 $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip . 214 $(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -y -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
215 if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \ 215 if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
216 $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \ 216 $(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
217 fi 217 fi
218 @$(call TargetExit) 218 @$(call TargetExit)
219 219
220 # Copy images to one unified location regardless of platform etc. 220 # Copy images to one unified location regardless of platform etc.
221 final-images: all final-images-only 221 final-images: all final-images-only
222 final-images-only: start-make 222 final-images-only: start-make
224 $(RM) -r $(BUILD_OUTPUT)/final-images 224 $(RM) -r $(BUILD_OUTPUT)/final-images
225 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR) 225 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)
226 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR) 226 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)
227 $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/ 227 $(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
228 $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/ 228 $(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
229 ifeq ($(OPENJDK_TARGET_OS),macosx) 229 ifeq ($(OPENJDK_TARGET_OS),macosx)
230 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR) 230 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)
231 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR) 231 $(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)
232 $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/ 232 $(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/
233 $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/ 233 $(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/
234 endif 234 endif
235 @$(call TargetExit) 235 @$(call TargetExit)
236 236
237 237
238 # Keep track of phony targets 238 # Keep track of phony targets
239 PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \ 239 PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \
240 jprt_build_generic bundles jprt_bundle \ 240 jprt_build_generic bundles jprt_bundle \
241 final-images final-images-only 241 final-images final-images-only
242 242
243 ########################################################################### 243 ###########################################################################
244 # Phony targets 244 # Phony targets
245 .PHONY: $(PHONY_LIST) 245 .PHONY: $(PHONY_LIST)
246 246

mercurial