Table of contents


Build Tools

A build tool is something which reads one or more input artifacts and writes one or more output artifacts.

flowchart LR 
    input1 --> buildtool[build tool] --> output
    input2 --> buildtool[build tool]
    input3 --> buildtool[build tool]

Examples:

  • C compiler consumes one .c file and zero or more .h files to produce a .o file
flowchart LR
    .c --> compiler[[compiler]]
    *.h --> compiler[[compiler]]
    compiler --> .o
  • C linker consumes one or more .o files to produce an executable file
flowchart LR
    *.o --> linker[[linker]]
    linker --> executable
  • C linker consumes one or more .o files to produce a shared object
flowchart LR
    *.o --> linker[[linker]]
    linker --> .so
  • Dynamic linker consumes an executable file and zero or more shared objects to produce a running process
flowchart LR
    executable --> linker[[dynamic linker]]
    *.so --> linker[[dynamic linker]]
    linker --> running[running executable]
  • Java compiler consumes a .java file to produce a .class files
flowchart LR
    .java --> compiler[[compiler]]
    compiler --> classfile[.class]
  • Java runtime consumes one or more .class files to produce a running process
flowchart LR
    classfile[*.class] --> runtime[[runtime]]
    runtime --> running[running executable]
  • Python bytecode compiler consumes a .py file to produce a .pyc file
flowchart LR
    .py --> compiler[[compiler]]
    compiler --> .pyc

The totality of ancestors for a given artifact may be represented as an Artifact Dependency Graph (ADG).

Code Generators

Typically, source code files are hand written by humans, and as such are leaf artifacts in the Artifact Dependency Graph (ADG).

Source code files can also be generated from other inputs by a code generator.

flowchart LR
    input[input] --> codegenerator[[code generator]] --> generatedsrc[generated source code file]

In this scenario, the generated source code file is a derived artifact. This is because the code generator is a build tool and, by definition, the output from the build tool is a derived artifact.

Code generation is very common in many languages. See go generate, Java Xtend, and qtcpp.

Table of contents