th1-sgb  AmalgamationBuild

Amalgamation Build

The library's sources can be "compacted" into a two-file distribution (one header and one implementation file) with:

make amal

The output is two files, th1_amalgamation.{c,h}, which can be dropped in to client projects and compiled as part of it:

$ make amal
Generating dependencies...
Creating th1_amalgamation.h...
Creating th1_amalgamation.c...
$ gcc -c -std=c89 -pedantic -Wall -Werror th1_amalgamation.c
$ clang -c th1_amalgamation.c
$ tcc -c th1_amalgamation.c

The library also provides a basic mechanism for adding one's own functionality to the amalgamation build, the intention being to allow a user to more easily copy shared th1 routines amongst his scripted projects. The library interface declares a function which it does not implement: th1_register_client(). Clients may implement it, append that to the amalgamation, and then distribute that. Downstream code which then calls th1_register_client() will pick up whatever extensions have been added there.