I noticed that if I Ctrl-C while makedep is re-generating the Makefile, the Makefile will be gone.
There are two parts to this problem:
1. make deletes the output file if a rule is interrupted. - Solution: use the special .PRECIOUS target. 2. wine_fn_output_makefile overwrites the existing Makefile, because makedep is hardcoded to use the output makefile as its input. - Solution: add a -i command line options to makedep for specifying the input file name, then don't overwrite Makefile in wine_fn_output_makefile.
-- v2: configure: Don't nuke Makefile if makedep is interrupted.