Makefile: split part into a common makefile (common.mk)