mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-26 18:44:47 +01:00
build: fix race between 'clean' and generated files
When a parallel build is invoked using "make -j4" there is a race
between EXTRA_DEPS ('clean') and generating files:
CPU1 CPU2
---- ----
create cli/generated-config.go
rm cli/generated-config.go
go build -> error: generated-config.go doesn't exist!
Previous commits ensured that targets relying on version information
like VERSION and COMMIT declare appropriate dependencies. Therefore
make is now able to detect changes and rebuild targets as needed. It is
no longer necessary to abuse the clean target to force a rebuild.
Fixes: #1540
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
10
Makefile
10
Makefile
@@ -69,8 +69,6 @@ BINLIBEXECLIST += $(NETMON_TARGET)
|
||||
|
||||
DESTDIR := /
|
||||
|
||||
installing = $(findstring install,$(MAKECMDGOALS))
|
||||
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX := /usr
|
||||
EXEC_PREFIX := $(PREFIX)/local
|
||||
@@ -85,12 +83,6 @@ FCBINDIR := $(PREFIXDEPS)/bin
|
||||
SYSCONFDIR := /etc
|
||||
LOCALSTATEDIR := /var
|
||||
|
||||
ifeq (,$(installing))
|
||||
# Force a rebuild to ensure version details are correct
|
||||
# (but only for a non-install build phase).
|
||||
EXTRA_DEPS = clean
|
||||
endif
|
||||
|
||||
LIBEXECDIR := $(PREFIXDEPS)/libexec
|
||||
SHAREDIR := $(PREFIX)/share
|
||||
DEFAULTSDIR := $(SHAREDIR)/defaults
|
||||
@@ -400,7 +392,7 @@ endef
|
||||
|
||||
GENERATED_FILES += $(CLI_DIR)/config-generated.go
|
||||
|
||||
$(TARGET_OUTPUT): $(EXTRA_DEPS) $(SOURCES) $(GENERATED_FILES) $(MAKEFILE_LIST) | show-summary
|
||||
$(TARGET_OUTPUT): $(SOURCES) $(GENERATED_FILES) $(MAKEFILE_LIST) | show-summary
|
||||
$(QUIET_BUILD)(cd $(CLI_DIR) && go build $(BUILDFLAGS) -o $@ .)
|
||||
|
||||
$(SHIMV2_OUTPUT):
|
||||
|
||||
Reference in New Issue
Block a user