ts_lib: Add a rule for building static libraries for modules