Do we still need makefiles in 2018?

477 views
Skip to first unread message

Nyah Check

unread,
Jun 18, 2018, 5:13:41 AM6/18/18
to golang-nuts
Hi,

I've been thinking about this lately especially when it comes to Go, do we really still need to write makefiles for our projects? I believe the 'go build' tool is awesome and newer tools have been popping up like 'bazel' etc. I just want to hear more thoughts on this, because I believe it might just be a hangover from the *nix world.

Cheers!
Nyah

Jan Mercl

unread,
Jun 18, 2018, 5:19:11 AM6/18/18
to Nyah Check, golang-nuts
On Mon, Jun 18, 2018 at 11:13 AM Nyah Check <check...@gmail.com> wrote:

> I've been thinking about this lately especially when it comes to Go, do we really still need to write makefiles for our projects? I believe the 'go build' tool is awesome and newer tools have been popping up 
> like 'bazel' etc. I just want to hear more thoughts on this, because I believe it might just be a hangover from the *nix world.

I'm not sure what makefiles you're talking about. Please expand/add an example etc., thanks.

--

-j

Nyah Check

unread,
Jun 18, 2018, 5:22:33 AM6/18/18
to golang-nuts


I'm not sure what makefiles you're talking about. Please expand/add an example etc., thanks.


i"m referring to make as build automation tool for building our large scale projects in 2018. I've wondered why most large projects still use it. Is it because it still works fine or because there's been no other tool available which would be widely accepted by the developer community.

Jan Mercl

unread,
Jun 18, 2018, 5:33:23 AM6/18/18
to Nyah Check, golang-nuts
On Mon, Jun 18, 2018 at 11:22 AM Nyah Check <check...@gmail.com> wrote:

> i"m referring to make as a build automation tool for building our large scale projects in 2018. I've wondered why most large projects still use it. 
> Is it because it still works fine or because there's been no other tool available which would be widely accepted by the developer community. 

My question was not about what is a Makefile, but if you have an example of such.

If a Go package is go get-able then a Makefile does not concern you. If present, it's a developer-only tool. (All my packages have a Makefile that no user has to ever run.)

If a Go package is not go get-able then there's usually a good reason for it to have same build/install recipe, being it a Makefile of anything else.


--

-j

Nyah Check

unread,
Jun 18, 2018, 5:36:49 AM6/18/18
to golang-nuts
 
My question was not about what is a Makefile, but if you have an example of such.

If a Go package is go get-able then a Makefile does not concern you. If present, it's a developer-only tool. (All my packages have a Makefile that no user has to ever run.)

If a Go package is not go get-able then there's usually a good reason for it to have same build/install recipe, being it a Makefile of anything else.



I get your point, I'm just a little surprised that we're in 2018 and nothing has come up in the dev tool box to beat make. Guess it's still the classic. 

T L

unread,
Jun 18, 2018, 5:59:06 AM6/18/18
to golang-nuts

Go tools are not the competitor of build systems.

BTW, what are the benefits of using make to build Go source code?

Henrik Johansson

unread,
Jun 18, 2018, 6:02:53 AM6/18/18
to T L, golang-nuts
We use make for various other things for our service apps such as packaging installable artifacts and generating docs.
Makefiles are good at this and only occasionally has it's edge case weirdnesses made me consider something else but the options are few.

Mage https://github.com/magefile/mage might at some time do the trick.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Harmen

unread,
Jun 18, 2018, 6:13:37 AM6/18/18
to T L, golang-nuts
On Mon, Jun 18, 2018 at 02:59:06AM -0700, T L wrote:
>
> BTW, what are the benefits of using make to build Go source code?

I find a trivial Makefile good additional documentation for people who don't
use Go every day.
When I have to build a random Haskell/Scala/Ruby/whatever project and the
README doesn't explain me how to use whatever build system they use I'm usually
annoyed enough to go elsewhere.

Scott Pakin

unread,
Jun 19, 2018, 6:31:04 PM6/19/18
to golang-nuts
On Monday, June 18, 2018 at 3:13:41 AM UTC-6, Nyah Check wrote:
I've been thinking about this lately especially when it comes to Go, do we really still need to write makefiles for our projects? I believe the 'go build' tool is awesome and newer tools have been popping up like 'bazel' etc. I just want to hear more thoughts on this, because I believe it might just be a hangover from the *nix world.
  1. Multi-language projects (Go + other)
  2. As Harmen wrote, standardization and "documentation" for non-Go users, even if it just does a go get or an echo Please use go get instead.
  3. Support for additional build targets such as clean, dist, and install (with DESTDIR, prefix, bindir etc.)
  4. Installing documentation, data files, and other things Go doesn't know about

John Unland

unread,
Jun 24, 2018, 4:06:36 PM6/24/18
to golang-nuts
Totally agree, I use make to build multiple targets (x86, ARMHF, ARM64 etc.) plus I can inject in build information such as Go version and git hashes inside my binary without having to type out the full path to variables. I also like to run reports, so for Go I'm investigating binary sizes so I have a target in a make file that runs about 3 tests with different ldflags and it reports the size of the binary all on one command.
Reply all
Reply to author
Forward
0 new messages