aboutsummaryrefslogtreecommitdiff
path: root/test/make.rb
blob: e1a6fff8d422f01a42fb3bd2041580fd5ce03db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

require '../rubymake'

to(/test(.*).h/, "make.rb") do |target|
  File.open(target, ?w) do |f|
    f.puts "#define STRING \"This is a string\""
  end
end

to(/test(.*)(?!\.c)/, "test$1.c", "test$1.h") do |target, froms|
  `gcc -o #{target} #{froms[0]}`
end

to("clean", phony: true) do |target|
  `rm -f testprog testprog.h`
end

default "testprog"

Make.make!