Common Build Tools #
This file defines general utilities that abstract common build functionality and provides some common concrete build functions.
General Utilities #
Check if the info
is up-to-date by comparing depTrace
with traceFile
.
Instances For
Build info
unless it already exists and depTrace
matches that
of the traceFile
. If rebuilt, save the new depTrace
to the tracefile
.
Instances For
Fetch the trace of a file that may have its hash already cached in a .hash
file.
Instances For
Compute the hash of a file and save it to a .hash
file.
Instances For
Build file
using build
unless it already exists and depTrace
matches
the trace stored in the .trace
file. If built, save the new depTrace
and
cache file
's hash in a .hash
file. Otherwise, try to fetch the hash from
the .hash
file using fetchFileTrace
.
By example, for file := "foo.c"
, compare depTrace
with that in foo.c.trace
and cache the hash using foo.c.hash
.
Instances For
Build file
using build
after dep
completes if the dependency's
trace (and/or extraDepTrace
) has changed.
Instances For
Build file
using build
after deps
have built if any of their traces change.
Instances For
Build file
using build
after deps
have built if any of their traces change.
Instances For
Common Builds #
A build job for file that is expected to already exist (e.g., a source file).
Instances For
Build an object file from a source file job using compiler
. The invocation is:
compiler -c -o oFile srcFile weakArgs... traceArgs...
The traceArgs
are included as part of the dependency trace hash, whereas
the weakArgs
are not. Thus, system-dependent options like -I
or -L
should
be weakArgs
to avoid build artifact incompatibility between systems
(i.e., a change in the file path should not cause a rebuild).
You can add more components to the trace via extraDepTrace
,
which will be computed in the resulting BuildJob
before building.
Instances For
Build an object file from a source fie job (i.e, a lean -c
output) using leanc
.
Instances For
Build a static library from object file jobs using the ar
packaged with Lean.
Instances For
Build an executable by linking the results of linkJobs
using leanc
.