Makefile for SDL testbed

After playing with Makefiles to make this site, one thing I realized is that make would be more useful for a testbed project than my goto cmake, as it is way easier to create and manage a big number of targets. I started with the Makefile tutorial’s cookbook, I wanted to do the following:

This is the resulting Makefile:

Using it

With this I can create a foo.cpp file under src/ subdirectory with demo_ prefix and the following will just work:

$ make build/demo_foo
$ build/demo_foo