Revert "Revert "Fix initialisation of object file directory.""

This reverts commit 481f2a18c58aacd0a07fb5e64ad61e2e05c841a1.
Revert "Revert "Revert "Fix initialisation of object file directory."""

This reverts commit 2d5ec438f594e98be45b57bd397f01fcf55cf1cd.