Loading

golang Makefiles

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.


Related Posts

  1. iPhone/iPad UISearchBar and UISearchDisplayController Asynchronous Example
  2. Fix for Spork Not Reloading Models with Rails 3
  3. High Availability on a Shoestring -- Postgresql 9.0 Streaming Replication
  4. SPF Records with Rails and ActionMailer
  5. My 5 Must-have vim Plugins
You should follow me on Twitter: @patrickxb