From 5e5f5b28e92a3bb927bb03c783c426c6c3baeadc Mon Sep 17 00:00:00 2001
From: Eli Zaretskii <eliz@gnu.org>
Date: Thu, 6 Apr 2023 22:14:59 +0300
Subject: [PATCH] Avoid failing the build when org-version.el is updated

* lisp/Makefile.in: Force recompilation of all Org files when
org-version.el is updated with a new Org version.
---
 lisp/Makefile.in | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 1e0935f565f..437667e7586 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -543,4 +543,12 @@ $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
 $(lisp)/progmodes/js.elc: $(lisp)/progmodes/cc-defs.elc \
    $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-mode.elc
 
+# When org-version.el gets updated with a new version, all the Org
+# files need to be recompiled, or else the build will fail due to
+# version mismatch, prompting the naive users to bootstrap.  So we
+# make all the Org *.elc files dependent of org-version.el, to trigger
+# their recompilation automatically.
+$(lisp)/org/org.elc $(filter-out $(lisp)/org/org-version.elc,$(filter-out $(lisp)/org/org.elc,$(wildcard $(lisp)/org/*.elc))): \
+   $(lisp)/org/org-version.el
+
 # Makefile ends here.
-- 
2.39.5