Created
August 5, 2020 17:47
-
-
Save MLKrisJohnson/52d3c184da6a74aa4243e0d37654baa8 to your computer and use it in GitHub Desktop.
Makefile that runs GraphViz Dot utility on all *.gv files in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile for GraphViz files in this directory | |
# | |
# `make all` - build all targets | |
# `make clean` - delete all targets | |
# `make listtargets` - print list of all targets | |
# `brew install graphviz`, or download from <http://graphviz.org/download/> | |
# to get the `dot` utility. | |
DOT?=dot | |
# Pattern rules | |
%.png : %.gv | |
$(DOT) -Tpng -o $@ $< | |
%.svg : %.gv | |
$(DOT) -Tsvg -o $@ $< | |
# Process all *.gv files in this directory, producing .png and .svg output. | |
SRC_FILES=$(wildcard *.gv) | |
OUT_FILES=$(SRC_FILES:.gv=.png) $(SRC_FILES:.gv=.svg) | |
all: $(OUT_FILES) | |
.PHONY: all | |
listtargets: | |
@echo $(OUT_FILES) | |
.PHONY: listtargets | |
clean: | |
- $(RM) $(OUT_FILES) | |
.PHONY: clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment