Zack Williams | 3645191 | 2022-03-04 20:31:37 -0700 | [diff] [blame^] | 1 | Make |
| 2 | ==== |
| 3 | |
| 4 | Make is a unix tool that provides a dependency-based way to execute commands. |
| 5 | |
| 6 | The make command takes a parameter, known as the **target** which is usually |
| 7 | the name of a file you would like to generate, or set of commands you would |
| 8 | like to run. |
| 9 | |
| 10 | |
| 11 | Best Practices |
| 12 | -------------- |
| 13 | |
| 14 | Include a ``help`` target in the Makefile. This can be automatically generated |
| 15 | from comments in the Makefile. There are many forms for this - this one is |
| 16 | recommended:: |
| 17 | |
| 18 | # makefile example... |
| 19 | |
| 20 | This will work on both GNU and BSD implementations (``sed`` specifically). |
| 21 | |
| 22 | Formatting |
| 23 | ---------- |
| 24 | |
| 25 | Each line of a Makefile is a new shell invocation - if you need to maintain the |
| 26 | state of a shell (ex: entering a virtualenv, setting variables, etc.) you |
| 27 | should wrap lines with ``;\\`` to separate individual commands while retaining |
| 28 | the same shell instance. |