How to force make to always rebuild a file

后端 未结 4 1059
野的像风
野的像风 2021-02-01 16:16

I have a version.c file in my project that contains current revision of the project and some other stuff that is passed as a definition (-D compiler option) from makefile.

4条回答
  •  天涯浪人
    2021-02-01 17:09

    Not a makefile way, but easier than touch:

    make -B
    

    ‘-B’ ‘--always-make’

    Consider all targets out-of-date. GNU make proceeds to consider targets and their prerequisites using the normal algorithms; however, all targets so considered are always remade regardless of the status of their prerequisites. To avoid infinite recursion, if MAKE_RESTARTS (see Other Special Variables) is set to a number greater than 0 this option is disabled when considering whether to remake makefiles (see How Makefiles Are Remade).

提交回复
热议问题