How can I make my Makefiles better?

前端 未结 3 653
心在旅途
心在旅途 2021-01-23 18:04

I\'ve trying to learn the \"best practice\" makefile\'s for a project.

Please review my Makefile file below and suggest changes to enhance it.

The dir layout:

3条回答
  •  -上瘾入骨i
    2021-01-23 18:18

    See this and that answers for examples about Makefile. Also run make -p to understand the builtin rules inside GNU make, so use $(LINK.cc) for e.g. your bin/tengine target.

    For complex builds, consider upgrading to GNU make 4.0 and use its Guile ability.

    You may want to generate automatically dependencies. Read automatic prerequisites and about autodependencies; read also about GCC preprocessor options like -M or -MD etc etc ....

提交回复
热议问题