-
-
Save kristopherjohnson/c804c1d7f559ac7b11b6bdcb3d04c898 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