Adding a Makefile for Multi-git
See how a Makefile for multi-git can tie all these capabilities together and provide a one-stop shop for managing your program. We will also discuss the relationship between Makefiles and CI/CD pipelines as well as alternatives to Makefiles.
Creating a Makefile for multi-git
Let’s start with the most basic target: build
. The comment with the double hashtags will become a nice help message later. Note the tabbed indentation, which is an infamous gotcha of Makefiles. Another important issue is escaping the Dollar sign by doubling it. This is necessary because a single Dollar sign is used by Makefile variables. The command itself is using the -ldflags
to inject the git tag and timestamp to the program and writes the executable to the current directory while adding the OS and architecture.
### Build
...Get hands-on with 1400+ tech skills courses.