< prev index next >

make/common/MakeBase.gmk

Print this page




 363     LOG_DEBUG=
 364   else
 365     LOG_DEBUG=> /dev/null
 366   endif
 367   ifneq ($$(findstring $$(LOG_LEVEL),trace),)
 368     LOG_TRACE=
 369   else
 370     LOG_TRACE=> /dev/null
 371   endif
 372 endef
 373 
 374 # Make sure logging is setup for everyone that includes MakeBase.gmk.
 375 $(eval $(call SetupLogging))
 376 
 377 # This is to be called by all SetupFoo macros
 378 define LogSetupMacroEntry
 379   $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
 380   $(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))))))
 381 endef
 382 











 383 # Make directory without forking mkdir if not needed
 384 define MakeDir
 385   ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9))
 386     $$(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9)
 387   endif
 388 endef
 389 
 390 ifeq ($(OPENJDK_TARGET_OS),solaris)
 391   # On Solaris, if the target is a symlink and exists, cp won't overwrite.
 392   # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
 393   # name of the target file differs from the source file, rename after copy.
 394   # If the source and target parent directories are the same, recursive copy doesn't work
 395   # so we fall back on regular copy, which isn't preserving symlinks.
 396   define install-file
 397         $(MKDIR) -p $(@D)
 398         $(RM) '$@'
 399         if [ "$(@D)" != "$(<D)" ]; then \
 400           $(CP) -f -r -P '$<' '$(@D)'; \
 401           if [ "$(@F)" != "$(<F)" ]; then \
 402             $(MV) '$(@D)/$(<F)' '$@'; \




 363     LOG_DEBUG=
 364   else
 365     LOG_DEBUG=> /dev/null
 366   endif
 367   ifneq ($$(findstring $$(LOG_LEVEL),trace),)
 368     LOG_TRACE=
 369   else
 370     LOG_TRACE=> /dev/null
 371   endif
 372 endef
 373 
 374 # Make sure logging is setup for everyone that includes MakeBase.gmk.
 375 $(eval $(call SetupLogging))
 376 
 377 # This is to be called by all SetupFoo macros
 378 define LogSetupMacroEntry
 379   $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
 380   $(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))))))
 381 endef
 382 
 383 # Support macro for all SetupFoo macros.
 384 define EvalDebugWrapper
 385   $(if $(DEBUG_$1),
 386     $(info -------- <<< Begin expansion of $1)
 387     $(info $2)
 388     $(info -------- >>> End expansion of $1)
 389   )
 390 
 391   $2
 392 endef
 393 
 394 # Make directory without forking mkdir if not needed
 395 define MakeDir
 396   ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9))
 397     $$(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9)
 398   endif
 399 endef
 400 
 401 ifeq ($(OPENJDK_TARGET_OS),solaris)
 402   # On Solaris, if the target is a symlink and exists, cp won't overwrite.
 403   # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the
 404   # name of the target file differs from the source file, rename after copy.
 405   # If the source and target parent directories are the same, recursive copy doesn't work
 406   # so we fall back on regular copy, which isn't preserving symlinks.
 407   define install-file
 408         $(MKDIR) -p $(@D)
 409         $(RM) '$@'
 410         if [ "$(@D)" != "$(<D)" ]; then \
 411           $(CP) -f -r -P '$<' '$(@D)'; \
 412           if [ "$(@F)" != "$(<F)" ]; then \
 413             $(MV) '$(@D)/$(<F)' '$@'; \


< prev index next >