< prev index next >

make/common/MakeBase.gmk

Print this page


   1 #
   2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 427   define install-file
 428         $(MKDIR) -p '$(@D)'
 429         $(CP) -fRP '$<' '$@'
 430         if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
 431   endef
 432 else
 433   # Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin
 434   # significantly.
 435   define install-file
 436         $(MKDIR) -p '$(@D)' && $(CP) -fP '$<' '$@'
 437   endef
 438 endif
 439 
 440 # Convenience functions for working around make's limitations with $(filter ).
 441 containing = $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))
 442 not-containing = $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),,$v)))
 443 
 444 # Filter out duplicate sub strings while preserving order. Keeps the first occurance.
 445 uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
 446 




 447 # String equals
 448 equals = \
 449     $(and $(findstring $(strip $1),$(strip $2)),\
 450         $(findstring $(strip $2),$(strip $1)))
 451 
 452 ifneq ($(DISABLE_CACHE_FIND), true)
 453   ################################################################################
 454   # In Cygwin, finds are very costly, both because of expensive forks and because
 455   # of bad file system caching. Find is used extensively in $(shell) commands to
 456   # find source files. This makes rerunning make with no or few changes rather
 457   # expensive. To speed this up, these two macros are used to cache the results
 458   # of simple find commands for reuse.
 459   #
 460   # Runs a find and stores both the directories where it was run and the results.
 461   # This macro can be called multiple times to add to the cache. Only finds files
 462   # with no filters.
 463   #
 464   # Needs to be called with $(eval )
 465   #
 466   # Even if the performance benifit is negligible on other platforms, keep the


   1 #
   2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 427   define install-file
 428         $(MKDIR) -p '$(@D)'
 429         $(CP) -fRP '$<' '$@'
 430         if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
 431   endef
 432 else
 433   # Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin
 434   # significantly.
 435   define install-file
 436         $(MKDIR) -p '$(@D)' && $(CP) -fP '$<' '$@'
 437   endef
 438 endif
 439 
 440 # Convenience functions for working around make's limitations with $(filter ).
 441 containing = $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),$v)))
 442 not-containing = $(strip $(foreach v,$(strip $2),$(if $(findstring $(strip $1),$v),,$v)))
 443 
 444 # Filter out duplicate sub strings while preserving order. Keeps the first occurance.
 445 uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
 446 
 447 # Return a list of all string elements that are duplicated in $1.
 448 dups = $(strip $(foreach v, $(sort $1), $(if $(filter-out 1, \
 449     $(words $(filter $v, $1))), $v)))
 450 
 451 # String equals
 452 equals = \
 453     $(and $(findstring $(strip $1),$(strip $2)),\
 454         $(findstring $(strip $2),$(strip $1)))
 455 
 456 ifneq ($(DISABLE_CACHE_FIND), true)
 457   ################################################################################
 458   # In Cygwin, finds are very costly, both because of expensive forks and because
 459   # of bad file system caching. Find is used extensively in $(shell) commands to
 460   # find source files. This makes rerunning make with no or few changes rather
 461   # expensive. To speed this up, these two macros are used to cache the results
 462   # of simple find commands for reuse.
 463   #
 464   # Runs a find and stores both the directories where it was run and the results.
 465   # This macro can be called multiple times to add to the cache. Only finds files
 466   # with no filters.
 467   #
 468   # Needs to be called with $(eval )
 469   #
 470   # Even if the performance benifit is negligible on other platforms, keep the


< prev index next >