Any interesting uses of Makefiles to share?

后端 未结 7 1697
北恋
北恋 2020-12-23 18:14

\"make\" is not only useful for building your programming project, but it seems to be under-used in other areas.

For example, many shell scripts can be rewritten as

7条回答
  •  醉酒成梦
    2020-12-23 18:48

    Depending on the variety of 'make' , you can sail through dependencies of tasks by using executable makefiles vs shell scripts .. i.e. in a scenario where one init script needs to start 10 services ... one after the other (i.e service two needs service one to be up and alive prior to starting), its easily done via a makefile.

    A lot of GNU/Linux packagers make use of this, i.e. debian/rules and others. So yeah, if done correctly, make is just as good at starting programs as it is as building them.

    The problem is, not everyone has a build tool chain installed .. so shell scripts or batch files remain the portable (hence 'correct') approach.

提交回复
热议问题