Standardise Makefile target names
Our Makefiles have evolved organically over many years, and it seems like it would be useful to standardise the target names to follow a common structure, making it easier for new and external contributors to reason about the available targets. As an example, how does a 1st contributor reason about the difference between make build_simple
and make build_current
without going through the Makefiles?
One way would be to structure it like the following: <thing being built>-<output type>(-<target platforms>)
. As an example, build_simple
would become runner-bin-host
and build_current
would become runner-and-helper-bin-host
. Granted, the resulting name is longer, but makes it very easy to discover the rest of the target names.
The existing targets would be kept during a transition period and would simply call the new targets, just after printing a warning message informing the developer that the target name was deprecated and indicating the replacement target name.
Here's a full breakdown of the changes that this would entail (naming is ofc not final):
old target | new target | remarks |
---|---|---|
all |
(helper-docker-all +runner-bin-all ) |
Is this target really being used? |
helper-build |
helper-bin |
Build Runner Helper binaries for all supported platforms |
N/A | helper-bin-host |
NEW: Build helper binaries for host platform |
N/A | helper |
NEW: Build Runner Helper binaries and Docker image archives for all supported platforms |
N/A | helper-host |
NEW: Build Runner Helper binaries and Docker image archives for host platform |
helper-docker |
helper-dockerarchive |
Build Runner Helper Docker image archives for all supported platforms |
N/A | helper-dockerarchive-host |
NEW: Build Runner Helper Docker image archives for host platform |
build_all |
runner-bin |
Build Runner binaries for all supported platforms |
build_simple |
runner-bin-host |
Build Runner binaries for host platform |
N/A | runner-bin-linux |
NEW: Build Runner binaries for the Linux platform |
build_current |
runner-and-helper-bin-host |
Build Runner and Helper binaries and Runner Helper Docker image for host platform (NOTE: previously Docker images were built for all platforms) |
N/A | runner-and-helper-bin |
NEW: Build Runner binaries and Runner Helper Docker images for all supported platforms |
N/A | runner-and-helper-bin-linux |
NEW: Build Runner binaries and Runner Helper Docker images for the Linux platform (used by runner-and-helper-deb/rpm ) |
build_current_docker |
runner-and-helper-docker-host |
Build Runner and Runner Helper Docker images for host platform |
build_current_deb |
runner-and-helper-deb-host |
Build binaries and .deb package for host platform |
build_current_rpm |
runner-and-helper-rpm-host |
Build binaries and .rpm package for host platform |
package-deb-fpm |
package-deb-arch |
Build .deb package for specified Linux architecture (dropping fpm since it's an implementation detail) |
package-rpm-fpm |
package-rpm-arch |
Build .rpm package for specified Linux architecture (dropping fpm since it's an implementation detail) |
In addition, make build_simple
currently outputs a gitlab-runner
, whereas make build_current
outputs a gitlab-runner-linux-amd64
. make runner-bin-all
will just use gox
to output the correct host binary (with the full name) and make a copy of the one for the current architecture under out/binaries/gitlab-runner
, so we always have exactly the same binary, regardless of which target is used to build it.