#!/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!