The first post in an ongoing series of how to do easy, stupid things, here’s how to write a super simple makefile for a command line program in Go:
include $(GOROOT)/src/Make.inc
TARG=ggoog
GOFILES=download.go
include $(GOROOT)/src/Make.cmd
TARG is what your executable will be called. Put any files that need to be compiled into GOFILES.
The trick is including Make.inc at the top and Make.cmd at the bottom. (If you want to build a package, you would include Make.pkg at the bottom.)
If your environment variables aren’t set correctly, just run gomake instead of make.