Git configure order in which files are merged

Our repository contains multiple files that are source code and one file that is a build artefact (compiled apiary blueprint for example).

There is a build script I can configure as merge driver for this file, but it fails if the source is not yet merged (or at least it builds from the merge state, which is not correct). Is there a way to tell git in what order it should try to merge files? There is a

Turns out it's really as simple a creating a custom merge wrapper, leaving the build artefact as -merge.
The wrapper runs git merge, and if there are no other unresolved files other than the artefact, run the build script.