Jam

Created on 2024-11-17T09:42:51-06:00

Return to the Index

This card pertains to a resource available on the internet.

This card can also be read via Gemini.

Jam is a built tool created by Perforce, forked for FreeType as FTJam, then forked again by Boost.

It is kind of a weak version of a generation 3 build system; you specify rules and parameters. These then go through a substitution engine which is allowed to perform some switches, loops, and simple recursion.

A "jamfile" is basically for storing the "what" while the "jamrules" are for storing the "how." There is also a stock version of the rules called the "jam base." But you can use a flag to bypass this and use *only* rules you have supplied.

There is also a system that tries to look for include statements in C files to figure out dependencies. This part only works for C but is optional?

The idea is that a file describes the role each source code blob takes (such "just build a console app from these files here") and the rules file translates that for the compiler and OS you are going to use for the job.

Example jamfile

Nim bonk : bonk.nim ;

DEPENDS all : bonk ;

Example jam rules

rule Nim {
   DEPENDS $(<) : $(>) ;
   for piss in $(3) {
      DEPENDS $(<) : $(piss) ;
   }
   Clean clean : $(<) ;
}

actions Nim {
   nim c -o:$(<) $(>)
}

rule Clean {
   DEPENDS $(<) : $(>) ;
}

actions Clean {
   rm -f $(>)
}

include Jamfile ;