tools: fix doc build targets
Adds doc output directory as order-only prerequisite for build target.
Currently, here is the issue:
$ make docclean > /dev/null
$ make out/doc/api/addons.html > /dev/null
internal/fs/utils.js:298
throw err;
^
Error: ENOENT: no such file or directory, open 'out/doc/apilinks.json'
at Object.openSync (fs.js:465:3)
at Object.writeFileSync (fs.js:1416:35)
at Object.<anonymous> (…/tools/doc/apilinks.js:211:4)
at Module._compile (internal/modules/cjs/loader.js:1090:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1111:10)
at Module.load (internal/modules/cjs/loader.js:955:32)
at Function.Module._load (internal/modules/cjs/loader.js:796:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'out/doc/apilinks.json'
}
make: *** [out/doc/apilinks.json] Error 1
$ mkdir out/doc
$ make out/doc/api/addons.html > /dev/null
[Error: ENOENT: no such file or directory, open 'out/doc/api/addons.html'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'out/doc/api/addons.html'
}
[Error: ENOENT: no such file or directory, open 'out/doc/api/addons.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'out/doc/api/addons.json'
}
make: *** [out/doc/api/addons.html] Error 1
The problem is that the out/doc/api
directory is not created before trying to generate the files, which fails. This PR adds the directories as prerequisites to ensure the files can be generated.
Repported by @DerekNonGeneric in https://github.com/nodejs/node/pull/34986#issuecomment-687427703.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines