common/makefiles/Jprt.gmk

changeset 559
ef6adbf511cc
child 564
befbad2e4d87
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/common/makefiles/Jprt.gmk	Fri Dec 28 09:51:15 2012 +0100
     1.3 @@ -0,0 +1,165 @@
     1.4 +#
     1.5 +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.  Oracle designates this
    1.11 +# particular file as subject to the "Classpath" exception as provided
    1.12 +# by Oracle in the LICENSE file that accompanied this code.
    1.13 +#
    1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 +# version 2 for more details (a copy is included in the LICENSE file that
    1.18 +# accompanied this code).
    1.19 +#
    1.20 +# You should have received a copy of the GNU General Public License version
    1.21 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 +#
    1.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 +# or visit www.oracle.com if you need additional information or have any
    1.26 +# questions.
    1.27 +#
    1.28 +
    1.29 +# This file is included by the root NewerMakefile and contains targets 
    1.30 +# and utilities needed by JPRT.
    1.31 +
    1.32 +# Utilities used in this Makefile
    1.33 +CAT=cat
    1.34 +CMP=cmp
    1.35 +CP=cp
    1.36 +ECHO=echo
    1.37 +MKDIR=mkdir
    1.38 +PRINTF=printf
    1.39 +PWD=pwd
    1.40 +# Insure we have a path that looks like it came from pwd
    1.41 +#   (This is mostly for Windows sake and drive letters)
    1.42 +define UnixPath # path
    1.43 +$(shell (cd "$1" && $(PWD)))
    1.44 +endef
    1.45 +
    1.46 +BUILD_DIR_ROOT:=$(root_dir)/build
    1.47 +
    1.48 +###########################################################################
    1.49 +# To help in adoption of the new configure&&make build process, a bridge
    1.50 +#   build will use the old settings to run configure and do the build.
    1.51 +
    1.52 +# Build with the configure bridge. After running configure, restart make
    1.53 +# to parse the new spec file.
    1.54 +BRIDGE_TARGETS := all
    1.55 +bridgeBuild: bridge2configure
    1.56 +	@cd $(root_dir) && $(MAKE) -f NewMakefile.gmk $(BRIDGE_TARGETS)
    1.57 +
    1.58 +# Bridge from old Makefile ALT settings to configure options
    1.59 +bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts
    1.60 +	bash ./configure $(strip $(shell $(CAT) $<))
    1.61 +
    1.62 +# Create a file with configure options created from old Makefile mechanisms.
    1.63 +$(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest
    1.64 +	$(RM) $@
    1.65 +	$(CP) $< $@
    1.66 +
    1.67 +# Use this file to only change when obvious things have changed
    1.68 +$(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC
    1.69 +	$(RM) $@.tmp
    1.70 +	$(MKDIR) -p $(BUILD_DIR_ROOT)
    1.71 +	@$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp
    1.72 +ifdef ARCH_DATA_MODEL
    1.73 +	@$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp
    1.74 +endif
    1.75 +ifeq ($(ARCH_DATA_MODEL),32)
    1.76 +	@$(ECHO) " --with-jvm-variants=client,server " >> $@.tmp
    1.77 +endif
    1.78 +ifdef ALT_PARALLEL_COMPILE_JOBS
    1.79 +	@$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp
    1.80 +endif
    1.81 +ifdef ALT_BOOTDIR
    1.82 +	@$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp
    1.83 +endif
    1.84 +ifdef ALT_CUPS_HEADERS_PATH
    1.85 +	@$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp
    1.86 +endif
    1.87 +ifdef ALT_FREETYPE_HEADERS_PATH
    1.88 +	@$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp
    1.89 +endif
    1.90 +ifdef OPENJDK
    1.91 +	@$(ECHO) " --enable-openjdk-only " >> $@.tmp
    1.92 +endif
    1.93 +# Todo: move to closed?
    1.94 +ifdef ALT_MOZILLA_HEADERS_PATH
    1.95 +	@$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> $@.tmp
    1.96 +endif
    1.97 +ifdef ALT_JUNIT_DIR
    1.98 +	@$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> $@.tmp
    1.99 +endif
   1.100 +ifdef ANT_HOME
   1.101 +	@$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> $@.tmp
   1.102 +endif
   1.103 +ifdef ALT_SLASH_JAVA
   1.104 +	@$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> $@.tmp
   1.105 +endif
   1.106 +	@if [ -f $@ ] ; then \
   1.107 +          if ! $(CMP) $@ $@.tmp > /dev/null ; then \
   1.108 +            $(CP) $@.tmp $@ ; \
   1.109 +          fi ; \
   1.110 +        else \
   1.111 +          $(CP) $@.tmp $@ ; \
   1.112 +        fi
   1.113 +	$(RM) $@.tmp
   1.114 +
   1.115 +PHONY_LIST += bridge2configure bridgeBuild
   1.116 +
   1.117 +###########################################################################
   1.118 +# JPRT targets
   1.119 +
   1.120 +ifndef JPRT_ARCHIVE_BUNDLE
   1.121 +  JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
   1.122 +endif
   1.123 +
   1.124 +# These targets execute in a SPEC free context, before calling bridgeBuild
   1.125 +# to generate the SPEC.
   1.126 +jprt_build_product: DEBUG_LEVEL=release
   1.127 +jprt_build_product: BUILD_DIRNAME=*-release
   1.128 +jprt_build_product: jprt_build_generic
   1.129 +
   1.130 +jprt_build_fastdebug: DEBUG_LEVEL=fastdebug
   1.131 +jprt_build_fastdebug: BUILD_DIRNAME=*-fastdebug
   1.132 +jprt_build_fastdebug: jprt_build_generic
   1.133 +
   1.134 +jprt_build_debug: DEBUG_LEVEL=slowdebug
   1.135 +jprt_build_debug: BUILD_DIRNAME=*-debug
   1.136 +jprt_build_debug: jprt_build_generic
   1.137 +
   1.138 +jprt_build_generic: BRIDGE_TARGETS+=jprt_bundle
   1.139 +jprt_build_generic: bridgeBuild
   1.140 +
   1.141 +# This target must be called in the context of a SPEC file
   1.142 +jprt_bundle: $(JPRT_ARCHIVE_BUNDLE)
   1.143 +	@$(call CheckIfMakeAtEnd)
   1.144 +
   1.145 +# This target must be called in the context of a SPEC file
   1.146 +$(JPRT_ARCHIVE_BUNDLE): bundles
   1.147 +	$(MKDIR) -p $(@D)
   1.148 +	$(RM) $@
   1.149 +	$(CP) $(BUILD_OUTPUT)/bundles/j2sdk-image.zip $@
   1.150 +
   1.151 +# This target must be called in the context of a SPEC file
   1.152 +bundles: all
   1.153 +	@$(call TargetEnter)
   1.154 +	$(MKDIR) -p $(BUILD_OUTPUT)/bundles
   1.155 +	$(CD) $(IMAGES_OUTPUTDIR)/j2sdk-image && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2sdk-image.zip .
   1.156 +	$(CD) $(IMAGES_OUTPUTDIR)/j2re-image && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2re-image.zip .
   1.157 +	@$(call TargetExit)
   1.158 +
   1.159 +# Keep track of phony targets
   1.160 +PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \
   1.161 +              jprt_build_generic bundles jprt_bundle
   1.162 +
   1.163 +###########################################################################
   1.164 +# Phony targets
   1.165 +.PHONY: $(PHONY_LIST)
   1.166 +
   1.167 +# Force target
   1.168 +FRC:

mercurial