th1-sgb  Artifact Content

Artifact cdb3e113b4446e25480a04f94b6f33ec5c85a5d8:

Wiki page [AmalgamationBuild] by stephan 2012-07-22 14:05:12.
D 2012-07-22T14:05:12.371
L AmalgamationBuild
P ab856fddb15612b5d7308d2158bbebaa16cf0325
U stephan
W 1111
<h1>Amalgamation Build</h1>

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, <tt>th1_amalgamation.{c,h}</tt>, 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: <tt>th1_register_client()</tt>. Clients may implement it, append that to the amalgamation, and then distribute that. Downstream code which then calls <tt>th1_register_client()</tt> will pick up whatever extensions have been added there.

Z 89d7153c2bb4ab699bb5a075c2111546