Iplement makefile magic

Use the $< and $(addprefix ...) makefile macros.