Tk Source Code

View Ticket
Login
Ticket UUID: a0109510a834f58484ea967cfa40f1c29716344c
Title: make not rebuilding after header files change
Type: Bug Version: 8.6.9.1
Submitter: chrstphrchvz Created on: 2019-08-13 07:38:08
Subsystem: None Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2026-10-20 16:30:10
Resolution: None Closed By: nobody
    Closed on:
Description:

Running make, then changing a header file without changing files that include it, and then running make again does not cause the including file to be recompiled.

As an example, changing DEF_MENU_FG in tkMacOSXDefault.h alone does not cause tkMenu.c or tkMacOSXMenu.c to be recompiled.

This issue appears to affect all platforms. I haven't investigated whether this issue also applies to Tcl.

User Comments: serhiy.storchaka added on 2026-10-20 16:30:10:

Fixed in branch header-dependencies. If the compiler supports -MMD -MP (gcc and clang) and make supports -include, the compiler writes the header dependencies of every object file into a .d file, which the Makefile includes. This is done in unix/ and win/ (MinGW, MSYS2, Cygwin). Solaris make and dmake do not support -include, so configure checks it with ${MAKE-make}; nothing changes with them, nor with MSVC.

For win/makefile.vc, nmake -f makefile.vc depend already generates the dependencies, but it failed for almost every file: tcl.h, the /std:c11 option and the generated tkUuid.h were not found. Now it passes the same options as the compiler.

Tested on Linux (GNU make), FreeBSD (BSD make), OpenIndiana (gmake and Solaris make), MinGW (cross-compiled), MSYS2 UCRT64 and MSVC (with nmake depend). For example, after changing generic/tkInt.h, 156 object files are rebuilt with MinGW and MSYS2, and 152 with MSVC.

Tcl has the same issue: Tcl ticket 0a908bb93b.


fvogel added on 2019-08-13 17:06:37:
Definitely an annoyance to me as well, thanks for the report.