2014-11-06 00:33:20 +00:00
|
|
|
class Makefile2graph < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Create a graph of dependencies from GNU-Make"
|
2014-11-06 00:33:20 +00:00
|
|
|
homepage "https://github.com/lindenb/makefile2graph"
|
2015-01-20 00:32:01 +00:00
|
|
|
url "https://github.com/lindenb/makefile2graph/archive/v1.5.0.tar.gz"
|
|
|
|
sha1 "0f7be09d8b77e3a0b1769ddd011a45283ea4f1f4"
|
2014-11-06 00:33:20 +00:00
|
|
|
head "https://github.com/lindenb/makefile2graph.git"
|
|
|
|
|
2014-11-06 19:03:15 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-01-20 00:44:42 +00:00
|
|
|
sha1 "dd3b740ea2abc872fca365d6e6872b36cad8d10d" => :yosemite
|
|
|
|
sha1 "eef36f040d63dd9df3ec69cb787b1ceea610bf42" => :mavericks
|
|
|
|
sha1 "f2ae7bcf26c93031f82d15dc636885aff4c0b1da" => :mountain_lion
|
2014-11-06 19:03:15 +00:00
|
|
|
end
|
|
|
|
|
2014-11-06 00:33:20 +00:00
|
|
|
depends_on "graphviz" => :recommended
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
system "make", "test" if build.with? "graphviz"
|
2015-01-20 00:32:01 +00:00
|
|
|
bin.install "make2graph", "makefile2graph"
|
|
|
|
man1.install "make2graph.1", "makefile2graph.1"
|
2014-11-06 00:33:20 +00:00
|
|
|
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"
|
2015-01-20 00:32:01 +00:00
|
|
|
system "#{bin}/makefile2graph"
|
2014-11-06 00:33:20 +00:00
|
|
|
end
|
|
|
|
end
|