2.5 makefiles

I like to use makefiles fairly extensively and there is a ton of information available [online](https://www.gnu.org/software/make/manual/html_node/Introduction.html. GNU make has been around for a long time and is used a dependency matching tool. By this in your makefile, you define the dependencies of each file. For example my_script.R generates my_analysis.csv and then my_analysis.csv is used in my_pdf.Rmd that generated the report.pdf. If you define these hierarchies in your makefile you can just type “make” into the console and the makefile will only run those scripts that are necessary based on the time stamps. If my_csv.csv were older than the code in my_script.R then entire dependency series would be run. This is extremely useful when you get new data and have to re-run your analysis, or you have long running code and you only need to update that which changed.

Again, I like to use makfile to automate these processes, but you certainly don’t have to adopt my approach. In the next section I give examples of the makefiles that I often use.