I think this is the only working one after some thoughs. We must depend on phony dir targets, since the .o file can not depend on the .a file due to .a file always being newer.