Hasty Briefsbeta

Bilingual

Recursive `Make` and `-J`

5 hours ago
  • Recursive make invocations in Makefiles can lose parallelism because the jobserver (-j) is not forwarded to child make.
  • Prefixing recipe line with '+' or using $(MAKE) instead of make fixes jobserver forwarding and ensures same make binary.
  • Different GNU Make versions (3.81, 4.0, 4.2.1, 4.3) show varying behavior and warning messages for recursive make with -j.
  • Using -j in the recursive recipe (e.g., make -j2) can force a specific parallelism and disable jobserver mode, causing warning.
  • The recommended portable approach is to use $(MAKE) to properly inherit jobserver, but it doesn't silence all warnings.