Title | Missing dependencies in nmake build system |
Status | open |
Priority | nice |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | The nmake build system lacks dependency information (for example, on headers, or mps.c on sources) and so does not reliably rebuild after a change. |
Analysis | The /showIncludes option to the compiler [1] lists the included files and the output could be postprocessed into the necessary dependencies and then included via a !INCLUDE directive in commpre.nmk. Something like this: # == Dependencies == {}.c{$(PFM)\$(VARIETY)}.d: $(ECHO) $@ @if not exist $(PFM) mkdir $(PFM) @if not exist $(PFM)\$(VARIETY) mkdir $(PFM)\$(VARIETY) $(CC) $(CFLAGS) /EP /Zs /showIncludes $< 2>&1 1>NUL | \ sed -ne 's/^Note: including file: *\(.*\)/$(<F): "\1"/p' > $@ !IF [find /C "!" $(PFM)\$(VARIETY)\deps.nmk >NUL 2>&1] == 0 !INCLUDE $(PFM)\$(VARIETY)\deps.nmk !ENDIF But this would require users to install sed (and if they have sed, why not make?). Could guard this by an IF that tests for the existence of sed. |
How found | manual_test |
Evidence | [1] <http://msdn.microsoft.com/en-us/library/hdkef6tk.aspx > |
Created by | Gareth Rees |
Created on | 2014-06-19 10:13:09 |
Last modified by | Gareth Rees |
Last modified on | 2015-02-04 10:51:10 |
History | 2014-06-19 GDR Created. |