Excluding .mli without .ml in Jbuilder

I’m working on a project with a relatively complex build process. As part of this process, a functor is generated from a number of source files and instantiated in different ways. The mli file for this functor exists in one directory of the source code, but the .ml is generated. Is there a way to have Jbuilder completely ignore this mli file when it builds the directory that includes it? I’ve seen the how to make the modules declaration ignore modules, but the warning that a HACK module has been created appears regardless. I’d like to avoid moving the mli to a different directory if possible.

Do you have a rule a stanza for the generation of this .ml file? If so, then everything should work just fine. Otherwise, how are you generating this .ml file?