Amalgam/unamalgam mongoose networking library

#1
  1. My goal is: To amalgam/unamalgam the source code according to
    https://github.com/cesanta/mongoose/tree/master/tools

  2. My actions are:
    a) call first the unamalgam.py
    $ tools/unamalgam.py mongoose.c

The folder common and mongoose are createtd. The folders contain *.c and *.h files. A mongoose.c.manifest is created.
Then I call
$ tools/amalgam.py --prefix=MG --public-header=mongoose.h $(cat mongoose.c.manifest) > mongoose.c

  1. The result I see is: A file mongoose.c with following content:

#include “mongoose.h”
#ifdef MG_MODULE_LINES
#line 1 “./$(cat”
#endif
#include “$(cat”
#ifdef MG_MODULE_LINES
#line 1 “./mongoose.c.manifest)”
#endif
#include “mongoose.c.manifest)”

  1. My expectation & question is: I expected to get the original mongoose.c file.
  • why is the original mongoose.c file not created?
  • why is the workflow in Readme.md in “reverse” order? I expected the process to be rather
    Development in multiple c and h files -> finally call amalgam.py to generate mongoose.c and mongoose.h. Why unamalgam.py at all? Shouldn’t it be a one way process?

Regrads

abro

#2

The unamalgam was created at a time when the unamalgamated sources were not published. Now they are, thus unamalgam is not needed - you’re correct.

#3

Ok, thank you. There are still the questions:

How to generate the amalgam version of mongoose? The .manifest file is not part of the repository.

Which version is the “ground truth”? The collection of single source files or the mongoose.c & mongoose.h files?

Regards

abro

#4

The amalgamated mongoose.[ch] in the repo is the truth.

There are few files missing in the exported sources, thus you can’t amalgamate at this point.