Say you have little project with a file called main.tl, which looks like this:
(load "scanner")
(load "parser")
(load "logic")
(compile-only
(startup-function))
Then this build script will compile it for you:
(flet ((comp (file)
(if (compile-update-file file)
(put-line `compiled @file.tl -> @file.tlo`))))
(with-compilation-unit
(comp "main")
(with-stream (s (open-file "main.tl"))
(whilet ((form (read s *stderr* nil)))
(when-match (load @file) form
(comp file))))))
Put that into a build.tl file and run with txr build.tl.
There is nothing to define anywhere; it looks for (load ...) forms in the file and compiles the indicated files.