diff options
author | Nat Lasseter <user@4574.co.uk> | 2024-05-24 15:10:08 +0100 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2024-05-24 15:10:08 +0100 |
commit | f08c0939608f5ed95652d71778400efc3fd92c32 (patch) | |
tree | 89e811cdeef3dfd9d740fb6d1ed2ae25b09ef6d1 /test |
Diffstat (limited to 'test')
-rwxr-xr-x | test/make.rb | 21 | ||||
-rw-r--r-- | test/testprog.c | 6 |
2 files changed, 27 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! diff --git a/test/testprog.c b/test/testprog.c new file mode 100644 index 0000000..cfeb3d6 --- /dev/null +++ b/test/testprog.c @@ -0,0 +1,6 @@ +#include <stdio.h> +#include "testprog.h" + +void main() { + printf(STRING "\n"); +} |