< prev index next >

make/MakeHelpers.gmk

Print this page


   1 #
   2 # Copyright (c) 2011, 2012, 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


 280         SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs)))
 281       else
 282         # No CONF or SPEC given, check the available configurations
 283         ifneq ($$(words $$(all_spec_files)),1)
 284           $$(info Error: No CONF given, but more than one configuration found.)
 285           $$(info Available configurations in $$(output_dir):)
 286           $$(foreach var,$$(all_confs),$$(info * $$(var)))
 287           $$(info Please retry building with CONF=<config pattern> (or SPEC=<specfile>).)
 288           $$(eval $$(call FatalError))
 289         endif
 290 
 291         # We found exactly one configuration, use it
 292         SPEC=$$(strip $$(all_spec_files))
 293       endif
 294     endif
 295   endif
 296 endef
 297 
 298 ### Convenience functions from Main.gmk
 299 








 300 # Cleans the dir given as $1
 301 define CleanDir
 302         @$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
 303         @($(CD) $(OUTPUT_ROOT) && $(RM) -r $1)






 304         @$(PRINTF) " done\n"
 305 endef
 306 
 307 define Clean-gensrc
 308         @$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..."
 309         @$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
 310         @$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc_no_docs/$(strip $1)
 311         @$(PRINTF) " done\n"
 312 endef
 313 
 314 define Clean-java
 315         @$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..."
 316         @$(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1)
 317         @$(RM) -r $(SUPPORT_OUTPUTDIR)/misc/$(strip $1)
 318         @$(PRINTF) " done\n"
 319         @$(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..."
 320         @$(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)
 321         @$(PRINTF) " done\n"
 322 endef
 323 


   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


 280         SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs)))
 281       else
 282         # No CONF or SPEC given, check the available configurations
 283         ifneq ($$(words $$(all_spec_files)),1)
 284           $$(info Error: No CONF given, but more than one configuration found.)
 285           $$(info Available configurations in $$(output_dir):)
 286           $$(foreach var,$$(all_confs),$$(info * $$(var)))
 287           $$(info Please retry building with CONF=<config pattern> (or SPEC=<specfile>).)
 288           $$(eval $$(call FatalError))
 289         endif
 290 
 291         # We found exactly one configuration, use it
 292         SPEC=$$(strip $$(all_spec_files))
 293       endif
 294     endif
 295   endif
 296 endef
 297 
 298 ### Convenience functions from Main.gmk
 299 
 300 # Run the tests specified by $1.
 301 define RunTests
 302         ($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
 303             JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
 304             TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \
 305             ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $1) || true
 306 endef
 307 
 308 # Cleans the dir given as $1
 309 define CleanDir
 310         @$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
 311         @($(CD) $(OUTPUT_ROOT) && $(RM) -r $1)
 312         @$(PRINTF) " done\n"
 313 endef
 314 
 315 define CleanTest
 316         @$(PRINTF) "Cleaning test $(strip $1) ..."
 317         @$(RM) -r $(SUPPORT_OUTPUTDIR)/test/$(strip $(subst -,/,$1))
 318         @$(PRINTF) " done\n"
 319 endef
 320 
 321 define Clean-gensrc
 322         @$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..."
 323         @$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
 324         @$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc_no_docs/$(strip $1)
 325         @$(PRINTF) " done\n"
 326 endef
 327 
 328 define Clean-java
 329         @$(PRINTF) "Cleaning java $(if $1,for $(strip $1) )..."
 330         @$(RM) -r $(JDK_OUTPUTDIR)/modules/$(strip $1)
 331         @$(RM) -r $(SUPPORT_OUTPUTDIR)/misc/$(strip $1)
 332         @$(PRINTF) " done\n"
 333         @$(PRINTF) "Cleaning headers $(if $1,for $(strip $1)) ..."
 334         @$(RM) -r $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)
 335         @$(PRINTF) " done\n"
 336 endef
 337 


< prev index next >