Commit f8b7122d authored by Willem Thiart's avatar Willem Thiart
Browse files

Add amalgamation

parent 54c29120
......@@ -56,6 +56,10 @@ tests: src/raft_server.c src/raft_server_properties.c src/raft_log.c src/raft_no
./tests_main
gcov raft_server.c
.PHONY: amalgamation
amalgamation:
./scripts/amalgamate.sh > raft.h
clean:
@rm -f $(TEST_DIR)/main_test.c *.o $(GCOV_OUTPUT); \
if [ -f "libcraft.$(SHAREDEXT)" ]; then rm libcraft.$(SHAREDEXT); fi;\
......
......@@ -33,6 +33,23 @@ We use the following methods to ensure that the library is safe:
* Many unit tests
* `Usage <https://github.com/willemt/ticketd>`_
Single file amalgamation
========================
The source has been amalgamated into a single ``raft.h`` header file.
Use `clib <https://github.com/clibs/clib>`_ to download the source into your project's ``deps`` folder, ie:
.. code-block:: bash
brew install clib
clib install willemt/raft_amalgamation
The file is stored in the ``deps`` folder like below:
.. code-block:: bash
deps/raft/raft.h
How to integrate with this library
==================================
......
#!/bin/bash
# Create amalgamated source file, prints to stdout
echo '/*
This source file is the amalgamated version of the original.
Please see github.com/willemt/raft for the original version.
'
cat LICENSE
echo '
*/
'
echo '
#ifndef RAFT_AMALGAMATION_SH
#define RAFT_AMALGAMATION_SH
'
cat include/raft.h
cat include/raft_*.h
cat src/raft*.c | sed 's/#include "raft.*.h"//g' | sed 's/__/__raft__/g'
echo '#endif /* RAFT_AMALGAMATIONE_SH */'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment