Example makefile for building simple c project recompiling when headers change

前端 未结 2 382
梦谈多话
梦谈多话 2021-01-15 00:26

Does anyone have a complete makefile that can do the following:

  1. Rebuilds the project if a HEADER file changes
  2. The cpp files are listed in the makefile
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-15 01:07

    You can also use CMake for this. Everything you need to write is:

    add_executable (exec main.cpp C1.cpp C2.cpp)
    

提交回复
热议问题