Browse Source

Add `amalgamate' waf target for building single source file distribution.

git-svn-id: http://svn.drobilla.net/serd/trunk@78 490d8e77-9747-427b-9fa3-0b8f29cee8a0
zrythm_meson
David Robillard 12 years ago
parent
commit
111f9ae323
  1. 2
      src/env.c
  2. 2
      src/node.c
  3. 2
      src/reader.c
  4. 2
      src/uri.c
  5. 2
      src/writer.c
  6. 24
      wscript

2
src/env.c

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file env.c */
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>

2
src/node.c

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file node.c */
#include <stdlib.h>
#include <string.h>

2
src/reader.c

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file reader.c */
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>

2
src/uri.c

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file uri.c */
#include <assert.h>
#include <stdlib.h>
#include <string.h>

2
src/writer.c

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file writer.c */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

24
wscript

@ -5,6 +5,7 @@ import autowaf @@ -5,6 +5,7 @@ import autowaf
import filecmp
import glob
import os
import shutil
import subprocess
# Version of this package (even if built as a child)
@ -113,6 +114,29 @@ def build(bld): @@ -113,6 +114,29 @@ def build(bld):
def lint(ctx):
subprocess.call('cpplint.py --filter=-whitespace,+whitespace/comments,-build/header_guard,-readability/casting,-readability/todo src/* serd/*', shell=True)
def amalgamate(ctx):
shutil.copy('serd/serd.h', 'build/serd-%s.h' % SERD_VERSION)
amalgamation = open('build/serd-%s.c' % SERD_VERSION, 'w')
serd_internal_h = open('src/serd_internal.h')
for l in serd_internal_h:
amalgamation.write(l)
serd_internal_h.close()
for f in 'env.c node.c reader.c uri.c writer.c'.split():
fd = open('src/' + f)
header = True
for l in fd:
if header:
if l == ' */\n':
header = False
else:
if l != '#include "serd_internal.h"\n':
amalgamation.write(l)
fd.close()
amalgamation.close()
def test(ctx):
try:
os.makedirs('build/tests')

Loading…
Cancel
Save