make/Init.gmk
author ctornqvi
Wed, 22 Apr 2015 13:58:28 -0700
changeset 30536 8eafd36e9a8d
parent 29663 74ff65003536
child 29788 b581a3d9db41
permissions -rw-r--r--
8077529: [TESTBUG] Remove hotspot.internalvmtests from jprt config Reviewed-by: mikael, sla
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
fd16c54261b3 Initial load
duke
parents:
diff changeset
     1
#
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
     2
# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
0
fd16c54261b3 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fd16c54261b3 Initial load
duke
parents:
diff changeset
     4
#
fd16c54261b3 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
fd16c54261b3 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5499
eb0b3e373167 6943119: Rebrand source copyright notices
ohair
parents: 4309
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
0
fd16c54261b3 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5499
eb0b3e373167 6943119: Rebrand source copyright notices
ohair
parents: 4309
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
0
fd16c54261b3 Initial load
duke
parents:
diff changeset
    10
#
fd16c54261b3 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
fd16c54261b3 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fd16c54261b3 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fd16c54261b3 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
fd16c54261b3 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
fd16c54261b3 Initial load
duke
parents:
diff changeset
    16
#
fd16c54261b3 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
fd16c54261b3 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
fd16c54261b3 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fd16c54261b3 Initial load
duke
parents:
diff changeset
    20
#
5499
eb0b3e373167 6943119: Rebrand source copyright notices
ohair
parents: 4309
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
eb0b3e373167 6943119: Rebrand source copyright notices
ohair
parents: 4309
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
eb0b3e373167 6943119: Rebrand source copyright notices
ohair
parents: 4309
diff changeset
    23
# questions.
0
fd16c54261b3 Initial load
duke
parents:
diff changeset
    24
#
fd16c54261b3 Initial load
duke
parents:
diff changeset
    25
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    26
################################################################################
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    27
# This is the bootstrapping part of the build. This file is included from the
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    28
# top level Makefile, and is responsible for launching the Main.gmk file with
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    29
# the proper make and the proper make arguments.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    30
################################################################################
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    31
21759
e24e22311718 8027566: Remove the old build system
ihse
parents: 19758
diff changeset
    32
# This must be the first rule
e24e22311718 8027566: Remove the old build system
ihse
parents: 19758
diff changeset
    33
default:
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    34
.PHONY: default
17
bb9f330cd95a 6649672: Adjustments to OUTPUTDIR default and mkdirs to avoid empty directory clutter
ohair
parents: 16
diff changeset
    35
21759
e24e22311718 8027566: Remove the old build system
ihse
parents: 19758
diff changeset
    36
# Inclusion of this pseudo-target will cause make to execute this file
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    37
# serially, regardless of -j.
21759
e24e22311718 8027566: Remove the old build system
ihse
parents: 19758
diff changeset
    38
.NOTPARALLEL:
9618
83db8167c9f6 7043700: Regression for IcedTea builds
ohair
parents: 9309
diff changeset
    39
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    40
# If included from the top-level Makefile then topdir is set, but not when
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    41
# recursively calling ourself with a spec.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    42
ifeq ($(topdir),)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    43
  topdir := $(strip $(patsubst %/make/, %, $(dir $(lastword $(MAKEFILE_LIST)))))
874
638ddad10e12 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 668
diff changeset
    44
endif
638ddad10e12 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 668
diff changeset
    45
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    46
# Our helper functions. Will include $(SPEC) if $(HAS_SPEC) is true.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    47
include $(topdir)/make/InitSupport.gmk
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    48
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    49
# Here are "global" targets, i.e. targets that can be executed without having a configuration.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    50
# This will define ALL_GLOBAL_TARGETS.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    51
include $(topdir)/make/Help.gmk
27595
cff167b3bfa2 8065914: Various improvements and cleanup of build system
ihse
parents: 26548
diff changeset
    52
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    53
# Extract main targets from Main.gmk.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    54
ifneq ($(any_spec_file), )
29663
74ff65003536 8076123: 9-dev build fail: make/Init.gmk:142: *** multiple target patterns. Stop.
erikj
parents: 29662
diff changeset
    55
  ifeq ($(wildcard $(dir $(any_spec_file))/make-support/module-deps.gmk),)
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    56
    # If make-support does not exist, we need to build the genmodules java tool first.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    57
    $(info Creating data for first make execution in new configuration...)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    58
    ignore_output := $(shell $(MAKE) -r -R -f $(topdir)/make/Main.gmk \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    59
        -I $(topdir)/make/common SPEC=$(any_spec_file) NO_RECIPES=true FRC)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    60
    $(info Done)
28902
0c09b47449c8 8069064: Various improvements and fixes in build system
ihse
parents: 28286
diff changeset
    61
  endif
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    62
  ALL_MAIN_TARGETS := $(shell $(MAKE) -r -R -f $(topdir)/make/Main.gmk \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    63
      -I $(topdir)/make/common SPEC=$(any_spec_file) NO_RECIPES=true print-targets)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    64
