News for hackers. Stuff that matters.
Re:Build Golang projects properly with Makefiles by dozzie on Thursday December 08, 2016 @06:58AM (#13129788)

  BUILD=`git rev-parse HEAD`
  LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
  # ...
  $(BINARY):
      go build ${LDFLAGS} -o {$BINARY} ./..
Please don't do that. This ties the build process to be run from inside the git repository, which starts to be a problem if you have any sane method of code deployment (building source packages). Think of something different.

And yes, there is a typo in the build rules.

Re:Build Golang projects properly with Makefiles by jquast on Thursday December 08, 2016 @09:14AM (#13130360)
I rather prefer this scenario, labeling a package release with vcs revision id or even branch name, for example.
Re:Build Golang projects properly with Makefiles by Annatar on Thursday December 08, 2016 @07:10AM (#13129842)

  ${BINARY}: main.go
    go build $< -o $@
this way, make will know to re-build the binary only if the source code has changed.