aboutsummaryrefslogtreecommitdiff
path: root/doc/decompress-compile-run.scm
diff options
context:
space:
mode:
Diffstat (limited to 'doc/decompress-compile-run.scm')
-rw-r--r--doc/decompress-compile-run.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/decompress-compile-run.scm b/doc/decompress-compile-run.scm
new file mode 100644
index 0000000..437fb41
--- /dev/null
+++ b/doc/decompress-compile-run.scm
@@ -0,0 +1,18 @@
+(define decompress
+ (command #:run "gzip" "--stdout" "--decompress" (input 'compressed #:type 'File)
+ #:outputs (output 'decompressed #:type 'stdout)))
+
+(define compile
+ (command #:run "gcc" "-x" "c" (input 'source #:type 'File)
+ #:outputs (output 'executable
+ #:type 'File
+ #:binding '((glob . "a.out")))))
+
+(define run
+ (command #:run (input 'executable)
+ #:outputs (output 'stdout #:type 'stdout)))
+
+(workflow ((compressed-source #:type File))
+ (pipe (decompress #:compressed compressed-source)
+ (compile #:source decompressed)
+ (run #:executable executable)))