make deleting dependency files

前端 未结 2 643
小蘑菇
小蘑菇 2021-02-07 16:28

I\'m not sure if it\'s gmake or gcc that I don\'t understand here.

I\'m using the -MM and -MD options to generate dependency rules for the Unit Testing framework I\'m us

相关标签:
2条回答
  • 2021-02-07 17:18

    make will automatically create intermediate files if necessary to chain two rules together, but it will delete them at the end of the build. You can use the .PRECIOUS special target to prevent it from removing them

    0 讨论(0)
  • 2021-02-07 17:29

    One helpful option for debugging these kind of problems is the -n switch:

    make -n {TARGET}
    

    It will show you the commands it would run but won't actually run them. This lets you see what rules are firing but doesn't give you all the extra output that makes it difficult to diagnose the problem.

    The -d debug flag can also be useful but be sure to run it in a context where you can scroll around easily, you'll be getting a lot of output. I usually use emacs shell mode as it has good searching functionality and saves the buffer.

    0 讨论(0)
提交回复
热议问题