Overview
| Artifact ID: | a796f9f2146c014f17b5ef141f0cbe198ab733f6897b0683fa87de54d533bd67 |
|---|---|
| Ticket: | 0a908bb93bb99e1ec828cfa04f2ca2dd51c1a033
make does not rebuild object files after a header file is changed |
| User & Date: | serhiy.storchaka on 2026-10-20 16:28:19 |
Changes
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
After changing a header file, <tt>make</tt> does not rebuild most of the object files which include it: in <tt>unix/Makefile.in</tt> only some object files list some headers (<tt>$(COMPILEHDR)</tt>, <tt>$(IOHDR)</tt>, etc), in <tt>win/Makefile.in</tt> none, and <tt>make depend</tt> needs <tt>makedepend</tt> ([427101ffff], [427105ffff]). For example, changing <tt>generic/tcl.h</tt> or <tt>unix/tclUnixPort.h</tt> rebuilds nothing, and changing <tt>generic/tclInt.h</tt> rebuilds 3 object files. The same issue in Tk is [https://core.tcl-lang.org/tk/tktview/a0109510a8|Tk ticket a0109510a8]. Proposed fix in branch [/timeline?r=header-dependencies|header-dependencies], the same as in Tk: if the compiler supports <tt>-MMD -MP</tt> (gcc and clang) and <tt>${MAKE-make}</tt> supports <tt>-include</tt>, the compiler writes the header dependencies of every object file into a <tt>.d</tt> file, which the Makefile includes. This is done in <tt>unix/</tt> and <tt>win/</tt> (MinGW, MSYS2, Cygwin). With it, changing <tt>tcl.h</tt> rebuilds 182 object files on Linux, <tt>tclInt.h</tt> 112 on Linux and 115 with MinGW and MSYS2. With <tt>win/makefile.vc</tt>, <tt>nmake -f makefile.vc depend</tt> already works. - foundin changed to: "9.1"
- login: "serhiy.storchaka"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "serhiy.storchaka"
- subsystem changed to: "53. Configuration and Build Tools"
- title changed to:
make does not rebuild object files after a header file is changed
- type changed to: "Bug"