Commit 06e5146
make: prevent svg/png generation when dot is unavailable (#117)
## Summary
This is a small follow up to review comments from PR #111 where adding a
fast-fail check for Graphviz (dot) was suggested but not included before
merge.
## Changes
- Add check-graphviz target
- Wire it into svg and png
- Add to .PHONY
- Provide OS agnostic error message
## Before
running:
```
make svg
```
produces many repeated shell errors after generating all .dot files:
```
Converting assert_eq.smir.dot -> assert_eq.smir.svg
/bin/sh: line 4: dot: command not found
...
make: *** [Makefile:94: svg] Error 127
```
## After
```
$ make svg
Error: Graphviz is not installed or 'dot' is not in PATH.
Please install Graphviz for your system and ensure 'dot' is available.
See: https://graphviz.org/download/
```
## How to test
1. Temporarily uninstall Graphviz or remove dot from PATH
2. Run: make svg
3. Observe immediate fast-fail message
4. Reinstall Graphviz
5. Run again. Graphs generate normally
## Context
Reviewer suggestion here:
#111 (comment)
#111 (comment)
#111 (comment)
#111 (comment)
Co-authored-by: Daniel Cumming <124537596+dkcumming@users.noreply.github.com>1 parent 41c7d55 commit 06e5146
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| |||
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
92 | | - | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | | - | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
| |||
0 commit comments