'make' does not recompile when source file has been edited

前端 未结 3 543
栀梦
栀梦 2021-01-19 13:31

I\'m writing a little implementation of Conway\'s Game of Life in C. The source code is split in three files: main.c and functions.c/function

3条回答
  •  抹茶落季
    2021-01-19 14:33

    You've told make that .o files don't depend on .h files, so it doesn't recompile anything when a header changes.

    Getting it to work right is hard (you need to generate dependencies for each .c file), but an easy way is just to define HEADERS which contains all your header files and make each .o file depend on all your headers.

提交回复
热议问题