let o_file = change_file_extension "o" c_file in
target (more_recent [o_file] [c_file]);
- sh "cc -c %s -o %s" c_file o_file
+ sh "cd $builddir && cc -c %s -o %s" c_file o_file
}
In the second example, the rule requires that several files
require (compiled source);
let object = change_file_extension "o" source in
- sh "cc %s -o %s" object program
+ sh "cd $builddir && cc %s -o %s" object program
}
*)
{v command ||: }
to ignore the result of a command.
- Each shell runs in a new temporary directory. The temporary directory
- and all its contents is deleted after the shell exits. If you
- want to save any data, [cd] somewhere. For example you could start
- the command sequence with:
- {v cd $HOME/data/ }
+ Each shell runs in a new temporary directory. The temporary
+ directory and all its contents is deleted after the shell exits.
+ If you want to save any data, [cd] somewhere. The environment
+ variable [$builddir] is exported to the script. This is the
+ current directory when the goaljobs program was started.
+
+ For example you could start the command sequence with
+ [cd $HOME/data/] or [cd $builddir].
*)
val sh : ('a, unit, string, unit) format4 -> 'a
Any lines printed to stdout is returned as a list of strings.
Trailing [\n] characters are not returned. *)
-(*
val shell : string ref
(** Set this variable to override the default shell ([/bin/sh]). *)
-*)
(** {2 String functions}