else
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    65
  # Without at least a single valid configuration, we cannot extract any real
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    66
  # targets. To provide a helpful error message about the missing configuration
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    67
  # later on, accept whatever targets the user has provided for now.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    68
  ALL_MAIN_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
28902
0c09b47449c8 8069064: Various improvements and fixes in build system
ihse
parents: 28286
diff changeset
    69
endif
0c09b47449c8 8069064: Various improvements and fixes in build system
ihse
parents: 28286
diff changeset
    70
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    71
# Targets provided by this file.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    72
ALL_INIT_TARGETS := reconfigure
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    73
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    74
ALL_TARGETS := $(sort $(ALL_GLOBAL_TARGETS) $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    75
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    76
ifneq ($(findstring qp, $(MAKEFLAGS)),)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    77
  ##############################################################################
27595
cff167b3bfa2 8065914: Various improvements and cleanup of build system
ihse
parents: 26548
diff changeset
    78
  # When called with -qp, assume an external part (e.g. bash completion) is trying
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    79
  # to understand our targets. Just list our targets and do no more checking.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    80
  ##############################################################################
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    81
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    82
  $(ALL_TARGETS):
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    83
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    84
  .PHONY: $(ALL_TARGETS)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    85
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    86
else ifeq ($(HAS_SPEC),)
874
638ddad10e12 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 668
diff changeset
    87
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    88
  ##############################################################################
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    89
  # This is the normal case, we have been called from the command line by the
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    90
  # user and we need to call ourself back with a proper SPEC.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    91
  ##############################################################################
8441
30f5ad688d4a 7021753: Add a build times report
ohrstrom
parents: 7876
diff changeset
    92
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    93
  $(eval $(call CheckControlVariables))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    94
  $(eval $(call CheckDeprecatedEnvironment))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    95
  $(eval $(call CheckInvalidMakeFlags))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    96
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    97
  $(eval $(call ParseConfCheckOption))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    98
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
    99
  # Check that the LOG given is valid, and set LOG_LEVEL, LOG_NOFILE and MAKE_LOG_FLAGS.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   100
  $(eval $(call ParseLogLevel))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   101
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   102
  ifneq ($(findstring $(LOG_LEVEL),info debug trace),)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   103
    $(info Running make as '$(strip $(MAKE) $(MFLAGS) $(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22031
diff changeset
   104
  endif
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22031
diff changeset
   105
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   106
  # CALLED_TARGETS is the list of targets that the user provided,
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   107
  # or "default" if unspecified.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   108
  CALLED_TARGETS := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), default)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   109
  CALLED_SPEC_TARGETS := $(filter $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS), $(CALLED_TARGETS))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   110
  ifneq ($(CALLED_SPEC_TARGETS),)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   111
    # We have at least one non-global target, which need a SPEC
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   112
    $(eval $(call ParseConfAndSpec))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   113
    # Now SPECS contain 1..N spec files (otherwise ParseConfAndSpec fails)
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22031
diff changeset
   114
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   115
    INIT_TARGETS := $(filter $(ALL_INIT_TARGETS), $(CALLED_SPEC_TARGETS))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   116
    SEQUENTIAL_TARGETS := $(filter dist-clean clean%, $(CALLED_SPEC_TARGETS))
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   117
    PARALLEL_TARGETS := $(filter-out $(INIT_TARGETS) $(SEQUENTIAL_TARGETS), $(CALLED_SPEC_TARGETS))
