Use substitution references in Makefile

Switch to using substitution references instead of "addsuffix" function
in Makefile where appropriate, for brevity.
Add header dependency rules generation

Add generation and use of header dependency rule files to the Makefile.
Add debug module

Add debug.S/debug.h a macro and a module for debugging support,
containing only register dump function so far.
Add debug_test.S - a minimal debug module test.