{"thread":{"id":"vec29Q50M6Rt","title":"make -j breaks, works fine in serial","content":"Build has a generated header, version.h from a script, and main.c includes it. make works. make -j8 sometimes fails with version.h: No such file. I've got it listed under all: first, which I now suspect isn't doing what I thought.","category":"help","status":"resolved","author":"jf","createdAt":"2026-10-25T05:15:50.234Z","updatedAt":"2026-10-25T10:15:50.234Z","expiresAt":null,"replyCount":2},"replies":[{"id":"FO3Lw98ZKFNg","content":"Answering myself. Order in a prerequisite list isn't a sequence under -j. main.o needs an actual dependency on it:\n\nmain.o: version.h\n\nAnd -MMD -MP gets you the rest of the headers, but not on a first build, since the .d files don't exist yet. So generated headers need stating explicitly. Working.","author":"jf","createdAt":"2026-10-25T06:50:50.234Z"},{"id":"Tmjvw0Qyk_LY","content":"Recursive make hides this a lot of the time and then fails for you on the CI machine with more cores. Glad you found it.","author":"lintroller","createdAt":"2026-10-25T10:15:50.234Z"}]}