]> begriffs open source - libderp/blob - README.md
Generate .a/.so
[libderp] / README.md
1 ## libderp, yet another C collection library
2
3 Why you might use it
4
5 * builds with any variant of make, any C99 compiler
6 * a proper library that you can link against
7 * no abuse of translation units, no weird macros
8 * includes proper man pages (TODO)
9 * shared and static library
10 * pkg-config interface (TODO)
11 * available through OS package manager (TODO)
12 * developer friendly ISC license
13
14 Why you might avoid it
15
16 * containers use void pointers, e.g. no vector of ints
17 * pedestrian algorithms, not cutting edge
18 * hard-coded to use malloc/free
19 * not (yet) thread safe
20
21 ### Building
22
23 To make optimized object files in `build/release`, simply run:
24
25 ```sh
26 # works with any make variant, and any C99 compiler
27 make
28 ```
29
30 To build in `build/dev` with warnings, profiling, debugging information, and
31 code coverage data, use the "dev" variant:
32
33 ```sh
34 # requires clang specifically
35 make VARIANT=dev
36 ```
37
38 Object files for both variants can coexist. There is no `make clean` target
39 because there shouldn't be a need to do that manually. The Makefile has an
40 accurate dependency graph, so running `make` should always know what to update.
41
42 ### Running tests
43
44 ```sh
45 make VARIANT=dev tests
46
47 ./build/dev/test/run
48 ```
49
50 On platforms where Clang supports memory leak checks, you can activate them
51 like this:
52
53 ```sh
54 ASAN_OPTIONS=detect_leaks=1 ./build/dev/test/run
55 ```
56
57 To see test coverage for a data structure, run the cov script:
58
59 ```sh
60 ./build/dev/test/cov hashmap
61 ```