How to force make to always rebuild a file

后端 未结 4 1056
野的像风
野的像风 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:17

    The quick hack version when you just need it to work and you don't want to play Make games:

    # Hack to get main.c rebuilt
    hack := $(shell touch main.c)
    

    Basically just make Make run touch for you.

提交回复
热议问题