aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/csmith.rb
blob: ec49d79a7123dff07d91668de568fbf91d625756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class Csmith < Formula
  homepage "http://embed.cs.utah.edu/csmith/"
  url "http://embed.cs.utah.edu/csmith/csmith-2.2.0.tar.gz"
  sha1 "3435ce22e645977e03cf6418da076ff3f7a1d4f0"

  bottle do
    cellar :any
    sha1 "148f6ff8f8bfbca55af569fa6db560e6917c6d98" => :yosemite
    sha1 "98647f884d0e48cf487a47d627c9c66f01aef06e" => :mavericks
    sha1 "551902d606958f2e504103a648b0fcca6edc5e69" => :mountain_lion
  end

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make"
    system "make", "install"
    mv "#{bin}/compiler_test.in", share
    (include/"csmith-#{version}/runtime").install Dir["runtime/*.h"]
  end

  def caveats; <<-EOS.undent
    It is recommended that you set the environment variable 'CSMITH_PATH' to
      #{include}/csmith-#{version}
    EOS
  end

  test do
    system "#{bin}/csmith", "-o", "test.c"
  end
end