extract makefile.dir() to create directory rules