diff options
author | Nico Huber <nico.h@gmx.de> | 2020-11-16 22:50:49 +0100 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2021-01-01 21:30:44 +0000 |
commit | 1823d53cbf9fc1d7fb695c881695880f48801d9c (patch) | |
tree | f1887bd87070fb60adae222e3f43f1b07781717a /payloads/libpayload/Makefile | |
parent | c4f8fbdb11ca891e844903643a44cfa6c5bb8871 (diff) |
libpayload: Move .xcompile into $(obj)
Keep libpayload's xcompile in its build dir. While we are at it,
align things with the top-level version.
Having `.xcompile` in a central place led to race conditions when
multiple payloads try to build their own libpayloads in parallel.
Change-Id: I504e1862db79b368289867f7568c9169f27a1549
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47651
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'payloads/libpayload/Makefile')
-rw-r--r-- | payloads/libpayload/Makefile | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile index b5687c3859..0b08c70af7 100644 --- a/payloads/libpayload/Makefile +++ b/payloads/libpayload/Makefile @@ -118,6 +118,11 @@ NOCOMPILE:=1 endif endif +xcompile ?= $(obj)/xcompile +$(xcompile): $(top)/../../util/xcompile/xcompile + $< $(XGCCPATH) > $@.tmp + \mv -f $@.tmp $@ 2> /dev/null + ifeq ($(NOCOMPILE),1) include $(TOPLEVEL)/Makefile.inc real-all: config @@ -126,13 +131,17 @@ else # in addition to the dependency below, create the file if it doesn't exist # to silence stupid warnings about a file that would be generated anyway. -$(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell $(top)/../../util/xcompile/xcompile $(XGCCPATH) > .xcompile))) +$(if $(wildcard $(xcompile)),,$(shell \ + mkdir -p $(dir $(xcompile)) && \ + $(top)/../../util/xcompile/xcompile $(XGCCPATH) > $(xcompile) || rm -f $(xcompile))) -.xcompile: $(top)/../../util/xcompile/xcompile - $< $(XGCCPATH) > $@.tmp - \mv -f $@.tmp $@ 2> /dev/null +include $(xcompile) --include .xcompile +ifneq ($(XCOMPILE_COMPLETE),1) +$(shell rm -f $(xcompile)) +$(error $(xcompile) deleted because it's invalid. \ + Restarting the build should fix that, or explain the problem) +endif CC := $(CC_$(ARCH-y)) AS := $(AS_$(ARCH-y)) @@ -294,7 +303,7 @@ doxygen-clean: rm -rf $(DOXYGEN_OUTPUT_DIR) clean-for-update: doxygen-clean clean-for-update-target - rm -f $(allobjs) .xcompile + rm -f $(allobjs) $(xcompile) rm -f $(DEPENDENCIES) rmdir -p $(alldirs) 2>/dev/null >/dev/null || true |