mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #108377 from thockin/makefile-check-restarts
Makefile: avoid redundant work upon make restart
This commit is contained in:
commit
6d7c252906
@ -24,7 +24,11 @@ ifeq ($(MAKECMDGOALS),)
|
||||
endif
|
||||
|
||||
ifeq ($(DBG_MAKEFILE),1)
|
||||
ifeq ($(MAKE_RESTARTS),)
|
||||
$(warning ***** starting Makefile.generated_files for goal(s) "$(MAKECMDGOALS)")
|
||||
else
|
||||
$(warning ***** restarting Makefile.generated_files for goal(s) "$(MAKECMDGOALS)")
|
||||
endif
|
||||
$(warning ***** $(shell date))
|
||||
endif
|
||||
|
||||
@ -59,6 +63,10 @@ GO_PKGDEPS_FILE = go-pkgdeps.mk
|
||||
# reload the updated deps.
|
||||
sinclude $(META_DIR)/$(GO_PKGDEPS_FILE)
|
||||
|
||||
# Only build and run go2make on the first pass. If that generates a new
|
||||
# GO_PKGDEPS_FILE, make will restart the whole process and set MAKE_RESTARTS to
|
||||
# a numeric value.
|
||||
ifeq ($(MAKE_RESTARTS),)
|
||||
# Update the set of Go deps for our project. This will let us determine if
|
||||
# we really need to do expensive codegen. We use FORCE because it is not a
|
||||
# PHONY file, but we do want it to be re-evaluated every time make is run. The
|
||||
@ -82,6 +90,7 @@ $(META_DIR)/$(GO_PKGDEPS_FILE): FORCE
|
||||
cat $@.tmp > $@; \
|
||||
fi
|
||||
rm -f $@.tmp
|
||||
endif # MAKE_RESTARTS
|
||||
|
||||
.PHONY: FORCE
|
||||
FORCE:
|
||||
|
Loading…
Reference in New Issue
Block a user