From fa4d4abc816a1fe1d0ac98a0b9520bae5ea559d6 Mon Sep 17 00:00:00 2001
From: Thierry Martinez <Thierry.Martinez@inria.fr>
Date: Thu, 4 Nov 2021 14:22:08 +0100
Subject: [PATCH] Add empty rule to make .cmt targets depend on .cmx

Fix bug reported by Sabyrzhan Tasbolatov
---
 bundles/stdcompat/stdcompat-current/Makefile.am | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bundles/stdcompat/stdcompat-current/Makefile.am b/bundles/stdcompat/stdcompat-current/Makefile.am
index f0d8dbc38..1b955cf86 100644
--- bundles/stdcompat/stdcompat-current/Makefile.am
+++ bundles/stdcompat/stdcompat-current/Makefile.am
@@ -71,10 +71,12 @@ mypkg_SCRIPTS = META $(MODULES_native) $(MODULES_native:.ml=.cmi) \
 
 if OCAML_SUPPORTS_BYTECODE
 mypkg_SCRIPTS += stdcompat.cma
+BEST_SUFFIX := .cmo
 endif
 
 if OCAML_SUPPORTS_NATIVE
 mypkg_SCRIPTS += stdcompat.cmxa stdcompat.a $(MODULES_native:.ml=.cmx)
+BEST_SUFFIX := .cmx
 endif
 
 if OCAML_SUPPORTS_SHARED
@@ -113,6 +115,8 @@ SUFFIXES = .ml .mli .cmi .cmo .cmx .cmxa .cmxs .cmt
 .ml.cmx :
 	$(OCAMLOPT) -c $(OCAMLCFLAGS) $< -o $@
 
+$(BEST_SUFFIX).cmt : ;
+
 stdcompat__stubs.$(OBJEXT) : stdcompat__stubs.c
 	$(OCAMLC) -c $<
 
-- 
GitLab

