aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorShaun Jackman2014-11-05 16:33:20 -0800
committerMike McQuaid2014-11-07 09:05:00 +0000
commit3f1d49334d1fb0d529b0a3d530cde6bcebc24421 (patch)
tree24b4ce60c6e635df58b0c6df993549ec6aef3fa5 /Library/Formula
parentefec96c75fe4125a7ebd37789f0a0f19d666033d (diff)
downloadhomebrew-3f1d49334d1fb0d529b0a3d530cde6bcebc24421.tar.bz2
makefile2graph: New formula
Creates a graph of dependencies from GNU-Make; Output is a graphiz-dot file or a Gexf-XML file. Closes #33952
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/makefile2graph.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/Library/Formula/makefile2graph.rb b/Library/Formula/makefile2graph.rb
new file mode 100644
index 000000000..86ae7a319
--- /dev/null
+++ b/Library/Formula/makefile2graph.rb
@@ -0,0 +1,32 @@
+require "formula"
+
+class Makefile2graph < Formula
+ homepage "https://github.com/lindenb/makefile2graph"
+ url "https://github.com/lindenb/makefile2graph/archive/stable1.2.tar.gz"
+ sha1 "fd6799c23e4b9599f4caf23b0ce0993ab33362a8"
+ head "https://github.com/lindenb/makefile2graph.git"
+
+ depends_on "graphviz" => :recommended
+
+ def install
+ system "make"
+ system "make", "test" if build.with? "graphviz"
+ bin.install "make2graph"
+ man1.install "make2graph.1"
+ doc.install "LICENSE", "README.md", "screenshot.png"
+ end
+
+ test do
+ (testpath/"Makefile").write <<-EOS.undent
+ all: foo
+ all: bar
+ foo: ook
+ bar: ook
+ ook:
+ EOS
+ system "make -Bnd >make-Bnd"
+ system "#{bin}/make2graph <make-Bnd"
+ system "#{bin}/make2graph --root <make-Bnd"
+ system "#{bin}/make2graph -x <make-Bnd"
+ end
+end