annotate common/makefiles/Jprt.gmk @ 562:befbad2e4d87

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