added a better build rule abstraction to simplify client code, and address make/nija compatibility