{ "cells": [ { "cell_type": "markdown", "metadata": { "tags": [], "user_expressions": [] }, "source": [ "# Lab Session 8: Automation and Make\n", "\n", "* **Statistics 159/259, Spring 2022**\n", "* Prof. F. Pérez and GSI F. Sapienza, Department of Statistics, UC Berkeley.\n", "* 04/07/2023\n", "\n", "**Acknowledgment:** The contents we are following for this course is based on the amazing tutorial about Automation and Make created by [The Carpentries](https://carpentries.org)" ] }, { "cell_type": "markdown", "metadata": { "user_expressions": [] }, "source": [ "Make is called a **build tool**: it builds files, plots, papers, etc. Today we are going to do everything from the the shell. If you haven't done the setup for the tutorial during last lecture, please follow the [setup page](https://swcarpentry.github.io/make-novice/setup) in order to start working with the contents of the tutorial. " ] }, { "cell_type": "markdown", "metadata": { "user_expressions": [] }, "source": [ "## 0. Setup\n", "\n", "Download the files form the [setup page](https://swcarpentry.github.io/make-novice/setup.html) in the Carpentries tutorial.\n", "We will start from the following version of our `Makefile` created inside the folder `make-lesson` provided in the tutorial.) you will find the data and scripts for this exercise. Add the corresponding files to your JupyterHub session. " ] }, { "cell_type": "markdown", "metadata": { "user_expressions": [] }, "source": [ "We will start working from the following template `Makefile`:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
# Count words.\n",
"\n",
"isles.dat : books/isles.txt\n",
"\tpython countwords.py books/isles.txt isles.dat\n",
"\n",
"abyss.dat : books/abyss.txt\n",
"\tpython countwords.py books/abyss.txt abyss.dat\n",
"\n",
".PHONY : clean\n",
"clean :\n",
"\trm -f *.dat\n",
"