Wednesday, November 19, 2014

Using make with Stata

Having a makefile helps automate a lot of tasks with a project.

  • Generating different formats of logs, tex tables, and gphs (including making versions of the figs that have no titles). And removing orphan files if the primary ones are removed.
  • Normalizing logs, gphs, and dtas prior to committing.
  • Generating PDFs of Lyx files.
  • Updating the project mlib when mata files change.
  • Installing updated versions of packages that have to be installed.
  • Running Stata in batch mode, knowing the dependencies between code files (and setting up a gateway file so that on Windows modules can run shell commands).
  • Deals with SVN commands.
Here is stub version. It uses statab.sh, cli_build_proj_mlib.do, gph2fmt.ado, cli_gph_eps.do,  cli-install-module.docli_smcl_log.do (plus the normalizing ones).

Edit 2015-01-28: I've posted a project template with updated versions of these (and better makefiles as my skill improves) at GitHub

No comments: