aoqi@0: # aoqi@0: # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: # aoqi@0: # This code is free software; you can redistribute it and/or modify it aoqi@0: # under the terms of the GNU General Public License version 2 only, as aoqi@0: # published by the Free Software Foundation. Oracle designates this aoqi@0: # particular file as subject to the "Classpath" exception as provided aoqi@0: # by Oracle in the LICENSE file that accompanied this code. aoqi@0: # aoqi@0: # This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: # version 2 for more details (a copy is included in the LICENSE file that aoqi@0: # accompanied this code). aoqi@0: # aoqi@0: # You should have received a copy of the GNU General Public License version aoqi@0: # 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: # aoqi@0: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: # or visit www.oracle.com if you need additional information or have any aoqi@0: # questions. aoqi@0: # aoqi@0: aoqi@0: ################################################################ aoqi@0: # aoqi@0: # Check that GNU make and cygwin are recent enough. aoqi@0: # Setup common utility functions. aoqi@0: # aoqi@0: ################################################################ aoqi@0: aoqi@0: ifndef _MAKEBASE_GMK aoqi@0: _MAKEBASE_GMK := 1 aoqi@0: aoqi@0: # If the variable that you want to send to stdout for piping into a file or otherwise, aoqi@0: # is potentially long, for example the a list of file paths, eg a list of all package directories. aoqi@0: # Then you need to use ListPathsSafely, which optimistically splits the output into several shell aoqi@0: # calls as well as use compression on recurrent file paths segments, to get around the potential aoqi@0: # command line length problem that exists in cygwin and other shells. aoqi@0: compress_pre:=$(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-pre-compress.incl)) aoqi@0: compress_post:=$(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-post-compress.incl)) aoqi@0: compress_paths=$(compress_pre)\ aoqi@0: $(subst $(SRC_ROOT),X97,\ aoqi@0: $(subst $(OUTPUT_ROOT),X98,\ aoqi@0: $(subst X,X00,\ aoqi@0: $(subst $(SPACE),\n,$(strip $1)))))\ aoqi@0: $(compress_post) aoqi@0: aoqi@0: decompress_paths=$(SED) -f $(SRC_ROOT)/make/common/support/ListPathsSafely-uncompress.sed -e 's|X99|\\n|g' \ aoqi@0: -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \ aoqi@0: -e 's|X00|X|g' | tr '\n' '$2' aoqi@0: aoqi@0: define ListPathsSafely_If aoqi@0: $(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1))))) aoqi@0: endef aoqi@0: aoqi@0: define ListPathsSafely_Printf aoqi@0: $(if $(strip $($1_LPS$4)),$(if $(findstring $(LOG_LEVEL),trace),,@)printf \ aoqi@0: -- "$(strip $($1_LPS$4))\n" | $(decompress_paths) $3) aoqi@0: endef aoqi@0: aoqi@0: # Receipt example: aoqi@0: # rm -f thepaths aoqi@0: # $(call ListPathsSafely,THEPATHS,\n, >> thepaths) aoqi@0: # The \n argument means translate spaces into \n aoqi@0: # if instead , , (a space) is supplied, then spaces remain spaces. aoqi@0: define ListPathsSafely aoqi@0: $(if $(word 16001,$($1)),$(error Cannot list safely more than 16000 paths. $1 has $(words $($1)) paths!)) aoqi@0: $(ECHO) $(LOG_DEBUG) Writing $(words $($1)) paths to '$3' aoqi@0: $(call ListPathsSafely_If,$1,$2,1,250) aoqi@0: $(call ListPathsSafely_If,$1,$2,251,500) aoqi@0: $(call ListPathsSafely_If,$1,$2,501,750) aoqi@0: $(call ListPathsSafely_If,$1,$2,751,1000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,1001,1250) aoqi@0: $(call ListPathsSafely_If,$1,$2,1251,1500) aoqi@0: $(call ListPathsSafely_If,$1,$2,1501,1750) aoqi@0: $(call ListPathsSafely_If,$1,$2,1751,2000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,2001,2250) aoqi@0: $(call ListPathsSafely_If,$1,$2,2251,2500) aoqi@0: $(call ListPathsSafely_If,$1,$2,2501,2750) aoqi@0: $(call ListPathsSafely_If,$1,$2,2751,3000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,3001,3250) aoqi@0: $(call ListPathsSafely_If,$1,$2,3251,3500) aoqi@0: $(call ListPathsSafely_If,$1,$2,3501,3750) aoqi@0: $(call ListPathsSafely_If,$1,$2,3751,4000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,4001,4250) aoqi@0: $(call ListPathsSafely_If,$1,$2,4251,4500) aoqi@0: $(call ListPathsSafely_If,$1,$2,4501,4750) aoqi@0: $(call ListPathsSafely_If,$1,$2,4751,5000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,5001,5250) aoqi@0: $(call ListPathsSafely_If,$1,$2,5251,5500) aoqi@0: $(call ListPathsSafely_If,$1,$2,5501,5750) aoqi@0: $(call ListPathsSafely_If,$1,$2,5751,6000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,6001,6250) aoqi@0: $(call ListPathsSafely_If,$1,$2,6251,6500) aoqi@0: $(call ListPathsSafely_If,$1,$2,6501,6750) aoqi@0: $(call ListPathsSafely_If,$1,$2,6751,7000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,7001,7250) aoqi@0: $(call ListPathsSafely_If,$1,$2,7251,7500) aoqi@0: $(call ListPathsSafely_If,$1,$2,7501,7750) aoqi@0: $(call ListPathsSafely_If,$1,$2,7751,8000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,8001,8250) aoqi@0: $(call ListPathsSafely_If,$1,$2,8251,8500) aoqi@0: $(call ListPathsSafely_If,$1,$2,8501,8750) aoqi@0: $(call ListPathsSafely_If,$1,$2,8751,9000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,9001,9250) aoqi@0: $(call ListPathsSafely_If,$1,$2,9251,9500) aoqi@0: $(call ListPathsSafely_If,$1,$2,9501,9750) aoqi@0: $(call ListPathsSafely_If,$1,$2,9751,10000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,10001,10250) aoqi@0: $(call ListPathsSafely_If,$1,$2,10251,10500) aoqi@0: $(call ListPathsSafely_If,$1,$2,10501,10750) aoqi@0: $(call ListPathsSafely_If,$1,$2,10751,11000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,11001,11250) aoqi@0: $(call ListPathsSafely_If,$1,$2,11251,11500) aoqi@0: $(call ListPathsSafely_If,$1,$2,11501,11750) aoqi@0: $(call ListPathsSafely_If,$1,$2,11751,12000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,12001,12250) aoqi@0: $(call ListPathsSafely_If,$1,$2,12251,12500) aoqi@0: $(call ListPathsSafely_If,$1,$2,12501,12750) aoqi@0: $(call ListPathsSafely_If,$1,$2,12751,13000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,13001,13250) aoqi@0: $(call ListPathsSafely_If,$1,$2,13251,13500) aoqi@0: $(call ListPathsSafely_If,$1,$2,13501,13750) aoqi@0: $(call ListPathsSafely_If,$1,$2,13751,14000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,14001,14250) aoqi@0: $(call ListPathsSafely_If,$1,$2,14251,14500) aoqi@0: $(call ListPathsSafely_If,$1,$2,14501,14750) aoqi@0: $(call ListPathsSafely_If,$1,$2,14751,15000) aoqi@0: aoqi@0: $(call ListPathsSafely_If,$1,$2,15001,15250) aoqi@0: $(call ListPathsSafely_If,$1,$2,15251,15500) aoqi@0: $(call ListPathsSafely_If,$1,$2,15501,15750) aoqi@0: $(call ListPathsSafely_If,$1,$2,15751,16000) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,1) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,1001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,1251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,1501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,1751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,2001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,2251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,2501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,2751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,3001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,3251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,3501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,3751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,4001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,4251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,4501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,4751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,5001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,5251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,5501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,5751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,6001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,6251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,6501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,6751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,7001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,7251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,7501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,7751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,8001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,8251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,8501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,8751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,9001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,9251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,9501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,9751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,10001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,10251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,10501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,10751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,11001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,11251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,11501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,11751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,12001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,12251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,12501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,12751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,13001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,13251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,13501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,13751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,14001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,14251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,14501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,14751) aoqi@0: aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,15001) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,15251) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,15501) aoqi@0: $(call ListPathsSafely_Printf,$1,$2,$3,15751) aoqi@0: endef aoqi@0: aoqi@0: define ListPathsSafelyNow_IfPrintf aoqi@0: ifneq (,$$(word $4,$$($1))) aoqi@0: $$(eval $1_LPS$4:=$$(call compress_paths,$$(wordlist $4,$5,$$($1)))) aoqi@0: $$(shell printf -- "$$(strip $$($1_LPS$4))\n" | $(decompress_paths) $3) aoqi@0: endif aoqi@0: endef aoqi@0: aoqi@0: # And an non-receipt version: aoqi@0: define ListPathsSafelyNow aoqi@0: ifneq (,$$(word 10001,$$($1))) aoqi@0: $$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!) aoqi@0: endif aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1,250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,251,500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,501,750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,751,1000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1001,1250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1251,1500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1501,1750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,1751,2000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2001,2250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2251,2500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2501,2750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,2751,3000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3001,3250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3251,3500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3501,3750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,3751,4000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4001,4250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4251,4500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4501,4750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,4751,5000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5001,5250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5251,5500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5501,5750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,5751,6000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6001,6250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6251,6500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6501,6750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,6751,7000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7001,7250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7251,7500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7501,7750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,7751,8000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8001,8250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8251,8500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8501,8750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,8751,9000) aoqi@0: aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9001,9250) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9251,9500) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9501,9750) aoqi@0: $(call ListPathsSafelyNow_IfPrintf,$1,$2,$3,9751,10000) aoqi@0: aoqi@0: endef aoqi@0: aoqi@0: # The source tips can come from the Mercurial repository, or in the files aoqi@0: # $(HGTIP_FILENAME) which contains the tip but is also positioned in the same aoqi@0: # directory as the original $(HGDIR) directory. aoqi@0: # These should not be := assignments, only used from the root Makefile. aoqi@0: HG_VERSION = $(shell $(HG) version 2> /dev/null) aoqi@0: HG_DIRECTORY=.hg aoqi@0: HGTIP_FILENAME=.hgtip aoqi@0: HG_SEARCH = ./REPO ./*/REPO ./*/*/REPO ./*/*/*/REPO aoqi@0: REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \ aoqi@0: $(shell $(CD) $(SRC_ROOT) ; ( $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \ aoqi@0: $(LS) $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \ aoqi@0: 2> /dev/null))))) aoqi@0: aoqi@0: # Emit the repo:tip pairs to $@ aoqi@0: define GetSourceTips aoqi@0: $(CD) $(SRC_ROOT) ; \ aoqi@0: for i in $(REPO_LIST) IGNORE ; do \ aoqi@0: if [ "$${i}" = "IGNORE" ] ; then \ aoqi@0: continue; \ aoqi@0: elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \ aoqi@0: $(PRINTF) " %s:%s" \ aoqi@0: "$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \ aoqi@0: elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \ aoqi@0: $(PRINTF) " %s:%s" \ aoqi@0: "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \ aoqi@0: fi; \ aoqi@0: done >> $@ aoqi@0: $(PRINTF) "\n" >> $@ aoqi@0: endef aoqi@0: aoqi@0: # Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk aoqi@0: define CreateHgTip aoqi@0: $(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \ aoqi@0: $(ECHO) $1/$(HGTIP_FILENAME) aoqi@0: endef aoqi@0: aoqi@0: define SetupLogging aoqi@0: ifeq ($$(LOG_LEVEL),trace) aoqi@0: # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make aoqi@0: # For each target executed, will print aoqi@0: # Building (from ) ( newer) aoqi@0: # but with a limit of 20 on , to avoid cluttering logs too much aoqi@0: # (and causing a crash on Cygwin). aoqi@0: # Default shell seems to always be /bin/sh. Must override with bash to get this to work on Solaris. aoqi@0: # Only use time if it's GNU time which supports format and output file. aoqi@0: WRAPPER_SHELL:=/bin/bash $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log /bin/bash aoqi@0: SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL) aoqi@0: endif aoqi@0: # Never remove warning messages; this is just for completeness aoqi@0: LOG_WARN= aoqi@0: ifneq ($$(findstring $$(LOG_LEVEL),info debug trace),) aoqi@0: LOG_INFO= aoqi@0: else aoqi@0: LOG_INFO=> /dev/null aoqi@0: endif aoqi@0: ifneq ($$(findstring $$(LOG_LEVEL),debug trace),) aoqi@0: LOG_DEBUG= aoqi@0: else aoqi@0: LOG_DEBUG=> /dev/null aoqi@0: endif aoqi@0: ifneq ($$(findstring $$(LOG_LEVEL),trace),) aoqi@0: LOG_TRACE= aoqi@0: else aoqi@0: LOG_TRACE=> /dev/null aoqi@0: endif aoqi@0: endef aoqi@0: aoqi@0: # Make sure logging is setup for everyone that includes MakeBase.gmk. aoqi@0: $(eval $(call SetupLogging)) aoqi@0: aoqi@0: # This is to be called by all SetupFoo macros aoqi@0: define LogSetupMacroEntry aoqi@0: $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) aoqi@0: $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i)))))) aoqi@0: endef aoqi@0: aoqi@0: # Make directory without forking mkdir if not needed aoqi@0: define MakeDir aoqi@0: ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)) aoqi@0: $$(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9) aoqi@0: endif aoqi@0: endef aoqi@0: aoqi@0: ifeq ($(OPENJDK_TARGET_OS),solaris) aoqi@0: # On Solaris, if the target is a symlink and exists, cp won't overwrite. aoqi@0: # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the aoqi@0: # name of the target file differs from the source file, rename after copy. aoqi@0: define install-file aoqi@0: $(MKDIR) -p $(@D) aoqi@0: $(RM) '$@' aoqi@0: $(CP) -f -r -P '$<' '$(@D)' aoqi@0: if [ "$(@F)" != "$(