written a generic framework of rules that the contrib makefiles can use instead of writing their own each time. You only need to set a few variables and off you go.
Could do with more testing, but it works in the simple cases.