diff options
Diffstat (limited to 'test/make.rb')
-rwxr-xr-x | test/make.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/make.rb b/test/make.rb new file mode 100755 index 0000000..e1a6fff --- /dev/null +++ b/test/make.rb @@ -0,0 +1,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! |