build lib, spec, and commands directories