common/makefiles/Jprt.gmk

Fri, 04 Jan 2013 17:05:13 +0100

author
erikj
date
Fri, 04 Jan 2013 17:05:13 +0100
changeset 567
c874a8a27933
parent 564
befbad2e4d87
child 578
6e822b534678
permissions
-rw-r--r--

8005597: build-infra: bridgeBuild broken for pure openjdk build
Reviewed-by: tbell

erikj@559 1 #
erikj@559 2 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
erikj@559 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@559 4 #
erikj@559 5 # This code is free software; you can redistribute it and/or modify it
erikj@559 6 # under the terms of the GNU General Public License version 2 only, as
erikj@559 7 # published by the Free Software Foundation. Oracle designates this
erikj@559 8 # particular file as subject to the "Classpath" exception as provided
erikj@559 9 # by Oracle in the LICENSE file that accompanied this code.
erikj@559 10 #
erikj@559 11 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@559 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@559 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@559 14 # version 2 for more details (a copy is included in the LICENSE file that
erikj@559 15 # accompanied this code).
erikj@559 16 #
erikj@559 17 # You should have received a copy of the GNU General Public License version
erikj@559 18 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@559 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@559 20 #
erikj@559 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@559 22 # or visit www.oracle.com if you need additional information or have any
erikj@559 23 # questions.
erikj@559 24 #
erikj@559 25
erikj@559 26 # This file is included by the root NewerMakefile and contains targets
erikj@559 27 # and utilities needed by JPRT.
erikj@559 28
erikj@559 29 # Utilities used in this Makefile
erikj@559 30 CAT=cat
erikj@559 31 CMP=cmp
erikj@559 32 CP=cp
erikj@559 33 ECHO=echo
erikj@559 34 MKDIR=mkdir
erikj@559 35 PRINTF=printf
erikj@559 36 PWD=pwd
erikj@559 37 # Insure we have a path that looks like it came from pwd
erikj@559 38 # (This is mostly for Windows sake and drive letters)
erikj@559 39 define UnixPath # path
erikj@559 40 $(shell (cd "$1" && $(PWD)))
erikj@559 41 endef
erikj@559 42
erikj@559 43 BUILD_DIR_ROOT:=$(root_dir)/build
erikj@559 44
erikj@567 45 # Appears to be an open build
erikj@567 46 OPEN_BUILD := \
erikj@567 47 $(shell \
erikj@567 48 if [ -d $(root_dir)/jdk/src/closed \
erikj@567 49 -o -d $(root_dir)/jdk/make/closed \
erikj@567 50 -o -d $(root_dir)/jdk/test/closed \
erikj@567 51 -o -d $(root_dir)/hotspot/src/closed \
erikj@567 52 -o -d $(root_dir)/hotspot/make/closed \
erikj@567 53 -o -d $(root_dir)/hotspot/test/closed ] ; then \
erikj@567 54 echo "false"; \
erikj@567 55 else \
erikj@567 56 echo "true"; \
erikj@567 57 fi \
erikj@567 58 )
erikj@567 59 ifdef OPENJDK
erikj@567 60 OPEN_BUILD=true
erikj@567 61 endif
erikj@567 62
erikj@559 63 ###########################################################################
erikj@559 64 # To help in adoption of the new configure&&make build process, a bridge
erikj@559 65 # build will use the old settings to run configure and do the build.
erikj@559 66
erikj@559 67 # Build with the configure bridge. After running configure, restart make
erikj@559 68 # to parse the new spec file.
erikj@559 69 BRIDGE_TARGETS := all
erikj@559 70 bridgeBuild: bridge2configure
erikj@559 71 @cd $(root_dir) && $(MAKE) -f NewMakefile.gmk $(BRIDGE_TARGETS)
erikj@559 72
erikj@559 73 # Bridge from old Makefile ALT settings to configure options
erikj@559 74 bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts
erikj@559 75 bash ./configure $(strip $(shell $(CAT) $<))
erikj@559 76
erikj@559 77 # Create a file with configure options created from old Makefile mechanisms.
erikj@559 78 $(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest
erikj@559 79 $(RM) $@
erikj@559 80 $(CP) $< $@
erikj@559 81
erikj@559 82 # Use this file to only change when obvious things have changed
erikj@559 83 $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC
erikj@559 84 $(RM) $@.tmp
erikj@559 85 $(MKDIR) -p $(BUILD_DIR_ROOT)
erikj@559 86 @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp
erikj@559 87 ifdef ARCH_DATA_MODEL
erikj@559 88 @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp
erikj@559 89 endif
erikj@559 90 ifeq ($(ARCH_DATA_MODEL),32)
erikj@559 91 @$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp
erikj@559 92 endif
erikj@559 93 ifdef ALT_PARALLEL_COMPILE_JOBS
erikj@559 94 @$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp
erikj@559 95 endif
erikj@559 96 ifdef ALT_BOOTDIR
erikj@559 97 @$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp
erikj@559 98 endif
erikj@559 99 ifdef ALT_CUPS_HEADERS_PATH
erikj@559 100 @$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp
erikj@559 101 endif
erikj@559 102 ifdef ALT_FREETYPE_HEADERS_PATH
erikj@559 103 @$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp
erikj@559 104 endif
erikj@567 105 ifeq ($(OPEN_BUILD),true)
erikj@559 106 @$(ECHO) " --enable-openjdk-only " >> $@.tmp
erikj@567 107 else
erikj@567 108 # Todo: move to closed?
erikj@567 109 ifdef ALT_MOZILLA_HEADERS_PATH
erikj@559 110 @$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp
erikj@567 111 endif
erikj@567 112 ifdef ALT_JUNIT_DIR
erikj@559 113 @$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp
erikj@567 114 endif
erikj@567 115 ifdef ANT_HOME
erikj@559 116 @$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp
erikj@567 117 endif
erikj@567 118 ifdef ALT_JAVAFX_ZIP_DIR
erikj@564 119 @$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp
erikj@567 120 endif
erikj@567 121 ifdef ALT_WIXDIR
erikj@564 122 @$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp
erikj@567 123 endif
erikj@567 124 ifdef ALT_CCSS_SIGNING_DIR
erikj@564 125 @$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp
erikj@567 126 endif
erikj@567 127 ifdef ALT_SLASH_JAVA
erikj@559 128 @$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp
erikj@567 129 endif
erikj@559 130 endif
erikj@559 131 @if [ -f $@ ] ; then \
erikj@559 132 if ! $(CMP) $@ $@.tmp > /dev/null ; then \
erikj@559 133 $(CP) $@.tmp $@ ; \
erikj@559 134 fi ; \
erikj@559 135 else \
erikj@559 136 $(CP) $@.tmp $@ ; \
erikj@559 137 fi
erikj@559 138 $(RM) $@.tmp
erikj@559 139
erikj@559 140 PHONY_LIST += bridge2configure bridgeBuild
erikj@559 141
erikj@559 142 ###########################################################################
erikj@559 143 # JPRT targets
erikj@559 144
erikj@559 145 ifndef JPRT_ARCHIVE_BUNDLE
erikj@559 146 JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
erikj@559 147 endif
erikj@559 148
erikj@559 149 # These targets execute in a SPEC free context, before calling bridgeBuild
erikj@559 150 # to generate the SPEC.
erikj@559 151 jprt_build_product: DEBUG_LEVEL=release
erikj@559 152 jprt_build_product: BUILD_DIRNAME=*-release
erikj@559 153 jprt_build_product: jprt_build_generic
erikj@559 154
erikj@559 155 jprt_build_fastdebug: DEBUG_LEVEL=fastdebug
erikj@559 156 jprt_build_fastdebug: BUILD_DIRNAME=*-fastdebug
erikj@559 157 jprt_build_fastdebug: jprt_build_generic
erikj@559 158
erikj@559 159 jprt_build_debug: DEBUG_LEVEL=slowdebug
erikj@559 160 jprt_build_debug: BUILD_DIRNAME=*-debug
erikj@559 161 jprt_build_debug: jprt_build_generic
erikj@559 162
erikj@559 163 jprt_build_generic: BRIDGE_TARGETS+=jprt_bundle
erikj@559 164 jprt_build_generic: bridgeBuild
erikj@559 165
erikj@559 166 # This target must be called in the context of a SPEC file
erikj@559 167 jprt_bundle: $(JPRT_ARCHIVE_BUNDLE)
erikj@559 168 @$(call CheckIfMakeAtEnd)
erikj@559 169
erikj@559 170 # This target must be called in the context of a SPEC file
erikj@559 171 $(JPRT_ARCHIVE_BUNDLE): bundles
erikj@559 172 $(MKDIR) -p $(@D)
erikj@559 173 $(RM) $@
erikj@559 174 $(CP) $(BUILD_OUTPUT)/bundles/j2sdk-image.zip $@
erikj@559 175
erikj@559 176 # This target must be called in the context of a SPEC file
erikj@559 177 bundles: all
erikj@559 178 @$(call TargetEnter)
erikj@559 179 $(MKDIR) -p $(BUILD_OUTPUT)/bundles
erikj@559 180 $(CD) $(IMAGES_OUTPUTDIR)/j2sdk-image && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2sdk-image.zip .
erikj@559 181 $(CD) $(IMAGES_OUTPUTDIR)/j2re-image && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2re-image.zip .
erikj@559 182 @$(call TargetExit)
erikj@559 183
erikj@559 184 # Keep track of phony targets
erikj@559 185 PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \
erikj@559 186 jprt_build_generic bundles jprt_bundle
erikj@559 187
erikj@559 188 ###########################################################################
erikj@559 189 # Phony targets
erikj@559 190 .PHONY: $(PHONY_LIST)
erikj@559 191
erikj@559 192 # Force target
erikj@559 193 FRC:

mercurial