jgm/peg-markdown — pull request #8 by rctay (2012-01-31 09:29:59+00:00)
Title: improved support for building on mingw

By the end of this pull request, mingw users just have to do

make PKG_CONFIG=c:/path/to/glib/bin/pkg-config.exe

Quick overview of changes:

1. Makefile: re-use $PROGRAM in the target 'all'
This is just a small cleanup, so that when we add the extension later on, we just have to change `$PROGRAM`.

1. Makefile: add support for executable extensions
Main bulk of this pull-request. We use `uname` to see if we are on mingw; if so, add the `.exe` extension to binaries.

1. Makefile: allow pkg-config path to be configurable
Again, not essential, but makes building on mingw more convenient, where glib is probably installed separately and/or not on `PATH`.

1. Makefile: improve library order
Older versions of gcc need to have the order of libraries/object files massaged - that is, libraries that provide functions should be at the back.
More info here: http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html