From 9f7330b745342a5a9a7d7de9a0f0aa709c2337af Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Tue, 17 Apr 2012 21:53:01 +0200 Subject: [PATCH] docs --- ChangeLog | 1 + playground/lint/program/a.h | 1 + playground/lint/program/main.c | 6 +++++ playground/lint/program/wscript_build | 14 +++++++++++ playground/lint/stlib/main.c | 4 +++ playground/lint/stlib/test_staticlib.c | 2 ++ playground/lint/stlib/wscript_build | 12 +++++++++ playground/lint/wscript | 34 ++++++++++++++++++++++++++ 8 files changed, 74 insertions(+) create mode 100644 playground/lint/program/a.h create mode 100644 playground/lint/program/main.c create mode 100644 playground/lint/program/wscript_build create mode 100644 playground/lint/stlib/main.c create mode 100644 playground/lint/stlib/test_staticlib.c create mode 100644 playground/lint/stlib/wscript_build create mode 100644 playground/lint/wscript diff --git a/ChangeLog b/ChangeLog index 1c8c302b..ea84e27f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ NEW IN WAF 1.7.0 * Extended bld.subst() to perform simple copies to the build directory * Removed the default DLL_EXPORT define on gcc/g++ shared libraries * Calling ctx.root.ant_glob(abspath) will return results #1135 +* New case-insentive option for ant_glob #1148 NEW IN WAF 1.6.11 ----------------- diff --git a/playground/lint/program/a.h b/playground/lint/program/a.h new file mode 100644 index 00000000..1fc12a6a --- /dev/null +++ b/playground/lint/program/a.h @@ -0,0 +1 @@ +int k = 123; diff --git a/playground/lint/program/main.c b/playground/lint/program/main.c new file mode 100644 index 00000000..891e6279 --- /dev/null +++ b/playground/lint/program/main.c @@ -0,0 +1,6 @@ +#include "a.h" +#include "b.h" + +int main() { + return 0; +} diff --git a/playground/lint/program/wscript_build b/playground/lint/program/wscript_build new file mode 100644 index 00000000..6cda8122 --- /dev/null +++ b/playground/lint/program/wscript_build @@ -0,0 +1,14 @@ +#! /usr/bin/env python + +def write_header(tsk): + tsk.outputs[0].write('int abc = 423;') +bld(rule=write_header, target='b.h', ext_out=['.h']) + +bld.program( + source = 'main.c', + includes = '. ..', + cflags = ['-O3'], + defines = ['foo=bar'], + target = 'myprogram', + use = 'M') + diff --git a/playground/lint/stlib/main.c b/playground/lint/stlib/main.c new file mode 100644 index 00000000..a46866d9 --- /dev/null +++ b/playground/lint/stlib/main.c @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} diff --git a/playground/lint/stlib/test_staticlib.c b/playground/lint/stlib/test_staticlib.c new file mode 100644 index 00000000..d67f6447 --- /dev/null +++ b/playground/lint/stlib/test_staticlib.c @@ -0,0 +1,2 @@ +int k = 3; + diff --git a/playground/lint/stlib/wscript_build b/playground/lint/stlib/wscript_build new file mode 100644 index 00000000..758950dd --- /dev/null +++ b/playground/lint/stlib/wscript_build @@ -0,0 +1,12 @@ +#! /usr/bin/env python + +bld.stlib( + source = 'test_staticlib.c', + target = 'my_static_lib') + +bld.program( + source = 'main.c', + target = 'test_static_link', + includes = '.', + use = 'my_static_lib') + diff --git a/playground/lint/wscript b/playground/lint/wscript new file mode 100644 index 00000000..83ee4c07 --- /dev/null +++ b/playground/lint/wscript @@ -0,0 +1,34 @@ +#! /usr/bin/env python +# encoding: utf-8 +# Thomas Nagy, 2006-2012 (ita) + +# the following two variables are used by the target "waf dist" +VERSION='0.0.1' +APPNAME='cc_test' + +top = '.' + +def options(opt): + opt.load('compiler_c') + +def configure(conf): + conf.load('compiler_c') + conf.find_program('splint', var='LINT') + +def build(bld): + bld.env.DEFINES=['WAF=1'] + bld.recurse('program stlib') + + +from waflib.TaskGen import feature, after_method +@feature('c') +@after_method('process_source') +def add_files_to_lint(self): + for x in self.compiled_tasks: + self.create_task('lint', x.inputs[0]) + +from waflib import Task +class lint(Task.Task): + run_str = '${LINT} ${CPPPATH_ST:INCPATHS} ${SRC}' + ext_in = ['.h'] # guess why this line.. + before = ['c']