comparison make/common/MakeBase.gmk @ 47290:b90a1b5b8142

manual merge
author mcimadamore
date Mon, 25 Sep 2017 16:38:40 +0100
parents 59bdd7243c52
children 9b9d2ce82f37
comparison
equal deleted inserted replaced
71:9e4ccbc7e88a 72:1d6010d1b114
80 $(info $(strip $1) >$($(strip $1))<) 80 $(info $(strip $1) >$($(strip $1))<)
81 81
82 ### Functions for timers 82 ### Functions for timers
83 83
84 # Store the build times in this directory. 84 # Store the build times in this directory.
85 BUILDTIMESDIR=$(OUTPUT_ROOT)/make-support/build-times 85 BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
86 86
87 # Record starting time for build of a sub repository. 87 # Record starting time for build of a sub repository.
88 define RecordStartTime 88 define RecordStartTime
89 $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \ 89 $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$(strip $1) && \
90 $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable 90 $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$(strip $1)_human_readable
153 153
154 $(eval compress_paths = \ 154 $(eval compress_paths = \
155 $(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-pre-compress.incl))) 155 $(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-pre-compress.incl)))
156 compress_paths += \ 156 compress_paths += \
157 $(subst $(TOPDIR),X97, \ 157 $(subst $(TOPDIR),X97, \
158 $(subst $(OUTPUT_ROOT),X98, \ 158 $(subst $(OUTPUTDIR),X98, \
159 $(subst X,X00, \ 159 $(subst X,X00, \
160 $(subst $(SPACE),\n,$(strip $1))))) 160 $(subst $(SPACE),\n,$(strip $1)))))
161 $(eval compress_paths += \ 161 $(eval compress_paths += \
162 $(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-post-compress.incl))) 162 $(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-post-compress.incl)))
163 163
164 decompress_paths=$(SED) -f $(TOPDIR)/make/common/support/ListPathsSafely-uncompress.sed \ 164 decompress_paths=$(SED) -f $(TOPDIR)/make/common/support/ListPathsSafely-uncompress.sed \
165 -e 's|X99|\\n|g' \ 165 -e 's|X99|\\n|g' \
166 -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(TOPDIR)|g' \ 166 -e 's|X98|$(OUTPUTDIR)|g' -e 's|X97|$(TOPDIR)|g' \
167 -e 's|X00|X|g' 167 -e 's|X00|X|g'
168 168
169 ListPathsSafely_IfPrintf = \ 169 ListPathsSafely_IfPrintf = \
170 $(if $(word $3,$($(strip $1))), \ 170 $(if $(word $3,$($(strip $1))), \
171 $(shell $(PRINTF) -- "$(strip $(call EscapeDollar, \ 171 $(shell $(PRINTF) -- "$(strip $(call EscapeDollar, \
357 define SetupLogging 357 define SetupLogging
358 ifeq ($$(LOG_PROFILE_TIMES_FILE), true) 358 ifeq ($$(LOG_PROFILE_TIMES_FILE), true)
359 ifeq ($$(IS_GNU_TIME), yes) 359 ifeq ($$(IS_GNU_TIME), yes)
360 SHELL := $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \ 360 SHELL := $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
361 gnutime $$(TIME) \ 361 gnutime $$(TIME) \
362 $$(OUTPUT_ROOT)/build-profile.log $$(SHELL) 362 $$(OUTPUTDIR)/build-profile.log $$(SHELL)
363 else ifneq ($$(FLOCK), ) 363 else ifneq ($$(FLOCK), )
364 SHELL := $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \ 364 SHELL := $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
365 flock $$(FLOCK) \ 365 flock $$(FLOCK) \
366 $$(OUTPUT_ROOT)/build-profile.log $$(SHELL) 366 $$(OUTPUTDIR)/build-profile.log $$(SHELL)
367 endif 367 endif
368 endif 368 endif
369 369
370 ifeq ($$(LOG_LEVEL), trace) 370 ifeq ($$(LOG_LEVEL), trace)
371 SHELL_NO_RECURSE := $$(SHELL) 371 SHELL_NO_RECURSE := $$(SHELL)
705 # 2 : Dest file 705 # 2 : Dest file
706 # 3 : Variable to add targets to 706 # 3 : Variable to add targets to
707 # 4 : Macro to call for copy operation 707 # 4 : Macro to call for copy operation
708 # 5 : Action text to log 708 # 5 : Action text to log
709 $2: $1 709 $2: $1
710 $$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)) 710 $$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUTDIR)/%,%,$$@))
711 $$($$(strip $4)) 711 $$($$(strip $4))
712 712
713 $3 += $2 713 $3 += $2
714 endef 714 endef
715 715
935 ExecuteWithLog = \ 935 ExecuteWithLog = \
936 $(call LogCmdlines, Exececuting: [$(strip $2)]) \ 936 $(call LogCmdlines, Exececuting: [$(strip $2)]) \
937 $(call WriteFile, $2, $(strip $1).cmdline) \ 937 $(call WriteFile, $2, $(strip $1).cmdline) \
938 ( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \ 938 ( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \
939 ( exitcode=$(DOLLAR)? && \ 939 ( exitcode=$(DOLLAR)? && \
940 $(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(BUILD_OUTPUT)/%,%,$(strip $1))).log && \ 940 $(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).log && \
941 $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(BUILD_OUTPUT)/%,%,$(strip $1))).cmdline && \ 941 $(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \
942 exit $(DOLLAR)exitcode ) ) 942 exit $(DOLLAR)exitcode ) )
943 943
944 ################################################################################ 944 ################################################################################
945 # Find lib dir for module 945 # Find lib dir for module
946 # Param 1 - module name 946 # Param 1 - module name