Using Makefile
Important message
While it is possible to use Makefiles on Windows (e.g. choco install make), this is much more a Unix thing because GNU Make is already installed on Linux and macOS. If you control the Windows environment on which the code will be running, it is totally feasible for you to use them. However, if you expect other users to run your code, this might not be the best solution.
GNU Make (https://www.gnu.org/software/make/) is a tool that lets you automate some tasks. It has a powerful syntax in which you define rules (https://www.gnu.org/software/make/manual/html_node/Rules.html) and their behavior. And later, you execute the make $target
command to run the behavior you defined. Before generating code from proto files, let’s see an example.
We will create a basic rule called hello
that prints Hello, world
on the standard output. Create a file called Makefile
and add the following content to it:
hello: @echo "Hello...