From patchwork Fri Jul 10 00:39:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 241174 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Thu, 9 Jul 2020 18:39:33 -0600 Subject: [PATCH v3 10/49] binman: Adjust pylibfdt for incremental build In-Reply-To: <20200710004012.3016230-1-sjg@chromium.org> References: <20200710004012.3016230-1-sjg@chromium.org> Message-ID: <20200710004012.3016230-4-sjg@chromium.org> If the pylibfdt shared-object file is detected, then Python assumes that the libfdt.py file exists also. Sometimes when an incremental build aborts, the shared-object file is built but the libfdt.py is not. The only way out at this point is to use 'make mkproper', or similar. Fix this by removing the .so file before it is built. This seems to make Python rebuild everything. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) scripts/dtc/pylibfdt/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile index 42342c75bb..80b6ad2ae7 100644 --- a/scripts/dtc/pylibfdt/Makefile +++ b/scripts/dtc/pylibfdt/Makefile @@ -24,6 +24,9 @@ quiet_cmd_pymod = PYMOD $@ $(PYTHON3) $< --quiet build_ext --inplace $(obj)/_libfdt.so: $(src)/setup.py $(PYLIBFDT_srcs) FORCE + @# Remove the library since otherwise Python doesn't seem to regenerate + @# the libfdt.py file if it is missing. + rm -f $(obj)/_libfdt*.so $(call if_changed,pymod) always += _libfdt.so