common/makefiles/MakeHelpers.gmk

changeset 559
ef6adbf511cc
parent 514
e69396d6d3e8
child 673
2ef28c12d649
equal deleted inserted replaced
558:d5f3a6f60d51 559:ef6adbf511cc
48 # Store the build times in this directory. 48 # Store the build times in this directory.
49 BUILDTIMESDIR=$(OUTPUT_ROOT)/tmp/buildtimes 49 BUILDTIMESDIR=$(OUTPUT_ROOT)/tmp/buildtimes
50 50
51 # Global targets are possible to run either with or without a SPEC. The prototypical 51 # Global targets are possible to run either with or without a SPEC. The prototypical
52 # global target is "help". 52 # global target is "help".
53 global_targets=help configure 53 global_targets=help jprt% bridgeBuild
54 54
55 ############################## 55 ##############################
56 # Functions 56 # Functions
57 ############################## 57 ##############################
58 58
110 110
111 ### Functions for managing makefile structure (start/end of makefile and individual targets) 111 ### Functions for managing makefile structure (start/end of makefile and individual targets)
112 112
113 # Do not indent this function, this will add whitespace at the start which the caller won't handle 113 # Do not indent this function, this will add whitespace at the start which the caller won't handle
114 define GetRealTarget 114 define GetRealTarget
115 $(strip $(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)) 115 $(strip $(if $(MAKECMDGOALS),$(MAKECMDGOALS),default))
116 endef 116 endef
117 117
118 # Do not indent this function, this will add whitespace at the start which the caller won't handle 118 # Do not indent this function, this will add whitespace at the start which the caller won't handle
119 define LastGoal 119 define LastGoal
120 $(strip $(lastword $(call GetRealTarget))) 120 $(strip $(lastword $(call GetRealTarget)))
124 # the user on the command line. If so, call AtRootMakeEnd. 124 # the user on the command line. If so, call AtRootMakeEnd.
125 define CheckIfMakeAtEnd 125 define CheckIfMakeAtEnd
126 # Check if the current target is the last goal 126 # Check if the current target is the last goal
127 $(if $(filter $@,$(call LastGoal)),$(call AtMakeEnd)) 127 $(if $(filter $@,$(call LastGoal)),$(call AtMakeEnd))
128 # If the target is 'foo-only', check if our goal was stated as 'foo' 128 # If the target is 'foo-only', check if our goal was stated as 'foo'
129 $(if $(filter $(patsubst %-only,%,$@),$(call LastGoal)),$(call AtMakeEnd)) 129 $(if $(filter $@,$(call LastGoal)-only),$(call AtMakeEnd))
130 # If no goal is given, 'all' is default, but the last target executed for all is 'jdk-only'. Check for that, too.
131 # At most one of the tests can be true.
132 $(if $(subst all,,$(call LastGoal)),,$(if $(filter $@,jdk-only),$(call AtMakeEnd)))
133 endef 130 endef
134 131
135 # Hook to be called when starting to execute a top-level target 132 # Hook to be called when starting to execute a top-level target
136 define TargetEnter 133 define TargetEnter
137 $(BUILD_LOG_WRAPPER) $(PRINTF) "## Starting $(patsubst %-only,%,$@)\n" 134 $(BUILD_LOG_WRAPPER) $(PRINTF) "## Starting $(patsubst %-only,%,$@)\n"

mercurial