[refactor] add mk.rules to simplify makefile and socase.h for test