Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
f8b7122d
Commit
f8b7122d
authored
Mar 05, 2016
by
Willem Thiart
Browse files
Add amalgamation
parent
54c29120
Changes
3
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
f8b7122d
...
...
@@ -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
;
\
...
...
README.rst
View file @
f8b7122d
...
...
@@ -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
==================================
...
...
scripts/amalgamate.sh
0 → 100755
View file @
f8b7122d
#!/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 */'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment