mongoose/tools
Dmitry Frank ac921d4657 Improve includes in the amalgamation script
Now it also tries to find the included file relatively to the "parent"
file. This is required for amalgamation of the frozen into mjs, since
`frozen.c` includes `frozen.h` instead of `frozen/frozen.h`.

PUBLISHED_FROM=8f670a1509a30cfdfb22e454b7851f4cf28fb98d
2017-01-13 00:24:43 +00:00
..
amalgam.py Improve includes in the amalgamation script 2017-01-13 00:24:43 +00:00
README.md Rename tools/amalgam to tools/amalgam.py 2016-11-21 22:19:19 +00:00
unamalgam.py Re-enable amalgam tools publishing 2016-11-21 22:36:43 +00:00

Amalgamation

Mongoose is distributed as two files, mongoose.c and mongoose.h for ease of integration. However, when developing Mongoose itself, it can be quite difficult to work with them. Internally, these files are an amalgamation of source an header modules. This directory contains utilities to split and re-constitute amalgamated files.

Here's how mongoose.c can be split into its consituent parts:

$ tools/unamalgam.py mongoose.c
=> mongoose/src/internal.h
=> common/cs_dbg.h
...

This produces directories and files under mongoose/ and common/ that are easeier to work with. It also produces mongoose.c.manifest which can later be used to reconstruct the file back:

$ tools/amalgam.py --prefix=MG --public-header=mongoose.h $(cat mongoose.c.manifest) > mongoose.c

The same applies to mongoose.h, except --public-header should be omitted during amalgamation.