Skip to content

Makefile: add missing dependency of 'opencl.o' on 'oclobj.h'

Sergei Trofimovich requested to merge trofi/x264:fix-build-parallelism into master

Without the change parallel build occasionally fails as:

$ make --shuffle
...
gcc ... -c common/opencl.c -o common/opencl-8.o ...
common/opencl.c:116:10: fatal error: common/oclobj.h: No such file or directory
  116 | #include "common/oclobj.h"
      |          ^~~~~~~~~~~~~~~~~

Best reproducible with make --shuffle mode: https://savannah.gnu.org/bugs/index.php?62100

This happens because "common/oclobj.h" is an autogenerated file, but Makefile does not specify dependency of common/opencl-8.o in direct or indirect form.

The change moves dependency on $(GENERATED) from final binaries to intermediate object binaries:

$(OBJS): $(GENERATED)

Except that the actual change adds $(GENERATED) for any buildable objects to be a bit more future proof.

Merge request reports

Loading