874
638ddad10e12 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 668
diff changeset
   118
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   119
    # The spec files depend on the autoconf source code. This check makes sure
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   120
    # the configuration is up to date after changes to configure.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   121
    $(SPECS): $(wildcard $(topdir)/common/autoconf/*)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   122
        ifeq ($(CONF_CHECK), fail)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   123
	  @echo "Error: The configuration is not up to date for '$(lastword $(subst /, , $(dir $@)))'."
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   124
	  $(call PrintConfCheckFailed)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   125
	  @exit 2
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   126
        else ifeq ($(CONF_CHECK), auto)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   127
	  @echo "Note: The configuration is not up to date for '$(lastword $(subst /, , $(dir $@)))'."
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   128
	  @( cd $(topdir) && \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   129
	      $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -f $(topdir)/make/Init.gmk SPEC=$@ HAS_SPEC=true \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   130
	      reconfigure )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   131
        else ifeq ($(CONF_CHECK), ignore)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   132
          # Do nothing
26398
ca1f84f97e20 8057537: Serialize reconfigure and fix make clean-foo foo
erikj
parents: 26128
diff changeset
   133
        endif
25854
98ce0879ab4c 8054834: Modular Source Code
chegar
parents: 22031
diff changeset
   134
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   135
    # Unless reconfigure is explicitely called, let all targets depend on the spec files to be up to date.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   136
    ifeq ($(findstring reconfigure, $(CALLED_SPEC_TARGETS)), )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   137
      $(CALLED_SPEC_TARGETS): $(SPECS)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   138
    endif
874
638ddad10e12 6728161: Add SKIP_BOOT_CYCLE feature to create boot jdk and use it during build
ohair
parents: 668
diff changeset
   139
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   140
    # The recipe will be run once for every target specified, but we only want to execute the
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   141
    # recipe a single time, hence the TARGET_DONE with a dummy command if true.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   142
    $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS):
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   143
	@$(if $(TARGET_DONE), \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   144
	  true \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   145
	, \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   146
	  $(foreach spec, $(SPECS), \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   147
	    ( cd $(topdir) && \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   148
	    $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -j 1 -f $(topdir)/make/Init.gmk \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   149
	        SPEC=$(spec) HAS_SPEC=true \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   150
	        USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   151
	        LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   152
	        INIT_TARGETS="$(INIT_TARGETS)" SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   153
	        PARALLEL_TARGETS="$(PARALLEL_TARGETS)"  \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   154
	        main ) && \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   155
	  ) true \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   156
	  $(eval TARGET_DONE=true) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   157
	)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   158
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   159
    .PHONY: $(ALL_MAIN_TARGETS) $(ALL_INIT_TARGETS)
0
fd16c54261b3 Initial load
duke
parents:
diff changeset
   160
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   161
  endif # has $(CALLED_SPEC_TARGETS)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   162
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   163
else # HAS_SPEC=true
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   164
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   165
  ##############################################################################
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   166
  # Now we have a spec. This part provides the "main" target that acts as a
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   167
  # trampoline to call the Main.gmk with the value of $(MAKE) found in the spec
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   168
  # file.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   169
  ##############################################################################
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   170
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   171
  ifeq ($(LOG_NOFILE), true)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   172
    # Disable log wrapper if LOG=[level,]nofile was given
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   173
    override BUILD_LOG_WRAPPER :=
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   174
  endif
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   175
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   176
  ifeq ($(OUTPUT_SYNC_SUPPORTED), true)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   177
    OUTPUT_SYNC_FLAG := -O$(OUTPUT_SYNC)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   178
  endif
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   179
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   180
  $(eval $(call CheckSpecSanity))
28902
0c09b47449c8 8069064: Various improvements and fixes in build system
ihse
parents: 28286
diff changeset
   181
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   182
  reconfigure:
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   183
        ifneq ($(CONFIGURE_COMMAND_LINE), )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   184
	  $(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   185
        else
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   186
	  $(ECHO) "Re-running configure using default settings"
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   187
        endif
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   188
	( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   189
	    $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   190
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   191
  main-init:
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   192
	$(call RotateLogFiles)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   193
	$(BUILD_LOG_WRAPPER) $(PRINTF) "Building target(s) '$(strip \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   194
	    $(INIT_TARGETS) $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   195
	    )' in configuration '$(CONF_NAME)'\n"
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   196
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   197
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   198
  # MAKEOVERRIDES is automatically set and propagated by Make to sub-Make calls.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   199
  # We need to clear it of the init-specific variables. The user-specified
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   200
  # variables are explicitely propagated using $(USER_MAKE_VARS).
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   201
  main: MAKEOVERRIDES :=
0
fd16c54261b3 Initial load
duke
parents:
diff changeset
   202
29662
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   203
  main: $(INIT_TARGETS) main-init
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   204
        ifneq ($(SEQUENTIAL_TARGETS), )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   205
          # Don't touch build output dir since we might be cleaning. That means
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   206
	  # no log wrapper.
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   207
	  ( cd $(TOPDIR) && \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   208
	      $(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   209
	      $(SEQUENTIAL_TARGETS) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   210
	  )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   211
        endif
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   212
        ifneq ($(PARALLEL_TARGETS), )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   213
	  $(call StartGlobalTimer)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   214
	  $(call PrepareSmartJavac)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   215
	  ( cd $(TOPDIR) && \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   216
	      $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   217
	      -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   218
	      $(PARALLEL_TARGETS) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   219
	  )
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   220
	  $(call CleanupSmartJavac)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   221
	  $(call StopGlobalTimer)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   222
	  $(call ReportBuildTimes)
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   223
        endif
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   224
	$(BUILD_LOG_WRAPPER) $(PRINTF) "Finished building target(s) '$(strip \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   225
	    $(INIT_TARGETS) $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) \
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   226
	    )' in configuration '$(CONF_NAME)'\n"
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   227
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   228
  .PHONY: reconfigure main-init main
78c47f0002c3 8076060: Improve make bootstrap process
ihse
parents: 28902
diff changeset
   229
endif