You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: automation00_index.html
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,7 @@ <h3>Hands-on activity</h3>
141
141
<li>How to use <code>make</code> from the <ahref="git09_shell.html">shell</a></li>
142
142
<li>How Git facilitates the process of building a pipeline</li>
143
143
</ul>
144
+
<p><em>2015-11-19 Andrew MacDonald translated the above into a pipeline for the <ahref="https://github.com/richfitz/remake"><code>remake</code> package</a> from Rich Fitzjohn: see <ahref="https://gist.github.com/aammd/72a5b98356893c001001">this gist</a>.</em></p>
Copy file name to clipboardExpand all lines: automation00_index.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ Walk before you run! Prove that `make` is actually installed and that it can be
44
44
* The interface between RStudio and `make`
45
45
* How to use `make` from the [shell](git09_shell.html)
46
46
* How Git facilitates the process of building a pipeline
47
+
48
+
*2015-11-19 Andrew MacDonald translated the above into a pipeline for the [`remake` package](https://github.com/richfitz/remake) from Rich Fitzjohn: see [this gist](https://gist.github.com/aammd/72a5b98356893c001001).*
<p><em>2015-11-17 NOTE: This year we made R packages before we used Make. The hope is, therefore, that the Make that ships with Rtools is all we need. So hopefully we can ignore this?</em></p>
99
+
<p>back to <ahref="automation00_index.html">All the automation things</a></p>
<h3>Install <code>make</code> on Microsoft Windows</h3>
101
102
<p>We are still working out the best way to install <code>make</code> on Windows. Our current best recommendation is to install <em>msysGit</em>, which includes <code>make</code> as well as <code>git</code> and <code>bash</code>.</p>
@@ -144,6 +145,7 @@ <h3>Issues we are still clarifying</h3>
144
145
<li>See <ahref="https://github.com/STAT545-UBC/Discussion/issues/54">issue 54</a> on the Discussion repo.</li>
145
146
</ul></li>
146
147
</ul>
148
+
<p>back to <ahref="automation00_index.html">All the automation things</a></p>
Copy file name to clipboardExpand all lines: automation02_windows.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ output:
10
10
11
11
*2015-11-17 NOTE: This year we made R packages before we used Make. The hope is, therefore, that the Make that ships with Rtools is all we need. So hopefully we can ignore this?*
12
12
13
+
back to [All the automation things](automation00_index.html)
14
+
13
15
### Install `make` on Microsoft Windows
14
16
15
17
We are still working out the best way to install `make` on Windows. Our current best recommendation is to install *msysGit*, which includes `make` as well as `git` and `bash`.
@@ -53,3 +55,5 @@ What are the tricky bits?
53
55
* Ensuring `make`, `Rscript`, `pandoc`, `rm`, etc. can be found = updating `PATH`.
54
56
* Getting `make` to use the correct [shell](git09_shell.html).
55
57
- See [issue 54](https://github.com/STAT545-UBC/Discussion/issues/54) on the Discussion repo.
58
+
59
+
back to [All the automation things](automation00_index.html)
<p>Before we use <code>make</code> for real work, we want to prove beyond a shadow of a doubt that it’s installed and findable from RStudio and/or the <ahref="git09_shell.html">shell</a>.</p>
109
+
<p>back to <ahref="automation00_index.html">All the automation things</a></p>
<p>You can delete this project after this test drive, so don’t sweat too much about what you name it or where you put it.</p>
@@ -175,6 +176,7 @@ <h3>Run <code>make</code> from the <a href="git09_shell.html">shell</a></h3>
175
176
</ul>
176
177
<p>You should be seeing similar output as you saw in the Build tab of RStudio.</p>
177
178
<p>If you are not, are you getting the error message that’s characteristic of a “spaces instead of tabs” problem? Or does it look more like <code>make</code> or other commands aren’t being found? If the latter, go back to the <ahref="automation02_windows.html">Windows installation page</a> or reach out to the course staff.</p>
179
+
<p>back to <ahref="automation00_index.html">All the automation things</a></p>
Copy file name to clipboardExpand all lines: automation03_make-test-drive.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ output:
10
10
11
11
Before we use `make` for real work, we want to prove beyond a shadow of a doubt that it's installed and findable from RStudio and/or the [shell](git09_shell.html).
12
12
13
+
back to [All the automation things](automation00_index.html)
14
+
13
15
### Create a temporary RStudio Project
14
16
15
17
You can delete this project after this test drive, so don't sweat too much about what you name it or where you put it.
@@ -107,3 +109,5 @@ RStudio only provides access to a very limited bit of `make` -- it's even more l
107
109
You should be seeing similar output as you saw in the Build tab of RStudio.
108
110
109
111
If you are not, are you getting the error message that's characteristic of a "spaces instead of tabs" problem? Or does it look more like `make` or other commands aren't being found? If the latter, go back to the [Windows installation page](automation02_windows.html) or reach out to the course staff.
112
+
113
+
back to [All the automation things](automation00_index.html)
<!-- TO DO: remake the figure to say words.txt not words.tsv and the new words downloading strategy -->
@@ -133,11 +134,6 @@ <h3>Set up a new RStudio Project (and Git repo)</h3>
133
134
<p>In RStudio: <em>File > New Project > New Directory > Empty Project.</em> If you’re a Git user, we strongly encourage you to click on “Create a git repository.”</p>
134
135
<p>This project will be useful as a reference in the future, so give it an informative name and location. If you’re a GitHub user, you may want to push it there as well.</p>
135
136
<p>Git(Hub) users: from here on out, we assume you will be committing at regular intervals. At key points, we explicitly prompt you to commit.</p>
136
-
<p>Configure this RStudio Project to work with <code>make</code>. Consult the <ahref="automation03_make-test-drive.html"><code>make</code> test drive</a> for details:</p>
137
-
<ul>
138
-
<li>make sure tabs are NOT replaced with spaces</li>
139
-
<li>set Project Build Tools to <code>Makefile</code></li>
<p>In RStudio: <em>File > New File > Text File.</em> Save it with the name <code>Makefile</code>. Keep adding the rules we write below to this file, saving regularly.</p>
147
+
<p>Once you’ve saved the file with the name <code>Makefile</code>, RStudio should indent with tabs instead of spaces. I recommend you display whitespace in order to visually confirm this: <em>RStudio > Preferences > Code > Display > Display whitespace characters</em>. A more extreme measure is to set Project or Global preferences to NOT replace tabs with spaces, but this will wreak havoc elsewhere.</p>
148
+
<p>You also want RStudio to recognize the presence of the <code>Makefile</code>. Pick one:</p>
149
+
<ul>
150
+
<li>set Project Build Tools to <code>Makefile</code></li>
151
+
<li>quit and relaunch</li>
152
+
</ul>
153
+
<p>You should see a “Build” tab now in the same pane as “Environment”, “History”, and, if applicable, “Git”.</p>
<p>The <code>.PHONY</code> line is where you declare which targets are <em>phony</em>, i.e. are not actual files to be made in the literal sense. It’s a good idea to explicitly tell <code>make</code> which targets are phony, instead of letting it try to deduce this. <code>make</code> can get confused if you create a file that has the same name as a phony target. If for example you create a directory named <code>clean</code> to hold your clean data and run <code>make clean</code>, then <code>make</code> will report <code>'clean' is up to date</code>, because a directory with that name already exists.</p>
359
363
<p><code>.DELETE_ON_ERROR</code> causes <code>make</code> to “delete the target of a rule if it has changed and its recipe exits with a nonzero exit status”. In English, this means that – if a rule starts to run but then exits due to error – any outputs written in the course of that fiasco will be deleted. This can protect you from having half-baked, erroneous files lying around that will just confuse you later.</p>
360
364
<p><code>.SECONDARY</code> tells <code>make</code> not to delete intermediate files of a chain of pattern rules. Consider creating a <code>Makefile</code> with two pattern rules, <code>%.md: %.rmd</code> and <code>%.html: %.md</code>, and then running <code>make report.html</code>. After <code>make</code> has created <code>report.md</code> and <code>report.html</code>, it will delete the intermediate file <code>report.md</code>. Adding <code>.SECONDARY</code> to your <code>Makefile</code> prevents the intermediate file from being deleted.</p>
365
+
<p>back to <ahref="automation00_index.html">All the automation things</a></p>
Copy file name to clipboardExpand all lines: automation04_make-activity.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@ The goal of this activity is to create a pipeline that will
19
19
20
20
You will automate this pipeline using `make`!
21
21
22
+
back to [All the automation things](automation00_index.html)
23
+
22
24
### Dependency graph of the pipeline
23
25
24
26
<!-- TO DO: remake the figure to say words.txt not words.tsv and the new words downloading strategy -->
@@ -33,11 +35,6 @@ This project will be useful as a reference in the future, so give it an informat
33
35
34
36
Git(Hub) users: from here on out, we assume you will be committing at regular intervals. At key points, we explicitly prompt you to commit.
35
37
36
-
Configure this RStudio Project to work with `make`. Consult the [`make` test drive](automation03_make-test-drive.html) for details:
37
-
38
-
* make sure tabs are NOT replaced with spaces
39
-
* set Project Build Tools to `Makefile`
40
-
41
38
Git folks: commit now.
42
39
43
40
### Sample Project and Git repository
@@ -50,6 +47,17 @@ The Project is set up for use with `make` at [this commit](https://github.com/ST
50
47
51
48
In RStudio: *File > New File > Text File.* Save it with the name `Makefile`. Keep adding the rules we write below to this file, saving regularly.
52
49
50
+
Once you've saved the file with the name `Makefile`, RStudio should indent with tabs instead of spaces. I recommend you display whitespace in order to visually confirm this: *RStudio > Preferences > Code > Display > Display whitespace characters*. A more extreme measure is to set Project or Global preferences to NOT replace tabs with spaces, but this will wreak havoc elsewhere.
51
+
52
+
You also want RStudio to recognize the presence of the `Makefile`. Pick one:
53
+
54
+
* set Project Build Tools to `Makefile`
55
+
* quit and relaunch
56
+
57
+
You should see a "Build" tab now in the same pane as "Environment", "History", and, if applicable, "Git".
58
+
59
+
Git folks: commit now.
60
+
53
61
### Get the dictionary of words
54
62
55
63
Depending on your OS and mood, you can get the file of English words by copying a local file or downloading from the internet.
@@ -312,3 +320,5 @@ The `.PHONY` line is where you declare which targets are *phony*, i.e. are not a
312
320
`.DELETE_ON_ERROR` causes `make` to "delete the target of a rule if it has changed and its recipe exits with a nonzero exit status". In English, this means that -- if a rule starts to run but then exits due to error -- any outputs written in the course of that fiasco will be deleted. This can protect you from having half-baked, erroneous files lying around that will just confuse you later.
313
321
314
322
`.SECONDARY`tells`make`nottodeleteintermediatefilesofachainofpatternrules.Considercreatinga`Makefile`withtwopatternrules,`%.md: %.rmd` and `%.html: %.md`, and then running `make report.html`. After `make` has created `report.md` and `report.html`, it will delete the intermediate file `report.md`. Adding `.SECONDARY` to your `Makefile` prevents the intermediate file from being deleted.
323
+
324
+
back to [All the automation things](automation00_index.html)
0 commit comments