From 713dc6669fb29fcebba51f01ee9eebf64cd2b86b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 18 Jan 2012 17:28:30 +0000 Subject: Use consistent *_config.h rather than *-config.h. Fix amalgamation. git-svn-id: http://svn.drobilla.net/serd/trunk@298 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- wscript | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 8575e0af..bdf0360a 100644 --- a/wscript +++ b/wscript @@ -96,7 +96,7 @@ def configure(conf): mandatory=False) autowaf.define(conf, 'SERD_VERSION', SERD_VERSION) - conf.write_config_header('serd-config.h', remove=False) + conf.write_config_header('serd_config.h', remove=False) conf.env['INCLUDES_SERD'] = ['%s/serd-%s' % (conf.env['INCLUDEDIR'], SERD_MAJOR_VERSION)] @@ -107,6 +107,15 @@ def configure(conf): autowaf.display_msg(conf, "Unit tests", str(conf.env['BUILD_TESTS'])) print('') +lib_source = [ + 'src/env.c', + 'src/node.c', + 'src/reader.c', + 'src/string.c', + 'src/uri.c', + 'src/writer.c', +] + def build(bld): # C Headers includedir = '${INCLUDEDIR}/serd-%s/serd' % SERD_MAJOR_VERSION @@ -116,15 +125,6 @@ def build(bld): autowaf.build_pc(bld, 'SERD', SERD_VERSION, SERD_MAJOR_VERSION, [], {'SERD_MAJOR_VERSION' : SERD_MAJOR_VERSION}) - lib_source = ''' - src/env.c - src/node.c - src/reader.c - src/string.c - src/uri.c - src/writer.c - ''' - libflags = [ '-fvisibility=hidden' ] libs = [ 'm' ] defines = [] @@ -224,20 +224,20 @@ def lint(ctx): subprocess.call('cpplint.py --filter=+whitespace/comments,-whitespace/tab,-whitespace/braces,-whitespace/labels,-build/header_guard,-readability/casting,-readability/todo,-build/include 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') + shutil.copy('serd/serd.h', 'build/serd.h') + amalgamation = open('build/serd.c', 'w') serd_internal_h = open('src/serd_internal.h') for l in serd_internal_h: if l == '#include "serd/serd.h"\n': - amalgamation.write('#include "serd-%s.h"\n' % SERD_VERSION) + amalgamation.write('#include "serd.h"\n') else: 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) - amalgamation.write('\n/**\n * @file %s\n */\n' % f) + for f in lib_source: + fd = open(f) + amalgamation.write('\n/**\n @file %s\n*/' % f) header = True for l in fd: if header: @@ -247,9 +247,11 @@ def amalgamate(ctx): if l != '#include "serd_internal.h"\n': amalgamation.write(l) fd.close() - amalgamation.close() + for i in ['c', 'h']: + Logs.info("Wrote build/serd.%s" % i) + def build_dir(ctx, subdir): if autowaf.is_child(): return os.path.join('build', APPNAME, subdir) -- cgit v1.2.1