making all rules depend on the Makefile itself

前端 未结 2 1753
野的像风
野的像风 2020-12-15 17:45

When I change a Makefile, its rules may have changed, so they should be reevaluated, but make doesn\'t seem to think so.

Is there any way to say, in a Makefile, that

2条回答
  •  轮回少年
    2020-12-15 18:42

    The only answer I know to this is to add makefile explicitly to the dependencies. For example,

    %.o: %.c makefile
            $(CC) $(CFLAGS) -c $<
    

提交回复
热议问题