blog #programming ##xmk

Writing that perfect Makefile

Realizing that I didn't want xmk to miss Make's core feature made me feel a bit silly for trying to reinvent it. Thus I ended up spending a good couple hours trying to come up with a Makefile that could make me feel satisfied. Pretending I was only ever building for one platform without any separate debug buils led me to this:

xmk (cont.)

Some updates after having put more thought into it.

xmk is another build automation tool inspired by Make. It features a hierarchical block structure and a function interface to facilitate Make-like dependency resolution.It aims to be simple and explicit even in projects that are meant to be compiled for more than one platform.
Make and build automation

Trying to understand makefiles caused me quite the trouble back when I was working on my game engine a few years back. I eventually settled on a lukewarm solution that worked, but always recompiled the entire game it was targeting. No matter how I looked at it I wasn't happy with the makefile format and ended up writing my own build script that would read flags and libraries from a yaml file. It worked surprisingly well and only compiled source files that needed to be (re)compiled.
This weekend I took another look at make. Learned a few additional things. In the end I still wasn't happy. However I also found myself no longer quite so satisfied with the build script I had written. It's too inflexible and the yaml tree it operates on is actually quite ugly to write and read. So I decided I'd try to invent my own flavor of Make. Here's the planned result: