makefile is becoming complexer and complexer, so use pattern to make it simple