From 6cb9bf6e408041789f3a1ebadf54c2d19edff161 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Thu, 26 Sep 2013 18:01:53 +0100 Subject: Addition of warning if build doesn't build expected targets. Added option to runtest.py to stop on first error --- doc/man/scons.xml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc') diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 602bdbee..7036caff 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -1937,6 +1937,14 @@ These warnings are enabled by default. + + + + --warn=target_not_build, --warn=no-target_not_built + +Enables or disables warnings about a build rule not building the + expected targets. These warnings are not currently enabled by default. + -- cgit v1.2.1 From 1a50903a2f142a5b087d59b6f94dca92cca8b0a2 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Tue, 1 Oct 2013 11:38:32 +0100 Subject: support for --cache-readonly Setting this will fetch data from the cache but won't update it. --- doc/man/scons.xml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 602bdbee..947d86d6 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -61,12 +61,12 @@ version &buildversion; - + SCons &buildversion; MAN page - - - + + + SCONS 1 @@ -79,7 +79,7 @@ - scons + scons options name=val targets @@ -381,6 +381,7 @@ will be retrieved from the cache instead of being rebuilt locally. Caching behavior may be disabled and controlled in other ways by the , , +, and command-line options. The @@ -540,6 +541,15 @@ recently built with caching disabled via the option. + + + + --cache-readonly + +Use the cache (if enabled) for reading, but do not not update the +cache with changed files. + + @@ -1094,6 +1104,7 @@ command: --cache-debug=FILE --cache-disable, --no-cache --cache-force, --cache-populate +--cache-readonly --cache-show --debug=TYPE -i, --ignore-errors @@ -6775,7 +6786,7 @@ specified in the $MYPATH construction variable. It lets SCons detect the file incs/foo.inc -, even if +, even if foo.x contains the line include foo.inc -- cgit v1.2.1 From faf5e9f6f0b488b774db4817166220cf21d2f497 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sun, 6 Oct 2013 17:04:19 +0200 Subject: - left-aligned all code examples in documentation - accordingly updated the generated files, containing example output --- doc/design/engine.xml | 8 +- doc/generated/builders.gen | 13 +- .../commandline_Variables_custom_py_1_custom.py | 2 +- doc/generated/examples/depends_ex1_5.xml | 2 +- doc/generated/examples/depends_include_SConstruct | 2 +- doc/generated/examples/depends_include_hello.h | 2 +- .../examples/hierarchy_Return_foo_SConscript | 6 +- .../examples/hierarchy_ex1_prog1_SConscript | 4 +- .../examples/hierarchy_ex1_prog2_SConscript | 4 +- .../separate_builddir_sconscript_SConstruct | 4 +- doc/generated/variables.gen | 20 + doc/generated/variables.mod | 2 + doc/man/scons.xml | 36 +- doc/python10/design.xml | 26 +- doc/reference/Library.xml | 36 +- doc/user/actions.xml | 4 +- doc/user/add-method.xml | 18 +- doc/user/alias.xml | 30 +- doc/user/build-install.xml | 26 +- doc/user/builders-built-in.xml | 126 +++--- doc/user/builders-commands.xml | 20 +- doc/user/builders-writing.xml | 318 ++++++------- doc/user/caching.xml | 50 +-- doc/user/command-line.xml | 490 ++++++++++----------- doc/user/depends.xml | 300 ++++++------- doc/user/environments.xml | 156 +++---- doc/user/factories.xml | 146 +++--- doc/user/file-removal.xml | 42 +- doc/user/gettext.xml | 276 ++++++------ doc/user/hierarchy.xml | 138 +++--- doc/user/install.xml | 72 +-- doc/user/java.xml | 408 ++++++++--------- doc/user/less-simple.xml | 92 ++-- doc/user/libraries.xml | 54 +-- doc/user/mergeflags.xml | 32 +- doc/user/misc.xml | 144 +++--- doc/user/nodes.xml | 60 +-- doc/user/output.xml | 78 ++-- doc/user/parseconfig.xml | 28 +- doc/user/parseflags.xml | 64 +-- doc/user/repositories.xml | 114 ++--- doc/user/scanners.xml | 28 +- doc/user/sconf.xml | 152 +++---- doc/user/separate.xml | 72 +-- doc/user/sideeffect.xml | 46 +- doc/user/simple.xml | 56 +-- doc/user/sourcecode.xml | 36 +- doc/user/troubleshoot.xml | 130 +++--- doc/user/variants.xml | 6 +- 49 files changed, 2006 insertions(+), 1973 deletions(-) (limited to 'doc') diff --git a/doc/design/engine.xml b/doc/design/engine.xml index b8bdd4b8..6989f8a0 100644 --- a/doc/design/engine.xml +++ b/doc/design/engine.xml @@ -1411,8 +1411,8 @@ Comments? - env.Library(target = 'libfoo.a', source = ['aaa.c', 'bbb.c', 'ccc.c']) - env.NoClean('libfoo.a') +env.Library(target = 'libfoo.a', source = ['aaa.c', 'bbb.c', 'ccc.c']) +env.NoClean('libfoo.a') @@ -1425,8 +1425,8 @@ Comments? during "cleanup": - env.Clean(target = 'foo') - env.NoClean('foo') +env.Clean(target = 'foo') +env.NoClean('foo') diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index eec4711c..3fdafb61 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -1840,6 +1840,17 @@ if there is not already a .lib file explicitly listed in the targets. + +On Cygwin systems, the +SharedLibrary +builder method will always build an import +(.dll.a) library +in addition to the shared (.dll) library, +adding a .dll.a library with the same basename +if there is not already a .dll.a file explicitly +listed in the targets. + + Any object files listed in the source @@ -1870,7 +1881,7 @@ alpha, beta, or release candidate patch levels. This builder may create multiple links to the library. On a POSIX system, for the shared library libbar.so.2.3.1, the links created would be -libbar.so, libbar.so.2, and libbar.so.2.3; on a Darwin (OSX) system +libbar.so and libbar.so.2; on a Darwin (OSX) system the library would be libbar.2.3.1.dylib and the link would be libbar.dylib. diff --git a/doc/generated/examples/commandline_Variables_custom_py_1_custom.py b/doc/generated/examples/commandline_Variables_custom_py_1_custom.py index f2acb0dd..ff314fa8 100644 --- a/doc/generated/examples/commandline_Variables_custom_py_1_custom.py +++ b/doc/generated/examples/commandline_Variables_custom_py_1_custom.py @@ -1,3 +1,3 @@ - RELEASE = 1 +RELEASE = 1 diff --git a/doc/generated/examples/depends_ex1_5.xml b/doc/generated/examples/depends_ex1_5.xml index abbe64ea..136def6f 100644 --- a/doc/generated/examples/depends_ex1_5.xml +++ b/doc/generated/examples/depends_ex1_5.xml @@ -5,5 +5,5 @@ cc -o hello hello.o % [CHANGE A COMMENT IN hello.c] % scons -Q hello cc -o hello.o -c hello.c -scons: `hello' is up to date. +cc -o hello hello.o diff --git a/doc/generated/examples/depends_include_SConstruct b/doc/generated/examples/depends_include_SConstruct index 5f6d7f54..2da2ecfb 100644 --- a/doc/generated/examples/depends_include_SConstruct +++ b/doc/generated/examples/depends_include_SConstruct @@ -1,3 +1,3 @@ - Program('hello.c', CPPPATH = '.') +Program('hello.c', CPPPATH = '.') diff --git a/doc/generated/examples/depends_include_hello.h b/doc/generated/examples/depends_include_hello.h index c9046b3b..d6032ce5 100644 --- a/doc/generated/examples/depends_include_hello.h +++ b/doc/generated/examples/depends_include_hello.h @@ -1,3 +1,3 @@ - #define string "world" +#define string "world" diff --git a/doc/generated/examples/hierarchy_Return_foo_SConscript b/doc/generated/examples/hierarchy_Return_foo_SConscript index 5d742644..4f45c0fd 100644 --- a/doc/generated/examples/hierarchy_Return_foo_SConscript +++ b/doc/generated/examples/hierarchy_Return_foo_SConscript @@ -1,5 +1,5 @@ - Import('env') - obj = env.Object('foo.c') - Return('obj') +Import('env') +obj = env.Object('foo.c') +Return('obj') diff --git a/doc/generated/examples/hierarchy_ex1_prog1_SConscript b/doc/generated/examples/hierarchy_ex1_prog1_SConscript index 425f1b8c..caf26368 100644 --- a/doc/generated/examples/hierarchy_ex1_prog1_SConscript +++ b/doc/generated/examples/hierarchy_ex1_prog1_SConscript @@ -1,4 +1,4 @@ - env = Environment() - env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c']) +env = Environment() +env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c']) diff --git a/doc/generated/examples/hierarchy_ex1_prog2_SConscript b/doc/generated/examples/hierarchy_ex1_prog2_SConscript index fb529b40..88b05a3e 100644 --- a/doc/generated/examples/hierarchy_ex1_prog2_SConscript +++ b/doc/generated/examples/hierarchy_ex1_prog2_SConscript @@ -1,4 +1,4 @@ - env = Environment() - env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c']) +env = Environment() +env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c']) diff --git a/doc/generated/examples/separate_builddir_sconscript_SConstruct b/doc/generated/examples/separate_builddir_sconscript_SConstruct index c3da7256..d53d1c6f 100644 --- a/doc/generated/examples/separate_builddir_sconscript_SConstruct +++ b/doc/generated/examples/separate_builddir_sconscript_SConstruct @@ -1,4 +1,4 @@ - VariantDir('build', 'src') - SConscript('build/SConscript') +VariantDir('build', 'src') +SConscript('build/SConscript') diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 18281122..b2139160 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -7350,6 +7350,26 @@ env = Environment(ZIPCOMSTR = "Zipping $TARGET") General options passed to the zip utility. + + + + ZIPROOT + +An optional zip root directory (default empty). The filenames stored +in the zip file will be relative to this directory, if given. +Otherwise the filenames are relative to the current directory of the +command. +For instance: + +env = Environment() +env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1') + + +will produce a zip file foo.zip +containing a file with the name +subdir2/file1 rather than +subdir1/subdir2/file1. + diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 7247f554..8a898ec3 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -576,6 +576,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $ZIPCOMPRESSION"> $ZIPCOMSTR"> $ZIPFLAGS"> +$ZIPROOT"> $ZIPSUFFIX"> @@ -419,8 +419,8 @@ - # cd scons-&buildversion; - # python setup.py install +# cd scons-&buildversion; +# python setup.py install @@ -480,7 +480,7 @@ - # python setup.py install --version-lib +# python setup.py install --version-lib @@ -522,7 +522,7 @@ - # python setup.py install --prefix=/opt/scons +# python setup.py install --prefix=/opt/scons @@ -573,7 +573,7 @@ - $ python setup.py install --prefix=$HOME +$ python setup.py install --prefix=$HOME diff --git a/doc/user/builders-built-in.xml b/doc/user/builders-built-in.xml index 9c280205..2fcf3139 100644 --- a/doc/user/builders-built-in.xml +++ b/doc/user/builders-built-in.xml @@ -77,7 +77,7 @@ - Program('prog', 'file1.o') +Program('prog', 'file1.o') @@ -102,8 +102,8 @@ - env = Environment(PROGPREFIX='my', PROGSUFFIX='.xxx') - env.Program('prog', ['file1.o', 'file2.o']) +env = Environment(PROGPREFIX='my', PROGSUFFIX='.xxx') +env.Program('prog', ['file1.o', 'file2.o']) @@ -126,7 +126,7 @@ - Program(['hello.c', 'goodbye.c']) +Program(['hello.c', 'goodbye.c']) @@ -154,15 +154,15 @@ - env = Environment(LIBS = ['foo1', 'foo2'], - LIBPATH = ['/usr/dir1', 'dir2']) - env.Program(['hello.c', 'goodbye.c']) +env = Environment(LIBS = ['foo1', 'foo2'], + LIBPATH = ['/usr/dir1', 'dir2']) +env.Program(['hello.c', 'goodbye.c']) - int hello() { printf("Hello, world!\n"); } +int hello() { printf("Hello, world!\n"); } - int goodbye() { printf("Goodbye, world!\n"); } +int goodbye() { printf("Goodbye, world!\n"); } @@ -258,7 +258,7 @@ - StaticObject('file', 'file.c') +StaticObject('file', 'file.c') @@ -283,8 +283,8 @@ - env = Environment(OBJPREFIX='my', OBJSUFFIX='.xxx') - env.StaticObject('file', 'file.c') +env = Environment(OBJPREFIX='my', OBJSUFFIX='.xxx') +env.StaticObject('file', 'file.c') @@ -307,7 +307,7 @@ - StaticObject('file.c') +StaticObject('file.c') @@ -337,7 +337,7 @@ - SharedObject('file', 'file.c') +SharedObject('file', 'file.c') @@ -362,8 +362,8 @@ - env = Environment(SHOBJPREFIX='my', SHOBJSUFFIX='.xxx') - env.SharedObject('file', 'file.c') +env = Environment(SHOBJPREFIX='my', SHOBJSUFFIX='.xxx') +env.SharedObject('file', 'file.c') @@ -386,7 +386,7 @@ - SharedObject('file.c') +SharedObject('file.c') @@ -440,7 +440,7 @@ - StaticLibrary('foo', ['file1.c', 'file2.c']) +StaticLibrary('foo', ['file1.c', 'file2.c']) @@ -457,8 +457,8 @@ - env = Environment(LIBPREFIX='my', LIBSUFFIX='.xxx') - env.StaticLibrary('lib', ['file1.o', 'file2.o']) +env = Environment(LIBPREFIX='my', LIBSUFFIX='.xxx') +env.StaticLibrary('lib', ['file1.o', 'file2.o']) @@ -470,7 +470,7 @@ - StaticLibrary('foo', ['file1.c', 'file2.c']) +StaticLibrary('foo', ['file1.c', 'file2.c']) @@ -484,7 +484,7 @@ - StaticLibrary(['file.c', 'another.c']) +StaticLibrary(['file.c', 'another.c']) @@ -514,7 +514,7 @@ - SharedLibrary('foo', ['file1.c', 'file2.c']) +SharedLibrary('foo', ['file1.c', 'file2.c']) @@ -531,8 +531,8 @@ - env = Environment(SHLIBPREFIX='my', SHLIBSUFFIX='.xxx') - env.SharedLibrary('shared', ['file1.o', 'file2.o']) +env = Environment(SHLIBPREFIX='my', SHLIBSUFFIX='.xxx') +env.SharedLibrary('shared', ['file1.o', 'file2.o']) @@ -544,7 +544,7 @@ - SharedLibrary('foo', ['file1.c', 'file2.c']) +SharedLibrary('foo', ['file1.c', 'file2.c']) @@ -558,7 +558,7 @@ - SharedLibrary(['file.c', 'another.c']) +SharedLibrary(['file.c', 'another.c']) @@ -631,11 +631,11 @@ - XXX CFile() programlisting +XXX CFile() programlisting - XXX CFile() screen +XXX CFile() screen @@ -650,11 +650,11 @@ - XXX CXXFILE() programlisting +XXX CXXFILE() programlisting - XXX CXXFILE() screen +XXX CXXFILE() screen @@ -681,11 +681,11 @@ - XXX DVI() programlisting +XXX DVI() programlisting - XXX DVI() screen +XXX DVI() screen @@ -711,11 +711,11 @@ - XXX PostScript() programlisting +XXX PostScript() programlisting - XXX PostScript() screen +XXX PostScript() screen @@ -745,18 +745,18 @@ - env = Environment() - env.Tar('out1.tar', ['file1', 'file2']) - env.Tar('out2', 'directory') +env = Environment() +env.Tar('out1.tar', ['file1', 'file2']) +env.Tar('out2', 'directory') - file1 +file1 - file2 +file2 - directory/file3 +directory/file3 @@ -781,11 +781,11 @@ - env = Environment(TARFLAGS = '-c -z') - env.Tar('out.tar.gz', 'directory') +env = Environment(TARFLAGS = '-c -z') +env.Tar('out.tar.gz', 'directory') - directory/file +directory/file @@ -805,12 +805,12 @@ - env = Environment(TARFLAGS = '-c -z', - TARSUFFIX = '.tgz') - env.Tar('out', 'directory') +env = Environment(TARFLAGS = '-c -z', + TARSUFFIX = '.tgz') +env.Tar('out', 'directory') - directory/file +directory/file @@ -837,14 +837,14 @@ - env = Environment() - env.Zip('out', ['file1', 'file2']) +env = Environment() +env.Zip('out', ['file1', 'file2']) - file1 +file1 - file2 +file2 @@ -891,8 +891,8 @@ - env = Environment() - env.Java(target = 'classes', source = 'src') +env = Environment() +env.Java(target = 'classes', source = 'src') @@ -905,7 +905,7 @@ - XXX Java() screen +XXX Java() screen @@ -920,13 +920,13 @@ - env = Environment() - env.Java(target = 'classes', source = 'src') - env.Jar(target = '', source = 'classes') +env = Environment() +env.Java(target = 'classes', source = 'src') +env.Jar(target = '', source = 'classes') - XXX Jar() screen +XXX Jar() screen @@ -941,11 +941,11 @@ - XXX JavaH() programlisting +XXX JavaH() programlisting - XXX JavaH() screen +XXX JavaH() screen @@ -960,11 +960,11 @@ - XXX RMIC() programlisting +XXX RMIC() programlisting - XXX RMIC() screen +XXX RMIC() screen diff --git a/doc/user/builders-commands.xml b/doc/user/builders-commands.xml index 52e98c87..d496ef11 100644 --- a/doc/user/builders-commands.xml +++ b/doc/user/builders-commands.xml @@ -93,11 +93,11 @@ - env = Environment() - env.Command('foo.out', 'foo.in', "sed 's/x/y/' < $SOURCE > $TARGET") +env = Environment() +env.Command('foo.out', 'foo.in', "sed 's/x/y/' < $SOURCE > $TARGET") - foo.in +foo.in @@ -133,14 +133,14 @@ - env = Environment() - def build(target, source, env): - # Whatever it takes to build - return None - env.Command('foo.out', 'foo.in', build) +env = Environment() +def build(target, source, env): + # Whatever it takes to build + return None +env.Command('foo.out', 'foo.in', build) - foo.in +foo.in @@ -164,7 +164,7 @@ - env.Command('${SOURCE.basename}.out', 'foo.in', build) +env.Command('${SOURCE.basename}.out', 'foo.in', build) diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index 2dea8f7c..383823a3 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -151,7 +151,7 @@ This functionality could be invoked as in the following example: - bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +bld = Builder(action = 'foobuild < $SOURCE > $TARGET') @@ -187,23 +187,23 @@ This functionality could be invoked as in the following example: - bld = Builder(action = 'foobuild < $SOURCE > $TARGET') - env = Environment(BUILDERS = {'Foo' : bld}) - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - env.Foo('file.foo', 'file.input') +bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +env = Environment(BUILDERS = {'Foo' : bld}) +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +env.Foo('file.foo', 'file.input') - file.input +file.input - cat +cat - bld = Builder(action = 'foobuild < $SOURCE > $TARGET') - env = Environment(BUILDERS = {'Foo' : bld}) +bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +env = Environment(BUILDERS = {'Foo' : bld}) @@ -215,7 +215,7 @@ This functionality could be invoked as in the following example: - env.Foo('file.foo', 'file.input') +env.Foo('file.foo', 'file.input') @@ -261,22 +261,22 @@ This functionality could be invoked as in the following example: --> - import SCons.Defaults; SCons.Defaults.ConstructionEnvironment['TOOLS'] = {}; bld = Builder(action = 'foobuild < $SOURCE > $TARGET') - env = Environment(BUILDERS = {'Foo' : bld}) - env.Foo('file.foo', 'file.input') - env.Program('hello.c') +import SCons.Defaults; SCons.Defaults.ConstructionEnvironment['TOOLS'] = {}; bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +env = Environment(BUILDERS = {'Foo' : bld}) +env.Foo('file.foo', 'file.input') +env.Program('hello.c') - bld = Builder(action = 'foobuild < $SOURCE > $TARGET') - env = Environment(BUILDERS = {'Foo' : bld}) - env.Foo('file.foo', 'file.input') - env.Program('hello.c') +bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +env = Environment(BUILDERS = {'Foo' : bld}) +env.Foo('file.foo', 'file.input') +env.Program('hello.c') - file.input +file.input - hello.c +hello.c @@ -295,31 +295,31 @@ This functionality could be invoked as in the following example: - env = Environment() - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - bld = Builder(action = 'foobuild < $SOURCE > $TARGET') - env.Append(BUILDERS = {'Foo' : bld}) - env.Foo('file.foo', 'file.input') - env.Program('hello.c') +env = Environment() +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +env.Append(BUILDERS = {'Foo' : bld}) +env.Foo('file.foo', 'file.input') +env.Program('hello.c') - file.input +file.input - hello.c +hello.c - cat +cat - env = Environment() - bld = Builder(action = 'foobuild < $SOURCE > $TARGET') - env.Append(BUILDERS = {'Foo' : bld}) - env.Foo('file.foo', 'file.input') - env.Program('hello.c') +env = Environment() +bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +env.Append(BUILDERS = {'Foo' : bld}) +env.Foo('file.foo', 'file.input') +env.Program('hello.c') @@ -330,11 +330,11 @@ This functionality could be invoked as in the following example: - env = Environment() - bld = Builder(action = 'foobuild < $SOURCE > $TARGET') - env['BUILDERS']['Foo'] = bld - env.Foo('file.foo', 'file.input') - env.Program('hello.c') +env = Environment() +bld = Builder(action = 'foobuild < $SOURCE > $TARGET') +env['BUILDERS']['Foo'] = bld +env.Foo('file.foo', 'file.input') +env.Program('hello.c') @@ -374,33 +374,33 @@ This functionality could be invoked as in the following example: - bld = Builder(action = 'foobuild < $SOURCE > $TARGET', - suffix = '.foo', - src_suffix = '.input') - env = Environment(BUILDERS = {'Foo' : bld}) - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - env.Foo('file1') - env.Foo('file2') +bld = Builder(action = 'foobuild < $SOURCE > $TARGET', + suffix = '.foo', + src_suffix = '.input') +env = Environment(BUILDERS = {'Foo' : bld}) +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +env.Foo('file1') +env.Foo('file2') - file1.input +file1.input - file2.input +file2.input - cat +cat - bld = Builder(action = 'foobuild < $SOURCE > $TARGET', - suffix = '.foo', - src_suffix = '.input') - env = Environment(BUILDERS = {'Foo' : bld}) - env.Foo('file1') - env.Foo('file2') +bld = Builder(action = 'foobuild < $SOURCE > $TARGET', + suffix = '.foo', + src_suffix = '.input') +env = Environment(BUILDERS = {'Foo' : bld}) +env.Foo('file1') +env.Foo('file2') @@ -432,9 +432,9 @@ This functionality could be invoked as in the following example: - def build_function(target, source, env): - # Code to build "target" from "source" - return None +def build_function(target, source, env): + # Code to build "target" from "source" + return None @@ -521,17 +521,17 @@ This functionality could be invoked as in the following example: - def build_function(target, source, env): - # Code to build "target" from "source" - return None - bld = Builder(action = build_function, - suffix = '.foo', - src_suffix = '.input') - env = Environment(BUILDERS = {'Foo' : bld}) - env.Foo('file') +def build_function(target, source, env): + # Code to build "target" from "source" + return None +bld = Builder(action = build_function, + suffix = '.foo', + src_suffix = '.input') +env = Environment(BUILDERS = {'Foo' : bld}) +env.Foo('file') - file.input +file.input @@ -565,8 +565,8 @@ This functionality could be invoked as in the following example: - def generate_actions(source, target, env, for_signature): - return 'foobuild < %s > %s' % (target[0], source[0]) +def generate_actions(source, target, env, for_signature): + return 'foobuild < %s > %s' % (target[0], source[0]) @@ -668,32 +668,32 @@ This functionality could be invoked as in the following example: - def generate_actions(source, target, env, for_signature): - return 'foobuild < %s > %s' % (source[0], target[0]) - bld = Builder(generator = generate_actions, - suffix = '.foo', - src_suffix = '.input') - env = Environment(BUILDERS = {'Foo' : bld}) - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - env.Foo('file') +def generate_actions(source, target, env, for_signature): + return 'foobuild < %s > %s' % (source[0], target[0]) +bld = Builder(generator = generate_actions, + suffix = '.foo', + src_suffix = '.input') +env = Environment(BUILDERS = {'Foo' : bld}) +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +env.Foo('file') - file.input +file.input - cat +cat - def generate_actions(source, target, env, for_signature): - return 'foobuild < %s > %s' % (source[0], target[0]) - bld = Builder(generator = generate_actions, - suffix = '.foo', - src_suffix = '.input') - env = Environment(BUILDERS = {'Foo' : bld}) - env.Foo('file') +def generate_actions(source, target, env, for_signature): + return 'foobuild < %s > %s' % (source[0], target[0]) +bld = Builder(generator = generate_actions, + suffix = '.foo', + src_suffix = '.input') +env = Environment(BUILDERS = {'Foo' : bld}) +env.Foo('file') @@ -746,41 +746,41 @@ This functionality could be invoked as in the following example: - def modify_targets(target, source, env): - target.append('new_target') - source.append('new_source') - return target, source - bld = Builder(action = 'foobuild $TARGETS - $SOURCES', - suffix = '.foo', - src_suffix = '.input', - emitter = modify_targets) - env = Environment(BUILDERS = {'Foo' : bld}) - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - env.Foo('file') +def modify_targets(target, source, env): + target.append('new_target') + source.append('new_source') + return target, source +bld = Builder(action = 'foobuild $TARGETS - $SOURCES', + suffix = '.foo', + src_suffix = '.input', + emitter = modify_targets) +env = Environment(BUILDERS = {'Foo' : bld}) +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +env.Foo('file') - file.input +file.input - new_source +new_source - cat +cat - def modify_targets(target, source, env): - target.append('new_target') - source.append('new_source') - return target, source - bld = Builder(action = 'foobuild $TARGETS - $SOURCES', - suffix = '.foo', - src_suffix = '.input', - emitter = modify_targets) - env = Environment(BUILDERS = {'Foo' : bld}) - env.Foo('file') +def modify_targets(target, source, env): + target.append('new_target') + source.append('new_source') + return target, source +bld = Builder(action = 'foobuild $TARGETS - $SOURCES', + suffix = '.foo', + src_suffix = '.input', + emitter = modify_targets) +env = Environment(BUILDERS = {'Foo' : bld}) +env.Foo('file') @@ -849,20 +849,20 @@ This functionality could be invoked as in the following example: - bld = Builder(action = 'my_command $SOURCES > $TARGET', - suffix = '.foo', - src_suffix = '.input', - emitter = '$MY_EMITTER') - def modify1(target, source, env): - return target, source + ['modify1.in'] - def modify2(target, source, env): - return target, source + ['modify2.in'] - env1 = Environment(BUILDERS = {'Foo' : bld}, - MY_EMITTER = modify1) - env2 = Environment(BUILDERS = {'Foo' : bld}, - MY_EMITTER = modify2) - env1.Foo('file1') - env2.Foo('file2') +bld = Builder(action = 'my_command $SOURCES > $TARGET', + suffix = '.foo', + src_suffix = '.input', + emitter = '$MY_EMITTER') +def modify1(target, source, env): + return target, source + ['modify1.in'] +def modify2(target, source, env): + return target, source + ['modify2.in'] +env1 = Environment(BUILDERS = {'Foo' : bld}, + MY_EMITTER = modify1) +env2 = Environment(BUILDERS = {'Foo' : bld}, + MY_EMITTER = modify2) +env1.Foo('file1') +env2.Foo('file2') @@ -962,19 +962,19 @@ This functionality could be invoked as in the following example: - def TOOL_ADD_HEADER(env): - """A Tool to add a header from $HEADER to the source file""" - add_header = Builder(action=['echo "$HEADER" > $TARGET', - 'cat $SOURCE >> $TARGET']) - env.Append(BUILDERS = {'AddHeader' : add_header}) - env['HEADER'] = '' # set default value +def TOOL_ADD_HEADER(env): + """A Tool to add a header from $HEADER to the source file""" + add_header = Builder(action=['echo "$HEADER" > $TARGET', + 'cat $SOURCE >> $TARGET']) + env.Append(BUILDERS = {'AddHeader' : add_header}) + env['HEADER'] = '' # set default value - env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====") - env.AddHeader('tgt', 'src') +env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====") +env.AddHeader('tgt', 'src') - hi there +hi there @@ -985,9 +985,9 @@ This functionality could be invoked as in the following example: - # Use TOOL_ADD_HEADER from site_scons/site_init.py - env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====") - env.AddHeader('tgt', 'src') +# Use TOOL_ADD_HEADER from site_scons/site_init.py +env=Environment(tools=['default', TOOL_ADD_HEADER], HEADER="=====") +env.AddHeader('tgt', 'src') @@ -1036,18 +1036,18 @@ This functionality could be invoked as in the following example: - from SCons.Script import * # for Execute and Mkdir - def build_id(): - """Return a build ID (stub version)""" - return "100" - def MakeWorkDir(workdir): - """Create the specified dir immediately""" - Execute(Mkdir(workdir)) +from SCons.Script import * # for Execute and Mkdir +def build_id(): + """Return a build ID (stub version)""" + return "100" +def MakeWorkDir(workdir): + """Create the specified dir immediately""" + Execute(Mkdir(workdir)) - import my_utils - MakeWorkDir('/tmp/work') - print "build_id=" + my_utils.build_id() +import my_utils +MakeWorkDir('/tmp/work') +print "build_id=" + my_utils.build_id() @@ -1059,9 +1059,9 @@ This functionality could be invoked as in the following example: - import my_utils - print "build_id=" + my_utils.build_id() - my_utils.MakeWorkDir('/tmp/work') +import my_utils +print "build_id=" + my_utils.build_id() +my_utils.MakeWorkDir('/tmp/work') @@ -1074,7 +1074,7 @@ This functionality could be invoked as in the following example: than a &SConstruct; or &SConscript; you always need to do - from SCons.Script import * +from SCons.Script import * @@ -1112,12 +1112,12 @@ This functionality could be invoked as in the following example: - env = Environment() - #env.SourceCode('.', env.BitKeeper('my_command')) - env.Program('hello.c') +env = Environment() +#env.SourceCode('.', env.BitKeeper('my_command')) +env.Program('hello.c') - hello.c +hello.c diff --git a/doc/user/caching.xml b/doc/user/caching.xml index 4e6dcf5a..f7286539 100644 --- a/doc/user/caching.xml +++ b/doc/user/caching.xml @@ -67,17 +67,17 @@ - env = Environment() - env.Program('hello.c') - CacheDir('cache') +env = Environment() +env.Program('hello.c') +CacheDir('cache') - hello.c +hello.c - CacheDir('/usr/local/build_cache') +CacheDir('/usr/local/build_cache') @@ -205,14 +205,14 @@ - env = Environment() - obj = env.Object('hello.c') - env.Program('hello.c') - CacheDir('cache') - NoCache('hello.o') +env = Environment() +obj = env.Object('hello.c') +env.Program('hello.c') +CacheDir('cache') +NoCache('hello.o') - hello.c +hello.c @@ -241,15 +241,15 @@ --> - % scons -Q - cc -o hello.o -c hello.c - cc -o hello hello.o - % scons -Q -c - Removed hello.o - Removed hello - % scons -Q - cc -o hello.o -c hello.c - Retrieved `hello' from cache +% scons -Q +cc -o hello.o -c hello.c +cc -o hello hello.o +% scons -Q -c +Removed hello.o +Removed hello +% scons -Q +cc -o hello.o -c hello.c +Retrieved `hello' from cache @@ -367,8 +367,8 @@ - Program('prog', - ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c']) +Program('prog', + ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c']) f1.c f2.c @@ -479,9 +479,9 @@ - SetOption('random', 1) - Program('prog', - ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c']) +SetOption('random', 1) +Program('prog', + ['f1.c', 'f2.c', 'f3.c', 'f4.c', 'f5.c']) f1.c f2.c diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml index a167ecac..d2e41462 100644 --- a/doc/user/command-line.xml +++ b/doc/user/command-line.xml @@ -170,16 +170,16 @@ - def b(target, source, env): - pass - def s(target, source, env): - return " ... [build output] ..." - a = Action(b, strfunction = s) - env = Environment(BUILDERS = {'A' : Builder(action=a)}) - env.A('foo.out', 'foo.in') +def b(target, source, env): + pass +def s(target, source, env): + return " ... [build output] ..." +a = Action(b, strfunction = s) +env = Environment(BUILDERS = {'A' : Builder(action=a)}) +env.A('foo.out', 'foo.in') - foo.in +foo.in @@ -197,7 +197,7 @@ - $ setenv SCONSFLAGS "-Q" +$ setenv SCONSFLAGS "-Q" @@ -244,8 +244,8 @@ - if not GetOption('help'): - SConscript('src/SConscript', export='env') +if not GetOption('help'): + SConscript('src/SConscript', export='env') @@ -314,13 +314,13 @@ - import os - num_cpu = int(os.environ.get('NUM_CPU', 2)) - SetOption('num_jobs', num_cpu) - print "running with -j", GetOption('num_jobs') +import os +num_cpu = int(os.environ.get('NUM_CPU', 2)) +SetOption('num_jobs', num_cpu) +print "running with -j", GetOption('num_jobs') - foo.in +foo.in @@ -699,7 +699,7 @@ - % scons -Q debug=1 +% scons -Q debug=1 @@ -733,14 +733,14 @@ - env = Environment() - debug = ARGUMENTS.get('debug', 0) - if int(debug): - env.Append(CCFLAGS = '-g') - env.Program('prog.c') +env = Environment() +debug = ARGUMENTS.get('debug', 0) +if int(debug): + env.Append(CCFLAGS = '-g') +env.Program('prog.c') - prog.c +prog.c @@ -822,15 +822,15 @@ - cppdefines = [] - for key, value in ARGLIST: - if key == 'define': - cppdefines.append(value) - env = Environment(CPPDEFINES = cppdefines) - env.Object('prog.c') +cppdefines = [] +for key, value in ARGLIST: + if key == 'define': + cppdefines.append(value) +env = Environment(CPPDEFINES = cppdefines) +env.Object('prog.c') - prog.c +prog.c @@ -907,17 +907,17 @@ - vars = Variables(None, ARGUMENTS) - vars.Add('RELEASE', 'Set to 1 to build for release', 0) - env = Environment(variables = vars, - CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) - env.Program(['foo.c', 'bar.c']) +vars = Variables(None, ARGUMENTS) +vars.Add('RELEASE', 'Set to 1 to build for release', 0) +env = Environment(variables = vars, + CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) +env.Program(['foo.c', 'bar.c']) - foo.c +foo.c - bar.c +bar.c @@ -998,10 +998,10 @@ - vars = Variables(None, ARGUMENTS) - vars.Add('RELEASE', 'Set to 1 to build for release', 0) - env = Environment(variables = vars) - Help(vars.GenerateHelpText(env)) +vars = Variables(None, ARGUMENTS) +vars.Add('RELEASE', 'Set to 1 to build for release', 0) +env = Environment(variables = vars) +Help(vars.GenerateHelpText(env)) @@ -1045,21 +1045,21 @@ - vars = Variables('custom.py') - vars.Add('RELEASE', 'Set to 1 to build for release', 0) - env = Environment(variables = vars, - CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) - env.Program(['foo.c', 'bar.c']) - Help(vars.GenerateHelpText(env)) +vars = Variables('custom.py') +vars.Add('RELEASE', 'Set to 1 to build for release', 0) +env = Environment(variables = vars, + CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) +env.Program(['foo.c', 'bar.c']) +Help(vars.GenerateHelpText(env)) - foo.c +foo.c - bar.c +bar.c - RELEASE = 1 +RELEASE = 1 @@ -1128,7 +1128,7 @@ - vars = Variables('custom.py', ARGUMENTS) +vars = Variables('custom.py', ARGUMENTS) @@ -1182,14 +1182,14 @@ - vars = Variables('custom.py') - vars.Add(BoolVariable('RELEASE', 'Set to build for release', 0)) - env = Environment(variables = vars, - CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(BoolVariable('RELEASE', 'Set to build for release', 0)) +env = Environment(variables = vars, + CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) +env.Program('foo.c') - foo.c +foo.c @@ -1286,15 +1286,15 @@ - vars = Variables('custom.py') - vars.Add(EnumVariable('COLOR', 'Set background color', 'red', - allowed_values=('red', 'green', 'blue'))) - env = Environment(variables = vars, - CPPDEFINES={'COLOR' : '"${COLOR}"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(EnumVariable('COLOR', 'Set background color', 'red', + allowed_values=('red', 'green', 'blue'))) +env = Environment(variables = vars, + CPPDEFINES={'COLOR' : '"${COLOR}"'}) +env.Program('foo.c') - foo.c +foo.c @@ -1340,16 +1340,16 @@ - vars = Variables('custom.py') - vars.Add(EnumVariable('COLOR', 'Set background color', 'red', - allowed_values=('red', 'green', 'blue'), - map={'navy':'blue'})) - env = Environment(variables = vars, - CPPDEFINES={'COLOR' : '"${COLOR}"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(EnumVariable('COLOR', 'Set background color', 'red', + allowed_values=('red', 'green', 'blue'), + map={'navy':'blue'})) +env = Environment(variables = vars, + CPPDEFINES={'COLOR' : '"${COLOR}"'}) +env.Program('foo.c') - foo.c +foo.c @@ -1395,17 +1395,17 @@ - vars = Variables('custom.py') - vars.Add(EnumVariable('COLOR', 'Set background color', 'red', - allowed_values=('red', 'green', 'blue'), - map={'navy':'blue'}, - ignorecase=1)) - env = Environment(variables = vars, - CPPDEFINES={'COLOR' : '"${COLOR}"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(EnumVariable('COLOR', 'Set background color', 'red', + allowed_values=('red', 'green', 'blue'), + map={'navy':'blue'}, + ignorecase=1)) +env = Environment(variables = vars, + CPPDEFINES={'COLOR' : '"${COLOR}"'}) +env.Program('foo.c') - foo.c +foo.c @@ -1435,17 +1435,17 @@ - vars = Variables('custom.py') - vars.Add(EnumVariable('COLOR', 'Set background color', 'red', - allowed_values=('red', 'green', 'blue'), - map={'navy':'blue'}, - ignorecase=2)) - env = Environment(variables = vars, - CPPDEFINES={'COLOR' : '"${COLOR}"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(EnumVariable('COLOR', 'Set background color', 'red', + allowed_values=('red', 'green', 'blue'), + map={'navy':'blue'}, + ignorecase=2)) +env = Environment(variables = vars, + CPPDEFINES={'COLOR' : '"${COLOR}"'}) +env.Program('foo.c') - foo.c +foo.c @@ -1484,15 +1484,15 @@ - vars = Variables('custom.py') - vars.Add(ListVariable('COLORS', 'List of colors', 0, - ['red', 'green', 'blue'])) - env = Environment(variables = vars, - CPPDEFINES={'COLORS' : '"${COLORS}"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(ListVariable('COLORS', 'List of colors', 0, + ['red', 'green', 'blue'])) +env = Environment(variables = vars, + CPPDEFINES={'COLORS' : '"${COLORS}"'}) +env.Program('foo.c') - foo.c +foo.c @@ -1555,22 +1555,22 @@ - vars = Variables('custom.py') - vars.Add(PathVariable('CONFIG', - 'Path to configuration file', - '__ROOT__/etc/my_config')) - env = Environment(variables = vars, - CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(PathVariable('CONFIG', + 'Path to configuration file', + '__ROOT__/etc/my_config')) +env = Environment(variables = vars, + CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'}) +env.Program('foo.c') - foo.c +foo.c - /opt/location +/opt/location - /opt/location +/opt/location @@ -1611,20 +1611,20 @@ - vars = Variables('custom.py') - vars.Add(PathVariable('CONFIG', - 'Path to configuration file', - '__ROOT__/etc/my_config', - PathVariable.PathIsFile)) - env = Environment(variables = vars, - CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(PathVariable('CONFIG', + 'Path to configuration file', + '__ROOT__/etc/my_config', + PathVariable.PathIsFile)) +env = Environment(variables = vars, + CPPDEFINES={'CONFIG_FILE' : '"$CONFIG"'}) +env.Program('foo.c') - foo.c +foo.c - /opt/location +/opt/location @@ -1638,20 +1638,20 @@ - vars = Variables('custom.py') - vars.Add(PathVariable('DBDIR', - 'Path to database directory', - '__ROOT__/var/my_dbdir', - PathVariable.PathIsDir)) - env = Environment(variables = vars, - CPPDEFINES={'DBDIR' : '"$DBDIR"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(PathVariable('DBDIR', + 'Path to database directory', + '__ROOT__/var/my_dbdir', + PathVariable.PathIsDir)) +env = Environment(variables = vars, + CPPDEFINES={'DBDIR' : '"$DBDIR"'}) +env.Program('foo.c') - foo.c +foo.c - /opt/location +/opt/location @@ -1667,20 +1667,20 @@ - vars = Variables('custom.py') - vars.Add(PathVariable('DBDIR', - 'Path to database directory', - '__ROOT__/var/my_dbdir', - PathVariable.PathIsDirCreate)) - env = Environment(variables = vars, - CPPDEFINES={'DBDIR' : '"$DBDIR"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(PathVariable('DBDIR', + 'Path to database directory', + '__ROOT__/var/my_dbdir', + PathVariable.PathIsDirCreate)) +env = Environment(variables = vars, + CPPDEFINES={'DBDIR' : '"$DBDIR"'}) +env.Program('foo.c') - foo.c +foo.c - /opt/location +/opt/location @@ -1695,17 +1695,17 @@ - vars = Variables('custom.py') - vars.Add(PathVariable('OUTPUT', - 'Path to output file or directory', - None, - PathVariable.PathAccept)) - env = Environment(variables = vars, - CPPDEFINES={'OUTPUT' : '"$OUTPUT"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(PathVariable('OUTPUT', + 'Path to output file or directory', + None, + PathVariable.PathAccept)) +env = Environment(variables = vars, + CPPDEFINES={'OUTPUT' : '"$OUTPUT"'}) +env.Program('foo.c') - foo.c +foo.c @@ -1730,22 +1730,22 @@ - vars = Variables('custom.py') - vars.Add(PackageVariable('PACKAGE', - 'Location package', - '__ROOT__/opt/location')) - env = Environment(variables = vars, - CPPDEFINES={'PACKAGE' : '"$PACKAGE"'}) - env.Program('foo.c') +vars = Variables('custom.py') +vars.Add(PackageVariable('PACKAGE', + 'Location package', + '__ROOT__/opt/location')) +env = Environment(variables = vars, + CPPDEFINES={'PACKAGE' : '"$PACKAGE"'}) +env.Program('foo.c') - foo.c +foo.c - /opt/location +/opt/location - /opt/location +/opt/location @@ -1796,23 +1796,23 @@ - vars = Variables() - vars.AddVariables( - ('RELEASE', 'Set to 1 to build for release', 0), - ('CONFIG', 'Configuration file', '/etc/my_config'), - BoolVariable('warnings', 'compilation with -Wall and similiar', 1), - EnumVariable('debug', 'debug output and symbols', 'no', - allowed_values=('yes', 'no', 'full'), - map={}, ignorecase=0), # case sensitive - ListVariable('shared', - 'libraries to build as shared libraries', - 'all', - names = list_of_libs), - PackageVariable('x11', - 'use X11 installed here (yes = search some places)', - 'yes'), - PathVariable('qtdir', 'where the root of Qt is installed', qtdir), - ) +vars = Variables() +vars.AddVariables( + ('RELEASE', 'Set to 1 to build for release', 0), + ('CONFIG', 'Configuration file', '/etc/my_config'), + BoolVariable('warnings', 'compilation with -Wall and similiar', 1), + EnumVariable('debug', 'debug output and symbols', 'no', + allowed_values=('yes', 'no', 'full'), + map={}, ignorecase=0), # case sensitive + ListVariable('shared', + 'libraries to build as shared libraries', + 'all', + names = list_of_libs), + PackageVariable('x11', + 'use X11 installed here (yes = search some places)', + 'yes'), + PathVariable('qtdir', 'where the root of Qt is installed', qtdir), +) @@ -1857,18 +1857,18 @@ - vars = Variables(None) - vars.Add('RELEASE', 'Set to 1 to build for release', 0) - env = Environment(variables = vars, - CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) - unknown = vars.UnknownVariables() - if unknown: - print "Unknown variables:", unknown.keys() - Exit(1) - env.Program('foo.c') +vars = Variables(None) +vars.Add('RELEASE', 'Set to 1 to build for release', 0) +env = Environment(variables = vars, + CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) +unknown = vars.UnknownVariables() +if unknown: + print "Unknown variables:", unknown.keys() + Exit(1) +env.Program('foo.c') - foo.c +foo.c @@ -1944,16 +1944,16 @@ - if 'bar' in COMMAND_LINE_TARGETS: - print "Don't forget to copy `bar' to the archive!" - Default(Program('foo.c')) - Program('bar.c') +if 'bar' in COMMAND_LINE_TARGETS: + print "Don't forget to copy `bar' to the archive!" +Default(Program('foo.c')) +Program('bar.c') - foo.c +foo.c - foo.c +foo.c @@ -2006,16 +2006,16 @@ - env = Environment() - hello = env.Program('hello.c') - env.Program('goodbye.c') - Default(hello) +env = Environment() +hello = env.Program('hello.c') +env.Program('goodbye.c') +Default(hello) - hello.c +hello.c - goodbye.c +goodbye.c @@ -2060,21 +2060,21 @@ - env = Environment() - prog1 = env.Program('prog1.c') - Default(prog1) - prog2 = env.Program('prog2.c') - prog3 = env.Program('prog3.c') - Default(prog3) +env = Environment() +prog1 = env.Program('prog1.c') +Default(prog1) +prog2 = env.Program('prog2.c') +prog3 = env.Program('prog3.c') +Default(prog3) - prog1.c +prog1.c - prog2.c +prog2.c - prog3.c +prog3.c @@ -2086,11 +2086,11 @@ - env = Environment() - prog1 = env.Program('prog1.c') - prog2 = env.Program('prog2.c') - prog3 = env.Program('prog3.c') - Default(prog1, prog3) +env = Environment() +prog1 = env.Program('prog1.c') +prog2 = env.Program('prog2.c') +prog3 = env.Program('prog3.c') +Default(prog1, prog3) @@ -2118,24 +2118,24 @@ - env = Environment() - env.Program(['prog1/main.c', 'prog1/foo.c']) - env.Program(['prog2/main.c', 'prog2/bar.c']) - Default('prog1') +env = Environment() +env.Program(['prog1/main.c', 'prog1/foo.c']) +env.Program(['prog2/main.c', 'prog2/bar.c']) +Default('prog1') - int main() { printf("prog1/main.c\n"); } +int main() { printf("prog1/main.c\n"); } - int foo() { printf("prog1/foo.c\n"); } +int foo() { printf("prog1/foo.c\n"); } - int main() { printf("prog2/main.c\n"); } +int main() { printf("prog2/main.c\n"); } - int bar() { printf("prog2/bar.c\n"); } +int bar() { printf("prog2/bar.c\n"); } @@ -2163,16 +2163,16 @@ - env = Environment() - prog1 = env.Program('prog1.c') - prog2 = env.Program('prog2.c') - Default(None) +env = Environment() +prog1 = env.Program('prog1.c') +prog2 = env.Program('prog2.c') +Default(None) - prog1.c +prog1.c - prog2.c +prog2.c @@ -2208,12 +2208,12 @@ - prog1 = Program('prog1.c') - Default(prog1) - print "DEFAULT_TARGETS is", map(str, DEFAULT_TARGETS) +prog1 = Program('prog1.c') +Default(prog1) +print "DEFAULT_TARGETS is", map(str, DEFAULT_TARGETS) - prog1.c +prog1.c @@ -2242,18 +2242,18 @@ - prog1 = Program('prog1.c') - Default(prog1) - print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS) - prog2 = Program('prog2.c') - Default(prog2) - print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS) +prog1 = Program('prog1.c') +Default(prog1) +print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS) +prog2 = Program('prog2.c') +Default(prog2) +print "DEFAULT_TARGETS is now", map(str, DEFAULT_TARGETS) - prog1.c +prog1.c - prog2.c +prog2.c @@ -2304,10 +2304,10 @@ - if COMMAND_LINE_TARGETS: - targets = COMMAND_LINE_TARGETS - else: - targets = DEFAULT_TARGETS +if COMMAND_LINE_TARGETS: + targets = COMMAND_LINE_TARGETS +else: + targets = DEFAULT_TARGETS @@ -2335,16 +2335,16 @@ - prog1 = Program('prog1.c') - Program('prog2.c') - Default(prog1) - print "BUILD_TARGETS is", map(str, BUILD_TARGETS) +prog1 = Program('prog1.c') +Program('prog2.c') +Default(prog1) +print "BUILD_TARGETS is", map(str, BUILD_TARGETS) - prog1.c +prog1.c - prog2.c +prog2.c diff --git a/doc/user/depends.xml b/doc/user/depends.xml index d252544d..2dd7ea6b 100644 --- a/doc/user/depends.xml +++ b/doc/user/depends.xml @@ -60,10 +60,10 @@ - Program('hello.c') +Program('hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -173,8 +173,8 @@ - Program('hello.c') - Decider('MD5') +Program('hello.c') +Decider('MD5') @@ -270,11 +270,11 @@ - Object('hello.c') - Decider('timestamp-newer') +Object('hello.c') +Decider('timestamp-newer') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -303,8 +303,8 @@ - Object('hello.c') - Decider('make') +Object('hello.c') +Decider('make') @@ -339,11 +339,11 @@ - Object('hello.c') - Decider('timestamp-match') +Object('hello.c') +Decider('timestamp-match') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -398,11 +398,11 @@ - Program('hello.c') - Decider('MD5-timestamp') +Program('hello.c') +Decider('MD5-timestamp') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -431,17 +431,17 @@ --> - % scons -Q hello - cc -o hello.o -c hello.c - cc -o hello hello.o - % touch hello.c - % scons -Q hello - scons: `hello' is up to date. - % edit hello.c - [CHANGE THE CONTENTS OF hello.c] - % scons -Q hello - cc -o hello.o -c hello.c - cc -o hello hello.o +% scons -Q hello +cc -o hello.o -c hello.c +cc -o hello hello.o +% touch hello.c +% scons -Q hello +scons: `hello' is up to date. +% edit hello.c + [CHANGE THE CONTENTS OF hello.c] +% scons -Q hello +cc -o hello.o -c hello.c +cc -o hello hello.o @@ -516,18 +516,18 @@ - Program('hello.c') - def decide_if_changed(dependency, target, prev_ni): - if self.get_timestamp() != prev_ni.timestamp: - dep = str(dependency) - tgt = str(target) - if specific_part_of_file_has_changed(dep, tgt): - return True - return False - Decider(decide_if_changed) +Program('hello.c') +def decide_if_changed(dependency, target, prev_ni): + if self.get_timestamp() != prev_ni.timestamp: + dep = str(dependency) + tgt = str(target) + if specific_part_of_file_has_changed(dep, tgt): + return True + return False +Decider(decide_if_changed) - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -635,35 +635,35 @@ - env = Environment() - - def config_file_decider(dependency, target, prev_ni): - import os.path - - # We always have to init the .csig value... - dep_csig = dependency.get_csig() - # .csig may not exist, because no target was built yet... - if 'csig' not in dir(prev_ni): - return True - # Target file may not exist yet - if not os.path.exists(str(target.abspath)): - return True - if dep_csig != prev_ni.csig: - # Some change on source file => update installed one - return True - return False - - def update_file(): - f = open("test.txt","a") - f.write("some line\n") - f.close() - - update_file() - - # Activate our own decider function - env.Decider(config_file_decider) - - env.Install("install","test.txt") +env = Environment() + +def config_file_decider(dependency, target, prev_ni): + import os.path + + # We always have to init the .csig value... + dep_csig = dependency.get_csig() + # .csig may not exist, because no target was built yet... + if 'csig' not in dir(prev_ni): + return True + # Target file may not exist yet + if not os.path.exists(str(target.abspath)): + return True + if dep_csig != prev_ni.csig: + # Some change on source file => update installed one + return True + return False + +def update_file(): + f = open("test.txt","a") + f.write("some line\n") + f.close() + +update_file() + +# Activate our own decider function +env.Decider(config_file_decider) + +env.Install("install","test.txt") @@ -698,22 +698,22 @@ - env1 = Environment(CPPPATH = ['.']) - env2 = env1.Clone() - env2.Decider('timestamp-match') - env1.Program('prog-MD5', 'program1.c') - env2.Program('prog-timestamp', 'program2.c') +env1 = Environment(CPPPATH = ['.']) +env2 = env1.Clone() +env2.Decider('timestamp-match') +env1.Program('prog-MD5', 'program1.c') +env2.Program('prog-timestamp', 'program2.c') - #include "inc.h" - int main() { printf("Hello, world!\n"); } +#include "inc.h" +int main() { printf("Hello, world!\n"); } - #include "inc.h" - int main() { printf("Hello, world!\n"); } +#include "inc.h" +int main() { printf("Hello, world!\n"); } - #define INC 1 +#define INC 1 @@ -771,8 +771,8 @@ - Program('hello.c') - SourceSignatures('MD5') +Program('hello.c') +SourceSignatures('MD5') @@ -782,8 +782,8 @@ - Program('hello.c') - SourceSignatures('timestamp') +Program('hello.c') +SourceSignatures('timestamp') @@ -839,8 +839,8 @@ - Program('hello.c') - TargetSignatures('MD5') +Program('hello.c') +TargetSignatures('MD5') @@ -853,8 +853,8 @@ - Program('hello.c') - TargetSignatures('timestamp') +Program('hello.c') +TargetSignatures('timestamp') @@ -882,9 +882,9 @@ - Program('hello.c') - TargetSignatures('source') - SourceSignatures('timestamp') +Program('hello.c') +TargetSignatures('source') +SourceSignatures('timestamp') @@ -949,18 +949,18 @@ - Program('hello.c', CPPPATH = '.') +Program('hello.c', CPPPATH = '.') - #include <hello.h> - int - main() - { - printf("Hello, %s!\n", string); - } +#include <hello.h> +int +main() +{ + printf("Hello, %s!\n", string); +} - #define string "world" +#define string "world" @@ -1049,10 +1049,10 @@ - Program('hello.c', CPPPATH = ['include', '/home/project/inc']) +Program('hello.c', CPPPATH = ['include', '/home/project/inc']) - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -1142,7 +1142,7 @@ - SetOption('implicit_cache', 1) +SetOption('implicit_cache', 1) @@ -1291,23 +1291,23 @@ - hello = Program('hello.c') - Depends(hello, 'other_file') +hello = Program('hello.c') +Depends(hello, 'other_file') - % scons -Q hello - cc -c hello.c -o hello.o - cc -o hello hello.o - % scons -Q hello - scons: `hello' is up to date. - % edit other_file - [CHANGE THE CONTENTS OF other_file] - % scons -Q hello - cc -c hello.c -o hello.o - cc -o hello hello.o +% scons -Q hello +cc -c hello.c -o hello.o +cc -o hello hello.o +% scons -Q hello +scons: `hello' is up to date. +% edit other_file + [CHANGE THE CONTENTS OF other_file] +% scons -Q hello +cc -c hello.c -o hello.o +cc -o hello hello.o @@ -1320,9 +1320,9 @@ - hello = Program('hello.c') - goodbye = Program('goodbye.c') - Depends(hello, goodbye) +hello = Program('hello.c') +goodbye = Program('goodbye.c') +Depends(hello, goodbye) @@ -1333,11 +1333,11 @@ - % scons -Q hello - cc -c goodbye.c -o goodbye.o - cc -o goodbye goodbye.o - cc -c hello.c -o hello.o - cc -o hello hello.o +% scons -Q hello +cc -c goodbye.c -o goodbye.o +cc -o goodbye goodbye.o +cc -c hello.c -o hello.o +cc -o hello hello.o @@ -1480,14 +1480,14 @@ --> - % scons -Q - cc -o hello.o -c -MD -MF hello.d -I. hello.c - cc -o hello hello.o - % scons -Q --debug=explain - scons: rebuilding `hello.o' because `foo.h' is a new dependency - cc -o hello.o -c -MD -MF hello.d -I. hello.c - % scons -Q - scons: `.' is up to date. +% scons -Q +cc -o hello.o -c -MD -MF hello.d -I. hello.c +cc -o hello hello.o +% scons -Q --debug=explain +scons: rebuilding `hello.o' because `foo.h' is a new dependency +cc -o hello.o -c -MD -MF hello.d -I. hello.c +% scons -Q +scons: `.' is up to date. @@ -1532,16 +1532,16 @@ - hello_obj=Object('hello.c') - hello = Program(hello_obj) - Ignore(hello_obj, 'hello.h') +hello_obj=Object('hello.c') +hello = Program(hello_obj) +Ignore(hello_obj, 'hello.h') - #include "hello.h" - int main() { printf("Hello, %s!\n", string); } +#include "hello.h" +int main() { printf("Hello, %s!\n", string); } - #define string "world" +#define string "world" @@ -1558,15 +1558,15 @@ --> - % scons -Q hello - cc -c -o hello.o hello.c - cc -o hello hello.o - % scons -Q hello - scons: `hello' is up to date. - % edit hello.h - [CHANGE THE CONTENTS OF hello.h] - % scons -Q hello - scons: `hello' is up to date. +% scons -Q hello +cc -c -o hello.o hello.c +cc -o hello hello.o +% scons -Q hello +scons: `hello' is up to date. +% edit hello.h + [CHANGE THE CONTENTS OF hello.h] +% scons -Q hello +scons: `hello' is up to date. @@ -1591,8 +1591,8 @@ - hello = Program('hello.c', CPPPATH=['/usr/include']) - Ignore(hello, '/usr/include/stdio.h') +hello = Program('hello.c', CPPPATH=['/usr/include']) +Ignore(hello, '/usr/include/stdio.h') @@ -1608,13 +1608,13 @@ - hello_obj=Object('hello.c') - hello = Program(hello_obj) - Ignore('.',[hello,hello_obj]) +hello_obj=Object('hello.c') +hello = Program(hello_obj) +Ignore('.',[hello,hello_obj]) - #include "stdio.h" - int main() { printf("Hello!\n"); } +#include "stdio.h" +int main() { printf("Hello!\n"); } @@ -1801,11 +1801,11 @@ - hello = Program('hello.c') - AlwaysBuild(hello) +hello = Program('hello.c') +AlwaysBuild(hello) - int main() { printf("Hello, %s!\n", string); } +int main() { printf("Hello, %s!\n", string); } diff --git a/doc/user/environments.xml b/doc/user/environments.xml index 0a4192f8..f11a95b6 100644 --- a/doc/user/environments.xml +++ b/doc/user/environments.xml @@ -490,10 +490,10 @@ environment, of directory names, suffixes, etc. - import os +import os - int main() { } +int main() { } @@ -546,7 +546,7 @@ environment, of directory names, suffixes, etc. - env = Environment() +env = Environment() @@ -626,8 +626,8 @@ environment, of directory names, suffixes, etc. - env = Environment() - print "CC is:", env['CC'] +env = Environment() +print "CC is:", env['CC'] @@ -655,10 +655,10 @@ environment, of directory names, suffixes, etc. - env = Environment(FOO = 'foo', BAR = 'bar') - dict = env.Dictionary() - for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']: - print "key = %s, value = %s" % (key, dict[key]) +env = Environment(FOO = 'foo', BAR = 'bar') +dict = env.Dictionary() +for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']: + print "key = %s, value = %s" % (key, dict[key]) @@ -693,9 +693,9 @@ environment, of directory names, suffixes, etc. - env = Environment() - for item in sorted(env.Dictionary().items()): - print "construction variable = '%s', value = '%s'" % item +env = Environment() +for item in sorted(env.Dictionary().items()): + print "construction variable = '%s', value = '%s'" % item @@ -720,8 +720,8 @@ environment, of directory names, suffixes, etc. - env = Environment() - print "CC is:", env.subst('$CC') +env = Environment() +print "CC is:", env.subst('$CC') @@ -737,8 +737,8 @@ environment, of directory names, suffixes, etc. - env = Environment(CCFLAGS = '-DFOO') - print "CCCOM is:", env['CCCOM'] +env = Environment(CCFLAGS = '-DFOO') +print "CCCOM is:", env['CCCOM'] @@ -750,9 +750,9 @@ environment, of directory names, suffixes, etc. - % scons -Q - CCCOM is: $CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES - scons: `.' is up to date. +% scons -Q +CCCOM is: $CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES +scons: `.' is up to date. @@ -763,8 +763,8 @@ environment, of directory names, suffixes, etc. - env = Environment(CCFLAGS = '-DFOO') - print "CCCOM is:", env.subst('$CCCOM') +env = Environment(CCFLAGS = '-DFOO') +print "CCCOM is:", env.subst('$CCCOM') @@ -777,9 +777,9 @@ environment, of directory names, suffixes, etc. - % scons -Q - CCCOM is: gcc -DFOO -c -o - scons: `.' is up to date. +% scons -Q +CCCOM is: gcc -DFOO -c -o +scons: `.' is up to date. @@ -805,8 +805,8 @@ environment, of directory names, suffixes, etc. - env = Environment() - print "value is:", env.subst( '->$MISSING<-' ) +env = Environment() +print "value is:", env.subst( '->$MISSING<-' ) @@ -832,9 +832,9 @@ environment, of directory names, suffixes, etc. - AllowSubstExceptions() - env = Environment() - print "value is:", env.subst( '->$MISSING<-' ) +AllowSubstExceptions() +env = Environment() +print "value is:", env.subst( '->$MISSING<-' ) @@ -852,9 +852,9 @@ environment, of directory names, suffixes, etc. - AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) - env = Environment() - print "value is:", env.subst( '->${1 / 0}<-' ) +AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) +env = Environment() +print "value is:", env.subst( '->${1 / 0}<-' ) @@ -1190,12 +1190,12 @@ environment, of directory names, suffixes, etc. - env = Environment(CCFLAGS = '-DDEFINE1') - env.Replace(CCFLAGS = '-DDEFINE2') - env.Program('foo.c') +env = Environment(CCFLAGS = '-DDEFINE1') +env.Replace(CCFLAGS = '-DDEFINE2') +env.Program('foo.c') - int main() { } +int main() { } @@ -1222,9 +1222,9 @@ environment, of directory names, suffixes, etc. - env = Environment() - env.Replace(NEW_VARIABLE = 'xyzzy') - print "NEW_VARIABLE =", env['NEW_VARIABLE'] +env = Environment() +env.Replace(NEW_VARIABLE = 'xyzzy') +print "NEW_VARIABLE =", env['NEW_VARIABLE'] @@ -1321,7 +1321,7 @@ environment, of directory names, suffixes, etc. - env.SetDefault(SPECIAL_FLAG = '-extra-option') +env.SetDefault(SPECIAL_FLAG = '-extra-option') @@ -1352,12 +1352,12 @@ environment, of directory names, suffixes, etc. - env = Environment(CCFLAGS = ['-DMY_VALUE']) - env.Append(CCFLAGS = ['-DLAST']) - env.Program('foo.c') +env = Environment(CCFLAGS = ['-DMY_VALUE']) +env.Append(CCFLAGS = ['-DLAST']) +env.Program('foo.c') - int main() { } +int main() { } @@ -1381,9 +1381,9 @@ environment, of directory names, suffixes, etc. - env = Environment() - env.Append(NEW_VARIABLE = 'added') - print "NEW_VARIABLE =", env['NEW_VARIABLE'] +env = Environment() +env.Append(NEW_VARIABLE = 'added') +print "NEW_VARIABLE =", env['NEW_VARIABLE'] @@ -1425,7 +1425,7 @@ environment, of directory names, suffixes, etc. - env.AppendUnique(CCFLAGS=['-g']) +env.AppendUnique(CCFLAGS=['-g']) @@ -1452,12 +1452,12 @@ environment, of directory names, suffixes, etc. - env = Environment(CCFLAGS = ['-DMY_VALUE']) - env.Prepend(CCFLAGS = ['-DFIRST']) - env.Program('foo.c') +env = Environment(CCFLAGS = ['-DMY_VALUE']) +env.Prepend(CCFLAGS = ['-DFIRST']) +env.Program('foo.c') - int main() { } +int main() { } @@ -1481,9 +1481,9 @@ environment, of directory names, suffixes, etc. - env = Environment() - env.Prepend(NEW_VARIABLE = 'added') - print "NEW_VARIABLE =", env['NEW_VARIABLE'] +env = Environment() +env.Prepend(NEW_VARIABLE = 'added') +print "NEW_VARIABLE =", env['NEW_VARIABLE'] @@ -1527,7 +1527,7 @@ environment, of directory names, suffixes, etc. - env.PrependUnique(CCFLAGS=['-g']) +env.PrependUnique(CCFLAGS=['-g']) @@ -1598,8 +1598,8 @@ environment, of directory names, suffixes, etc. - path = ['/usr/local/bin', '/bin', '/usr/bin'] - env = Environment(ENV = {'PATH' : path}) +path = ['/usr/local/bin', '/bin', '/usr/bin'] +env = Environment(ENV = {'PATH' : path}) @@ -1618,7 +1618,7 @@ environment, of directory names, suffixes, etc. - env['ENV']['PATH'] = ['/usr/local/bin', '/bin', '/usr/bin'] +env['ENV']['PATH'] = ['/usr/local/bin', '/bin', '/usr/bin'] @@ -1631,7 +1631,7 @@ environment, of directory names, suffixes, etc. - env['ENV']['PATH'] = '/usr/local/bin:/bin:/usr/bin' +env['ENV']['PATH'] = '/usr/local/bin:/bin:/usr/bin' @@ -1646,19 +1646,19 @@ environment, of directory names, suffixes, etc. - env = Environment() - env.Command('foo', [], '__ROOT__/usr/bin/printenv.py') +env = Environment() +env.Command('foo', [], '__ROOT__/usr/bin/printenv.py') - #!/usr/bin/env python - import os - import sys - if len(sys.argv) > 1: - keys = sys.argv[1:] - else: - keys = sorted(os.environ.keys()) - for key in keys: - print " " + key + "=" + os.environ[key] +#!/usr/bin/env python +import os +import sys +if len(sys.argv) > 1: + keys = sys.argv[1:] +else: + keys = sorted(os.environ.keys()) +for key in keys: + print " " + key + "=" + os.environ[key] @@ -1689,8 +1689,8 @@ environment, of directory names, suffixes, etc. - import os - env = Environment(ENV = {'PATH' : os.environ['PATH']}) +import os +env = Environment(ENV = {'PATH' : os.environ['PATH']}) @@ -1705,8 +1705,8 @@ environment, of directory names, suffixes, etc. - import os - env = Environment(ENV = os.environ) +import os +env = Environment(ENV = os.environ) @@ -1752,9 +1752,9 @@ environment, of directory names, suffixes, etc. - env = Environment(ENV = os.environ) - env.PrependENVPath('PATH', '/usr/local/bin') - env.AppendENVPath('LIB', '/usr/local/lib') +env = Environment(ENV = os.environ) +env.PrependENVPath('PATH', '/usr/local/bin') +env.AppendENVPath('LIB', '/usr/local/lib') diff --git a/doc/user/factories.xml b/doc/user/factories.xml index 15a962d5..93283bb7 100644 --- a/doc/user/factories.xml +++ b/doc/user/factories.xml @@ -84,7 +84,7 @@ - Command("file.out", "file.in", Copy("$TARGET", "$SOURCE")) +Command("file.out", "file.in", Copy("$TARGET", "$SOURCE")) file.in @@ -113,7 +113,7 @@ - Command("file.out", [], Copy("$TARGET", "file.in")) +Command("file.out", [], Copy("$TARGET", "file.in")) file.in @@ -147,22 +147,22 @@ - Command("file.out", "file.in", - [ - Copy("tempfile", "$SOURCE"), - "modify tempfile", - Copy("$TARGET", "tempfile"), - ]) +Command("file.out", "file.in", + [ + Copy("tempfile", "$SOURCE"), + "modify tempfile", + Copy("$TARGET", "tempfile"), + ]) - env = DefaultEnvironment() - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - SConscript('S') +env = DefaultEnvironment() +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +SConscript('S') file.in - touch $* +touch $* @@ -198,23 +198,23 @@ - Command("file.out", "file.in", - [ - Delete("tempfile"), - Copy("tempfile", "$SOURCE"), - "modify tempfile", - Copy("$TARGET", "tempfile"), - ]) +Command("file.out", "file.in", + [ + Delete("tempfile"), + Copy("tempfile", "$SOURCE"), + "modify tempfile", + Copy("$TARGET", "tempfile"), + ]) - env = DefaultEnvironment() - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - SConscript('S') +env = DefaultEnvironment() +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +SConscript('S') file.in - touch $* +touch $* @@ -239,11 +239,11 @@ - Command("file.out", "file.in", - [ - Delete("$TARGET"), - Copy("$TARGET", "$SOURCE") - ]) +Command("file.out", "file.in", + [ + Delete("$TARGET"), + Copy("$TARGET", "$SOURCE") + ]) file.in @@ -293,22 +293,22 @@ - Command("file.out", "file.in", - [ - Copy("tempfile", "$SOURCE"), - "modify tempfile", - Move("$TARGET", "tempfile"), - ]) +Command("file.out", "file.in", + [ + Copy("tempfile", "$SOURCE"), + "modify tempfile", + Move("$TARGET", "tempfile"), + ]) - env = DefaultEnvironment() - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - SConscript('S') +env = DefaultEnvironment() +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +SConscript('S') file.in - touch $* +touch $* @@ -337,17 +337,17 @@ - Command("file.out", "file.in", - [ - Copy("$TARGET", "$SOURCE"), - Touch("$TARGET"), - ]) +Command("file.out", "file.in", + [ + Copy("$TARGET", "$SOURCE"), + Touch("$TARGET"), + ]) - env = DefaultEnvironment() - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - SConscript('S') +env = DefaultEnvironment() +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +SConscript('S') file.in @@ -381,25 +381,25 @@ - Command("file.out", "file.in", - [ - Delete("tempdir"), - Mkdir("tempdir"), - Copy("tempdir/${SOURCE.file}", "$SOURCE"), - "process tempdir", - Move("$TARGET", "tempdir/output_file"), - Delete("tempdir"), - ]) +Command("file.out", "file.in", + [ + Delete("tempdir"), + Mkdir("tempdir"), + Copy("tempdir/${SOURCE.file}", "$SOURCE"), + "process tempdir", + Move("$TARGET", "tempdir/output_file"), + Delete("tempdir"), + ]) - env = DefaultEnvironment() - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - SConscript('S') +env = DefaultEnvironment() +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +SConscript('S') file.in - touch $* +touch $* @@ -431,11 +431,11 @@ - Command("file.out", "file.in", - [ - Copy("$TARGET", "$SOURCE"), - Chmod("$TARGET", 0755), - ]) +Command("file.out", "file.in", + [ + Copy("$TARGET", "$SOURCE"), + Chmod("$TARGET", 0755), + ]) file.in @@ -470,7 +470,7 @@ - Execute(Mkdir('__ROOT__/tmp/my_temp_directory')) +Execute(Mkdir('__ROOT__/tmp/my_temp_directory')) @@ -521,9 +521,9 @@ - if Execute(Mkdir('__ROOT__/tmp/my_temp_directory')): - # A problem occurred while making the temp directory. - Exit(1) +if Execute(Mkdir('__ROOT__/tmp/my_temp_directory')): + # A problem occurred while making the temp directory. + Exit(1) diff --git a/doc/user/file-removal.xml b/doc/user/file-removal.xml index 3b1c36e8..ebf7cc92 100644 --- a/doc/user/file-removal.xml +++ b/doc/user/file-removal.xml @@ -80,18 +80,18 @@ - env = Environment(RANLIBCOM='') - lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c']) - env.Precious(lib) + env = Environment(RANLIBCOM='') + lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c']) + env.Precious(lib) - int f1() { } +int f1() { } - int f2() { } +int f2() { } - int f3() { } +int f3() { } @@ -138,18 +138,18 @@ - env = Environment(RANLIBCOM='') - lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c']) - env.NoClean(lib) +env = Environment(RANLIBCOM='') +lib = env.Library('foo', ['f1.c', 'f2.c', 'f3.c']) +env.NoClean(lib) - int f1() { } +int f1() { } - int f2() { } +int f2() { } - int f3() { } +int f3() { } @@ -199,23 +199,23 @@ - t = Command('foo.out', 'foo.in', 'build -o $TARGET $SOURCE') - Clean(t, 'foo.log') +t = Command('foo.out', 'foo.in', 'build -o $TARGET $SOURCE') +Clean(t, 'foo.log') - env = DefaultEnvironment() - import os - env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() - SConscript('S') +env = DefaultEnvironment() +import os +env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() +SConscript('S') - foo.in +foo.in - foo.log +foo.log - cat $3 > $2 +cat $3 > $2 diff --git a/doc/user/gettext.xml b/doc/user/gettext.xml index 9698c95e..4b1e9ea1 100644 --- a/doc/user/gettext.xml +++ b/doc/user/gettext.xml @@ -80,13 +80,13 @@ for example - /* hello.c */ - #include <stdio.h> - int main(int argc, char* argv[]) - { - printf("Hello world\n"); - return 0; - } +/* hello.c */ +#include <stdio.h> +int main(int argc, char* argv[]) +{ + printf("Hello world\n"); + return 0; +} @@ -94,9 +94,9 @@ as usual. - # SConstruct - env = Environment() - hello = Program(["hello.c"]) +# SConstruct +env = Environment() +hello = Program(["hello.c"]) @@ -120,18 +120,18 @@ internationalization. Change the previous code so it reads as follows: - /* hello.c */ - #include <stdio.h> - #include <libintl.h> - #include <locale.h> - int main(int argc, char* argv[]) - { - bindtextdomain("hello", "locale"); - setlocale(LC_ALL, ""); - textdomain("hello"); - printf(gettext("Hello world\n")); - return 0; - } +/* hello.c */ +#include <stdio.h> +#include <libintl.h> +#include <locale.h> +int main(int argc, char* argv[]) +{ + bindtextdomain("hello", "locale"); + setlocale(LC_ALL, ""); + textdomain("hello"); + printf(gettext("Hello world\n")); + return 0; +} Detailed recipes for such conversion can @@ -162,18 +162,18 @@ SConstruct is as follows: - # SConstruct - env = Environment( tools = ['default', 'gettext'] ) - hello = env.Program(["hello.c"]) - env['XGETTEXTFLAGS'] = [ - '--package-name=%s' % 'hello', - '--package-version=%s' % '1.0', - ] - po = env.Translate(["pl","en", "de"], ["hello.c"], POAUTOINIT = 1) - mo = env.MOFiles(po) - InstallAs(["locale/en/LC_MESSAGES/hello.mo"], ["en.mo"]) - InstallAs(["locale/pl/LC_MESSAGES/hello.mo"], ["pl.mo"]) - InstallAs(["locale/de/LC_MESSAGES/hello.mo"], ["de.mo"]) +# SConstruct +env = Environment( tools = ['default', 'gettext'] ) +hello = env.Program(["hello.c"]) +env['XGETTEXTFLAGS'] = [ + '--package-name=%s' % 'hello', + '--package-version=%s' % '1.0', +] +po = env.Translate(["pl","en", "de"], ["hello.c"], POAUTOINIT = 1) +mo = env.MOFiles(po) +InstallAs(["locale/en/LC_MESSAGES/hello.mo"], ["en.mo"]) +InstallAs(["locale/pl/LC_MESSAGES/hello.mo"], ["pl.mo"]) +InstallAs(["locale/de/LC_MESSAGES/hello.mo"], ["de.mo"]) @@ -181,29 +181,29 @@ Generate the translation files with scons po-update. You should see the output from SCons simillar to this: - user@host:$ scons po-update - scons: Reading SConscript files ... - scons: done reading SConscript files. - scons: Building targets ... - Entering '/home/ptomulik/projects/tmp' - xgettext --package-name=hello --package-version=1.0 -o - hello.c - Leaving '/home/ptomulik/projects/tmp' - Writting 'messages.pot' (new file) - msginit --no-translator -l pl -i messages.pot -o pl.po - Created pl.po. - msginit --no-translator -l en -i messages.pot -o en.po - Created en.po. - msginit --no-translator -l de -i messages.pot -o de.po - Created de.po. - scons: done building targets. +user@host:$ scons po-update +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +Entering '/home/ptomulik/projects/tmp' +xgettext --package-name=hello --package-version=1.0 -o - hello.c +Leaving '/home/ptomulik/projects/tmp' +Writting 'messages.pot' (new file) +msginit --no-translator -l pl -i messages.pot -o pl.po +Created pl.po. +msginit --no-translator -l en -i messages.pot -o en.po +Created en.po. +msginit --no-translator -l de -i messages.pot -o de.po +Created de.po. +scons: done building targets. If everything is right, you should see following new files. - user@host:$ ls *.po* - de.po en.po messages.pot pl.po +user@host:$ ls *.po* +de.po en.po messages.pot pl.po @@ -228,19 +228,19 @@ Now compile the project by executing scons. The output should be similar to this: - user@host:$ scons - scons: Reading SConscript files ... - scons: done reading SConscript files. - scons: Building targets ... - msgfmt -c -o de.mo de.po - msgfmt -c -o en.mo en.po - gcc -o hello.o -c hello.c - gcc -o hello hello.o - Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo" - Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo" - msgfmt -c -o pl.mo pl.po - Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo" - scons: done building targets. +user@host:$ scons +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +msgfmt -c -o de.mo de.po +msgfmt -c -o en.mo en.po +gcc -o hello.o -c hello.c +gcc -o hello hello.o +Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo" +Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo" +msgfmt -c -o pl.mo pl.po +Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo" +scons: done building targets. SCons automatically compiled the PO files to binary format MO, and the InstallAs lines installed @@ -249,16 +249,16 @@ Your program should be now ready. You may try it as follows (linux): - user@host:$ LANG=en_US.UTF-8 ./hello - Welcome to beautiful world +user@host:$ LANG=en_US.UTF-8 ./hello +Welcome to beautiful world - user@host:$ LANG=de_DE.UTF-8 ./hello - Hallo Welt +user@host:$ LANG=de_DE.UTF-8 ./hello +Hallo Welt - user@host:$ LANG=pl_PL.UTF-8 ./hello - Witaj swiecie +user@host:$ LANG=pl_PL.UTF-8 ./hello +Witaj swiecie @@ -267,13 +267,13 @@ swiecie\n". Run scons to see how scons reacts to this - user@host:$scons - scons: Reading SConscript files ... - scons: done reading SConscript files. - scons: Building targets ... - msgfmt -c -o pl.mo pl.po - Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo" - scons: done building targets. +user@host:$scons +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +msgfmt -c -o pl.mo pl.po +Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo" +scons: done building targets. @@ -281,19 +281,19 @@ printf line with new message. - /* hello.c */ - #include <stdio.h> - #include <libintl.h> - #include <locale.h> - int main(int argc, char* argv[]) - { - bindtextdomain("hello", "locale"); - setlocale(LC_ALL, ""); - textdomain("hello"); - printf(gettext("Hello world\n")); - printf(gettext("and good bye\n")); - return 0; - } +/* hello.c */ +#include <stdio.h> +#include <libintl.h> +#include <locale.h> +int main(int argc, char* argv[]) +{ + bindtextdomain("hello", "locale"); + setlocale(LC_ALL, ""); + textdomain("hello"); + printf(gettext("Hello world\n")); + printf(gettext("and good bye\n")); + return 0; +} @@ -302,29 +302,29 @@ msgmerge(1) program is used by SCons to update PO file. The output from compilation is like: - user@host:$scons - scons: Reading SConscript files ... - scons: done reading SConscript files. - scons: Building targets ... - Entering '/home/ptomulik/projects/tmp' - xgettext --package-name=hello --package-version=1.0 -o - hello.c - Leaving '/home/ptomulik/projects/tmp' - Writting 'messages.pot' (messages in file were outdated) - msgmerge --update de.po messages.pot - ... done. - msgfmt -c -o de.mo de.po - msgmerge --update en.po messages.pot - ... done. - msgfmt -c -o en.mo en.po - gcc -o hello.o -c hello.c - gcc -o hello hello.o - Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo" - Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo" - msgmerge --update pl.po messages.pot - ... done. - msgfmt -c -o pl.mo pl.po - Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo" - scons: done building targets. +user@host:$scons +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +Entering '/home/ptomulik/projects/tmp' +xgettext --package-name=hello --package-version=1.0 -o - hello.c +Leaving '/home/ptomulik/projects/tmp' +Writting 'messages.pot' (messages in file were outdated) +msgmerge --update de.po messages.pot +... done. +msgfmt -c -o de.mo de.po +msgmerge --update en.po messages.pot +... done. +msgfmt -c -o en.mo en.po +gcc -o hello.o -c hello.c +gcc -o hello hello.o +Install file: "de.mo" as "locale/de/LC_MESSAGES/hello.mo" +Install file: "en.mo" as "locale/en/LC_MESSAGES/hello.mo" +msgmerge --update pl.po messages.pot +... done. +msgfmt -c -o pl.mo pl.po +Install file: "pl.mo" as "locale/pl/LC_MESSAGES/hello.mo" +scons: done building targets. @@ -336,35 +336,35 @@ line to the program (after the last printf), so its code becomes: - /* hello.c */ - #include <stdio.h> - #include <libintl.h> - #include <locale.h> - int main(int argc, char* argv[]) - { - bindtextdomain("hello", "locale"); - setlocale(LC_ALL, ""); - textdomain("hello"); - printf(gettext("Hello world\n")); - printf(gettext("and good bye\n")); - printf("----------------\n"); - return a; - } +/* hello.c */ +#include <stdio.h> +#include <libintl.h> +#include <locale.h> +int main(int argc, char* argv[]) +{ + bindtextdomain("hello", "locale"); + setlocale(LC_ALL, ""); + textdomain("hello"); + printf(gettext("Hello world\n")); + printf(gettext("and good bye\n")); + printf("----------------\n"); + return a; +} Compile the project. You'll see on your screen - user@host:$scons - scons: Reading SConscript files ... - scons: done reading SConscript files. - scons: Building targets ... - Entering '/home/ptomulik/projects/tmp' - xgettext --package-name=hello --package-version=1.0 -o - hello.c - Leaving '/home/ptomulik/projects/tmp' - Not writting 'messages.pot' (messages in file found to be up-to-date) - gcc -o hello.o -c hello.c - gcc -o hello hello.o - scons: done building targets. +user@host:$scons +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +Entering '/home/ptomulik/projects/tmp' +xgettext --package-name=hello --package-version=1.0 -o - hello.c +Leaving '/home/ptomulik/projects/tmp' +Not writting 'messages.pot' (messages in file found to be up-to-date) +gcc -o hello.o -c hello.c +gcc -o hello hello.o +scons: done building targets. As you see, the internationalized messages ditn't change, so the POT and the rest of translation files have not diff --git a/doc/user/hierarchy.xml b/doc/user/hierarchy.xml index d2d01e7e..9aaecc2e 100644 --- a/doc/user/hierarchy.xml +++ b/doc/user/hierarchy.xml @@ -219,10 +219,10 @@ make no difference to the build. - SConscript(['drivers/display/SConscript', - 'drivers/mouse/SConscript', - 'parser/SConscript', - 'utilities/SConscript']) +SConscript(['drivers/display/SConscript', + 'drivers/mouse/SConscript', + 'parser/SConscript', + 'utilities/SConscript']) @@ -241,9 +241,9 @@ make no difference to the build. - SConscript(['drivers/SConscript', - 'parser/SConscript', - 'utilities/SConscript']) +SConscript(['drivers/SConscript', + 'parser/SConscript', + 'utilities/SConscript']) @@ -255,8 +255,8 @@ make no difference to the build. - SConscript(['display/SConscript', - 'mouse/SConscript']) +SConscript(['display/SConscript', + 'mouse/SConscript']) @@ -303,36 +303,36 @@ make no difference to the build. - SConscript(['prog1/SConscript', - 'prog2/SConscript']) +SConscript(['prog1/SConscript', + 'prog2/SConscript']) - env = Environment() - env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c']) +env = Environment() +env.Program('prog1', ['main.c', 'foo1.c', 'foo2.c']) - env = Environment() - env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c']) +env = Environment() +env.Program('prog2', ['main.c', 'bar1.c', 'bar2.c']) - x +x - x +x - x +x - x +x - x +x - x +x @@ -404,20 +404,20 @@ make no difference to the build. - SConscript('src/prog/SConscript') +SConscript('src/prog/SConscript') - env = Environment() - env.Program('prog', ['main.c', '#lib/foo1.c', 'foo2.c']) +env = Environment() +env.Program('prog', ['main.c', '#lib/foo1.c', 'foo2.c']) - x +x - x +x - x +x @@ -460,20 +460,20 @@ make no difference to the build. - SConscript('src/prog/SConscript') +SConscript('src/prog/SConscript') - env = Environment() - env.Program('prog', ['main.c', '__ROOT__/usr/joe/lib/foo1.c', 'foo2.c']) +env = Environment() +env.Program('prog', ['main.c', '__ROOT__/usr/joe/lib/foo1.c', 'foo2.c']) - x +x - x +x - x +x @@ -549,8 +549,8 @@ make no difference to the build. - env = Environment() - Export('env') +env = Environment() +Export('env') @@ -560,9 +560,9 @@ make no difference to the build. - env = Environment() - debug = ARGUMENTS['debug'] - Export('env', 'debug') +env = Environment() +debug = ARGUMENTS['debug'] +Export('env', 'debug') @@ -574,7 +574,7 @@ make no difference to the build. - Export('env debug') +Export('env debug') @@ -586,7 +586,7 @@ make no difference to the build. - SConscript('src/SConscript', 'env') +SConscript('src/SConscript', 'env') @@ -596,7 +596,7 @@ make no difference to the build. - SConscript('src/SConscript', exports='env') +SConscript('src/SConscript', exports='env') @@ -609,8 +609,8 @@ make no difference to the build. - SConscript(['src1/SConscript', - 'src2/SConscript'], exports='env') +SConscript(['src1/SConscript', + 'src2/SConscript'], exports='env') @@ -637,8 +637,8 @@ make no difference to the build. - Import('env') - env.Program('prog', ['prog.c']) +Import('env') +env.Program('prog', ['prog.c']) @@ -659,9 +659,9 @@ make no difference to the build. - Import('env', 'debug') - env = env.Clone(DEBUG = debug) - env.Program('prog', ['prog.c']) +Import('env', 'debug') +env = env.Clone(DEBUG = debug) +env.Program('prog', ['prog.c']) @@ -673,9 +673,9 @@ make no difference to the build. - Import('env debug') - env = env.Clone(DEBUG = debug) - env.Program('prog', ['prog.c']) +Import('env debug') +env = env.Clone(DEBUG = debug) +env.Program('prog', ['prog.c']) @@ -688,9 +688,9 @@ make no difference to the build. - Import('*') - env = env.Clone(DEBUG = debug) - env.Program('prog', ['prog.c']) +Import('*') +env = env.Clone(DEBUG = debug) +env.Program('prog', ['prog.c']) @@ -738,31 +738,31 @@ make no difference to the build. - env = Environment() - Export('env') - objs = [] - for subdir in ['foo', 'bar']: - o = SConscript('%s/SConscript' % subdir) - objs.append(o) - env.Library('prog', objs) +env = Environment() +Export('env') +objs = [] +for subdir in ['foo', 'bar']: + o = SConscript('%s/SConscript' % subdir) + objs.append(o) +env.Library('prog', objs) - Import('env') - obj = env.Object('foo.c') - Return('obj') +Import('env') +obj = env.Object('foo.c') +Return('obj') - Import('env') - obj = env.Object('bar.c') - Return('obj') +Import('env') +obj = env.Object('bar.c') +Return('obj') - void foo(void) { printf("foo/foo.c\n"); } +void foo(void) { printf("foo/foo.c\n"); } - void bar(void) { printf("bar/bar.c\n"); } +void bar(void) { printf("bar/bar.c\n"); } diff --git a/doc/user/install.xml b/doc/user/install.xml index 7c2f00ee..159b8866 100644 --- a/doc/user/install.xml +++ b/doc/user/install.xml @@ -58,12 +58,12 @@ - env = Environment() - hello = env.Program('hello.c') - env.Install('__ROOT__/usr/bin', hello) +env = Environment() +hello = env.Program('hello.c') +env.Install('__ROOT__/usr/bin', hello) - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -104,13 +104,13 @@ - env = Environment() - hello = env.Program('hello.c') - env.Install('__ROOT__/usr/bin', hello) - env.Alias('install', '__ROOT__/usr/bin') +env = Environment() +hello = env.Program('hello.c') +env.Install('__ROOT__/usr/bin', hello) +env.Alias('install', '__ROOT__/usr/bin') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -139,18 +139,18 @@ - env = Environment() - hello = env.Program('hello.c') - goodbye = env.Program('goodbye.c') - env.Install('__ROOT__/usr/bin', hello) - env.Install('__ROOT__/usr/bin', goodbye) - env.Alias('install', '__ROOT__/usr/bin') +env = Environment() +hello = env.Program('hello.c') +goodbye = env.Program('goodbye.c') +env.Install('__ROOT__/usr/bin', hello) +env.Install('__ROOT__/usr/bin', goodbye) +env.Alias('install', '__ROOT__/usr/bin') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int main() { printf("Goodbye, world!\n"); } +int main() { printf("Goodbye, world!\n"); } @@ -163,11 +163,11 @@ - env = Environment() - hello = env.Program('hello.c') - goodbye = env.Program('goodbye.c') - env.Install('__ROOT__/usr/bin', [hello, goodbye]) - env.Alias('install', '__ROOT__/usr/bin') +env = Environment() +hello = env.Program('hello.c') +goodbye = env.Program('goodbye.c') +env.Install('__ROOT__/usr/bin', [hello, goodbye]) +env.Alias('install', '__ROOT__/usr/bin') @@ -197,13 +197,13 @@ - env = Environment() - hello = env.Program('hello.c') - env.InstallAs('__ROOT__/usr/bin/hello-new', hello) - env.Alias('install', '__ROOT__/usr/bin') +env = Environment() +hello = env.Program('hello.c') +env.InstallAs('__ROOT__/usr/bin/hello-new', hello) +env.Alias('install', '__ROOT__/usr/bin') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -237,19 +237,19 @@ - env = Environment() - hello = env.Program('hello.c') - goodbye = env.Program('goodbye.c') - env.InstallAs(['__ROOT__/usr/bin/hello-new', - '__ROOT__/usr/bin/goodbye-new'], - [hello, goodbye]) - env.Alias('install', '__ROOT__/usr/bin') +env = Environment() +hello = env.Program('hello.c') +goodbye = env.Program('goodbye.c') +env.InstallAs(['__ROOT__/usr/bin/hello-new', + '__ROOT__/usr/bin/goodbye-new'], + [hello, goodbye]) +env.Alias('install', '__ROOT__/usr/bin') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int main() { printf("Goodbye, world!\n"); } +int main() { printf("Goodbye, world!\n"); } diff --git a/doc/user/java.xml b/doc/user/java.xml index 418faf6e..40a82a3f 100644 --- a/doc/user/java.xml +++ b/doc/user/java.xml @@ -80,34 +80,34 @@ - Java('classes', 'src') +Java('classes', 'src') - public class Example1 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example2 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example2 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example3 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} @@ -155,50 +155,50 @@ - Java('classes', 'src') +Java('classes', 'src') - public class Example1 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } - public class AdditionalClass1 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} +public class AdditionalClass1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example2 - { - class Inner2 { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } - } +public class Example2 +{ + class Inner2 { + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } + } +} - public class Example3 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } - public class AdditionalClass3 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} +public class AdditionalClass3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} @@ -253,7 +253,7 @@ - Java('classes', 'src', JAVAVERSION='1.6') +Java('classes', 'src', JAVAVERSION='1.6') @@ -280,35 +280,35 @@ - Java(target = 'classes', source = 'src') - Jar(target = 'test.jar', source = 'classes') +Java(target = 'classes', source = 'src') +Jar(target = 'test.jar', source = 'classes') - public class Example1 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example2 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example2 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example3 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} @@ -344,46 +344,46 @@ - prog1_class_files = Java(target = 'classes', source = 'prog1') - prog2_class_files = Java(target = 'classes', source = 'prog2') - Jar(target = 'prog1.jar', source = prog1_class_files) - Jar(target = 'prog2.jar', source = prog2_class_files) +prog1_class_files = Java(target = 'classes', source = 'prog1') +prog2_class_files = Java(target = 'classes', source = 'prog2') +Jar(target = 'prog1.jar', source = prog1_class_files) +Jar(target = 'prog2.jar', source = prog2_class_files) - public class Example1 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example2 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example2 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example3 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example3 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} - public class Example4 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example4 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} @@ -418,35 +418,35 @@ - classes = Java(target = 'classes', source = 'src/pkg/sub') - JavaH(target = 'native', source = classes) +classes = Java(target = 'classes', source = 'src/pkg/sub') +JavaH(target = 'native', source = classes) - package pkg.sub; - public class Example1 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} - package pkg.sub; - public class Example2 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} - package pkg.sub; - public class Example3 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example3 +{ + public static void main(String[] args) + { + } +} @@ -502,38 +502,38 @@ - Java(target = 'classes', source = 'src/pkg/sub') - class_file_list = ['classes/pkg/sub/Example1.class', - 'classes/pkg/sub/Example2.class', - 'classes/pkg/sub/Example3.class'] - JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes') +Java(target = 'classes', source = 'src/pkg/sub') +class_file_list = ['classes/pkg/sub/Example1.class', + 'classes/pkg/sub/Example2.class', + 'classes/pkg/sub/Example3.class'] +JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes') - package pkg.sub; - public class Example1 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} - package pkg.sub; - public class Example2 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} - package pkg.sub; - public class Example3 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example3 +{ + public static void main(String[] args) + { + } +} @@ -560,35 +560,35 @@ - classes = Java(target = 'classes', source = 'src/pkg/sub') - JavaH(target = File('native.h'), source = classes) +classes = Java(target = 'classes', source = 'src/pkg/sub') +JavaH(target = File('native.h'), source = classes) - package pkg.sub; - public class Example1 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} - package pkg.sub; - public class Example2 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} - package pkg.sub; - public class Example3 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example3 +{ + public static void main(String[] args) + { + } +} @@ -629,26 +629,26 @@ - classes = Java(target = 'classes', source = 'src/pkg/sub') - RMIC(target = 'outdir', source = classes) +classes = Java(target = 'classes', source = 'src/pkg/sub') +RMIC(target = 'outdir', source = classes) - package pkg.sub; - public class Example1 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example1 +{ + public static void main(String[] args) + { + } +} - package pkg.sub; - public class Example2 - { - public static void main(String[] args) - { - } - } +package pkg.sub; +public class Example2 +{ + public static void main(String[] args) + { + } +} diff --git a/doc/user/less-simple.xml b/doc/user/less-simple.xml index 53e64331..4c60cc71 100644 --- a/doc/user/less-simple.xml +++ b/doc/user/less-simple.xml @@ -72,7 +72,7 @@ - Program('hello.c') +Program('hello.c') @@ -86,10 +86,10 @@ - Program('new_hello', 'hello.c') +Program('new_hello', 'hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -147,16 +147,16 @@ - Program(['prog.c', 'file1.c', 'file2.c']) +Program(['prog.c', 'file1.c', 'file2.c']) - int main() { printf("prog.c\n"); } +int main() { printf("prog.c\n"); } - void file1() { printf("file1.c\n"); } +void file1() { printf("file1.c\n"); } - void file2() { printf("file2.c\n"); } +void file2() { printf("file2.c\n"); } @@ -194,16 +194,16 @@ - Program('program', ['prog.c', 'file1.c', 'file2.c']) +Program('program', ['prog.c', 'file1.c', 'file2.c']) - int main() { printf("prog.c\n"); } +int main() { printf("prog.c\n"); } - void file1() { printf("file1.c\n"); } +void file1() { printf("file1.c\n"); } - void file2() { printf("file2.c\n"); } +void file2() { printf("file2.c\n"); } @@ -247,7 +247,7 @@ - Program('program', Glob('*.c')) +Program('program', Glob('*.c')) @@ -275,7 +275,7 @@ - Program('hello', ['file1.c', 'file2.c']) +Program('hello', ['file1.c', 'file2.c']) @@ -285,7 +285,7 @@ - Program('hello', 'hello.c') +Program('hello', 'hello.c') @@ -296,7 +296,7 @@ - Program('hello', ['hello.c']) +Program('hello', ['hello.c']) @@ -324,9 +324,9 @@ - # The following two calls both work correctly: - Program('program1', 'program1.c') - Program('program2', ['program2.c']) +# The following two calls both work correctly: +Program('program1', 'program1.c') +Program('program2', ['program2.c']) @@ -383,7 +383,7 @@ - Program('program', Split('main.c file1.c file2.c')) +Program('program', Split('main.c file1.c file2.c')) @@ -417,8 +417,8 @@ - src_files = Split('main.c file1.c file2.c') - Program('program', src_files) +src_files = Split('main.c file1.c file2.c') +Program('program', src_files) @@ -433,10 +433,10 @@ - src_files = Split("""main.c - file1.c - file2.c""") - Program('program', src_files) +src_files = Split("""main.c + file1.c + file2.c""") +Program('program', src_files) @@ -469,8 +469,8 @@ - src_files = Split('main.c file1.c file2.c') - Program(target = 'program', source = src_files) +src_files = Split('main.c file1.c file2.c') +Program(target = 'program', source = src_files) @@ -482,8 +482,8 @@ - src_files = Split('main.c file1.c file2.c') - Program(source = src_files, target = 'program') +src_files = Split('main.c file1.c file2.c') +Program(source = src_files, target = 'program') @@ -514,17 +514,17 @@ - Program('foo.c') - Program('bar', ['bar1.c', 'bar2.c']) +Program('foo.c') +Program('bar', ['bar1.c', 'bar2.c']) - int main() { printf("foo.c\n"); } +int main() { printf("foo.c\n"); } - int main() { printf("bar1.c\n"); } +int main() { printf("bar1.c\n"); } - void bar2() { printf("bar2.c\n"); } +void bar2() { printf("bar2.c\n"); } @@ -579,23 +579,23 @@ - Program(Split('foo.c common1.c common2.c')) - Program('bar', Split('bar1.c bar2.c common1.c common2.c')) +Program(Split('foo.c common1.c common2.c')) +Program('bar', Split('bar1.c bar2.c common1.c common2.c')) - int main() { printf("foo.c\n"); } +int main() { printf("foo.c\n"); } - int main() { printf("bar1.c\n"); } +int main() { printf("bar1.c\n"); } - int bar2() { printf("bar2.c\n"); } +int bar2() { printf("bar2.c\n"); } - void common1() { printf("common1.c\n"); } +void common1() { printf("common1.c\n"); } - void common22() { printf("common2.c\n"); } +void common22() { printf("common2.c\n"); } @@ -628,11 +628,11 @@ - common = ['common1.c', 'common2.c'] - foo_files = ['foo.c'] + common - bar_files = ['bar1.c', 'bar2.c'] + common - Program('foo', foo_files) - Program('bar', bar_files) +common = ['common1.c', 'common2.c'] +foo_files = ['foo.c'] + common +bar_files = ['bar1.c', 'bar2.c'] + common +Program('foo', foo_files) +Program('bar', bar_files) diff --git a/doc/user/libraries.xml b/doc/user/libraries.xml index 1b43a480..63d4544c 100644 --- a/doc/user/libraries.xml +++ b/doc/user/libraries.xml @@ -65,16 +65,16 @@ - Library('foo', ['f1.c', 'f2.c', 'f3.c']) +Library('foo', ['f1.c', 'f2.c', 'f3.c']) - void f1() { printf("f1.c\n"); } +void f1() { printf("f1.c\n"); } - void f2() { printf("f2.c\n"); } +void f2() { printf("f2.c\n"); } - void f3() { printf("f3.c\n"); } +void f3() { printf("f3.c\n"); } @@ -131,19 +131,19 @@ - Library('foo', ['f1.c', 'f2.o', 'f3.c', 'f4.o']) +Library('foo', ['f1.c', 'f2.o', 'f3.c', 'f4.o']) - void f1() { printf("f1.c\n"); } +void f1() { printf("f1.c\n"); } - object file +object file - void f3() { printf("f3.c\n"); } +void f3() { printf("f3.c\n"); } - object file +object file @@ -186,7 +186,7 @@ - StaticLibrary('foo', ['f1.c', 'f2.c', 'f3.c']) +StaticLibrary('foo', ['f1.c', 'f2.c', 'f3.c']) @@ -212,16 +212,16 @@ - SharedLibrary('foo', ['f1.c', 'f2.c', 'f3.c']) +SharedLibrary('foo', ['f1.c', 'f2.c', 'f3.c']) - void f1() { printf("f1.c\n"); } +void f1() { printf("f1.c\n"); } - void f2() { printf("f2.c\n"); } +void f2() { printf("f2.c\n"); } - void f3() { printf("f3.c\n"); } +void f3() { printf("f3.c\n"); } @@ -280,20 +280,20 @@ - Library('foo', ['f1.c', 'f2.c', 'f3.c']) - Program('prog.c', LIBS=['foo', 'bar'], LIBPATH='.') +Library('foo', ['f1.c', 'f2.c', 'f3.c']) +Program('prog.c', LIBS=['foo', 'bar'], LIBPATH='.') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -347,7 +347,7 @@ - Program('prog.c', LIBS='foo', LIBPATH='.') +Program('prog.c', LIBS='foo', LIBPATH='.') @@ -357,7 +357,7 @@ - Program('prog.c', LIBS=['foo'], LIBPATH='.') +Program('prog.c', LIBS=['foo'], LIBPATH='.') @@ -387,11 +387,11 @@ - Program('prog.c', LIBS = 'm', - LIBPATH = ['/usr/lib', '/usr/local/lib']) +Program('prog.c', LIBS = 'm', + LIBPATH = ['/usr/lib', '/usr/local/lib']) - int main() { printf("prog.c\n"); } +int main() { printf("prog.c\n"); } @@ -406,7 +406,7 @@ - LIBPATH = '/usr/lib:/usr/local/lib' +LIBPATH = '/usr/lib:/usr/local/lib' @@ -416,7 +416,7 @@ - LIBPATH = 'C:\\lib;D:\\lib' +LIBPATH = 'C:\\lib;D:\\lib' diff --git a/doc/user/mergeflags.xml b/doc/user/mergeflags.xml index 393cfbc6..1143ee98 100644 --- a/doc/user/mergeflags.xml +++ b/doc/user/mergeflags.xml @@ -73,11 +73,11 @@ - env = Environment() - env.Append(CCFLAGS = '-option -O3 -O1') - flags = { 'CCFLAGS' : '-whatever -O3' } - env.MergeFlags(flags) - print env['CCFLAGS'] +env = Environment() +env.Append(CCFLAGS = '-option -O3 -O1') +flags = { 'CCFLAGS' : '-whatever -O3' } +env.MergeFlags(flags) +print env['CCFLAGS'] @@ -100,11 +100,11 @@ - env = Environment() - env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include']) - flags = { 'CPPPATH' : ['/usr/opt/include', '/usr/local/include'] } - env.MergeFlags(flags) - print env['CPPPATH'] +env = Environment() +env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include']) +flags = { 'CPPPATH' : ['/usr/opt/include', '/usr/local/include'] } +env.MergeFlags(flags) +print env['CPPPATH'] @@ -134,12 +134,12 @@ - env = Environment() - env.Append(CCFLAGS = '-option -O3 -O1') - env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include']) - env.MergeFlags('-whatever -I/usr/opt/include -O3 -I/usr/local/include') - print env['CCFLAGS'] - print env['CPPPATH'] +env = Environment() +env.Append(CCFLAGS = '-option -O3 -O1') +env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include']) +env.MergeFlags('-whatever -I/usr/opt/include -O3 -I/usr/local/include') +print env['CCFLAGS'] +print env['CPPPATH'] diff --git a/doc/user/misc.xml b/doc/user/misc.xml index 37393027..4145d49e 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -91,14 +91,14 @@ - EnsurePythonVersion(2, 5) +EnsurePythonVersion(2, 5) --> - EnsurePythonVersion(2, 5) +EnsurePythonVersion(2, 5) @@ -122,8 +122,8 @@ --> - % scons -Q - Python 2.5 or greater required, but you have Python 2.3.6 +% scons -Q +Python 2.5 or greater required, but you have Python 2.3.6 @@ -160,14 +160,14 @@ - EnsureSConsVersion(1, 0) +EnsureSConsVersion(1, 0) --> - EnsureSConsVersion(1, 0) +EnsureSConsVersion(1, 0) @@ -191,8 +191,8 @@ --> - % scons -Q - SCons 1.0 or greater required, but you have SCons 0.98.5 +% scons -Q +SCons 1.0 or greater required, but you have SCons 0.98.5 @@ -212,14 +212,14 @@ - if ARGUMENTS.get('FUTURE'): - print "The FUTURE option is not supported yet!" - Exit(2) - env = Environment() - env.Program('hello.c') +if ARGUMENTS.get('FUTURE'): + print "The FUTURE option is not supported yet!" + Exit(2) +env = Environment() +env.Program('hello.c') - hello.c +hello.c @@ -268,13 +268,13 @@ - # one directory - print FindFile('missing', '.') - t = FindFile('exists', '.') - print t.__class__, t +# one directory +print FindFile('missing', '.') +t = FindFile('exists', '.') +print t.__class__, t - exists + exists @@ -284,23 +284,23 @@ - # several directories - includes = [ '.', 'include', 'src/include'] - headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h'] - for hdr in headers: - print '%-12s' % ('%s:' % hdr), FindFile(hdr, includes) +# several directories +includes = [ '.', 'include', 'src/include'] +headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h'] +for hdr in headers: + print '%-12s' % ('%s:' % hdr), FindFile(hdr, includes) - exists +exists - exists +exists - exists +exists @@ -318,23 +318,23 @@ - # several directories - includes = [ '.', 'include', 'src/include'] - headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h'] - print FindFile(headers, includes) +# several directories +includes = [ '.', 'include', 'src/include'] +headers = [ 'nonesuch.h', 'config.h', 'private.h', 'dist.h'] +print FindFile(headers, includes) - exists +exists - exists +exists - exists +exists @@ -351,21 +351,21 @@ - print FindFile('multiple', ['sub1', 'sub2', 'sub3']) - print FindFile('multiple', ['sub2', 'sub3', 'sub1']) - print FindFile('multiple', ['sub3', 'sub1', 'sub2']) +print FindFile('multiple', ['sub1', 'sub2', 'sub3']) +print FindFile('multiple', ['sub2', 'sub3', 'sub1']) +print FindFile('multiple', ['sub3', 'sub1', 'sub2']) - exists +exists - exists +exists - exists +exists @@ -385,10 +385,10 @@ - # Neither file exists, so build will fail - Command('derived', 'leaf', 'cat >$TARGET $SOURCE') - print FindFile('leaf', '.') - print FindFile('derived', '.') +# Neither file exists, so build will fail +Command('derived', 'leaf', 'cat >$TARGET $SOURCE') +print FindFile('leaf', '.') +print FindFile('derived', '.') @@ -398,13 +398,13 @@ - # Only 'leaf' exists - Command('derived', 'leaf', 'cat >$TARGET $SOURCE') - print FindFile('leaf', '.') - print FindFile('derived', '.') +# Only 'leaf' exists +Command('derived', 'leaf', 'cat >$TARGET $SOURCE') +print FindFile('leaf', '.') +print FindFile('derived', '.') - leaf +leaf @@ -421,13 +421,13 @@ - # Only 'src/leaf' exists - VariantDir('build', 'src') - print FindFile('leaf', 'build') +# Only 'src/leaf' exists +VariantDir('build', 'src') +print FindFile('leaf', 'build') - leaf +leaf @@ -460,17 +460,17 @@ - objects = [ - Object('prog1.c'), - Object('prog2.c', CCFLAGS='-DFOO'), - ] - Program(objects) +objects = [ + Object('prog1.c'), + Object('prog2.c', CCFLAGS='-DFOO'), +] +Program(objects) - prog1.c +prog1.c - prog2.c +prog2.c @@ -570,12 +570,12 @@ --> - % scons -Q - /home/me/project/prog1.o - /home/me/project/prog2.o - cc -o prog1.o -c prog1.c - cc -o prog2.o -c -DFOO prog2.c - cc -o prog1 prog1.o prog2.o +% scons -Q +/home/me/project/prog1.o +/home/me/project/prog2.o +cc -o prog1.o -c prog1.c +cc -o prog2.o -c -DFOO prog2.c +cc -o prog1 prog1.o prog2.o @@ -592,12 +592,12 @@ - env = Environment( - LAUNCHDIR = GetLaunchDir(), - ) - env.Command('directory_build_info', - '$LAUNCHDIR/build_info' - Copy('$TARGET', '$SOURCE')) +env = Environment( + LAUNCHDIR = GetLaunchDir(), +) +env.Command('directory_build_info', + '$LAUNCHDIR/build_info' + Copy('$TARGET', '$SOURCE')) diff --git a/doc/user/nodes.xml b/doc/user/nodes.xml index 9b5a7d6b..78f15e32 100644 --- a/doc/user/nodes.xml +++ b/doc/user/nodes.xml @@ -80,8 +80,8 @@ - Object('hello.c', CCFLAGS='-DHELLO') - Object('goodbye.c', CCFLAGS='-DGOODBYE') +Object('hello.c', CCFLAGS='-DHELLO') +Object('goodbye.c', CCFLAGS='-DGOODBYE') @@ -95,9 +95,9 @@ - Object('hello.c', CCFLAGS='-DHELLO') - Object('goodbye.c', CCFLAGS='-DGOODBYE') - Program(['hello.o', 'goodbye.o']) +Object('hello.c', CCFLAGS='-DHELLO') +Object('goodbye.c', CCFLAGS='-DGOODBYE') +Program(['hello.o', 'goodbye.o']) @@ -123,15 +123,15 @@ - hello_list = Object('hello.c', CCFLAGS='-DHELLO') - goodbye_list = Object('goodbye.c', CCFLAGS='-DGOODBYE') - Program(hello_list + goodbye_list) +hello_list = Object('hello.c', CCFLAGS='-DHELLO') +goodbye_list = Object('goodbye.c', CCFLAGS='-DGOODBYE') +Program(hello_list + goodbye_list) - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int main() { printf("Goodbye, world!\n"); } +int main() { printf("Goodbye, world!\n"); } @@ -229,7 +229,7 @@ - xyzzy = Entry('xyzzy') +xyzzy = Entry('xyzzy') @@ -263,13 +263,13 @@ - object_list = Object('hello.c') - program_list = Program(object_list) - print "The object file is:", object_list[0] - print "The program file is:", program_list[0] +object_list = Object('hello.c') +program_list = Program(object_list) +print "The object file is:", object_list[0] +print "The program file is:", program_list[0] - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -330,14 +330,14 @@ - import os.path - program_list = Program('hello.c') - program_name = str(program_list[0]) - if not os.path.exists(program_name): - print program_name, "does not exist!" +import os.path +program_list = Program('hello.c') +program_name = str(program_list[0]) +if not os.path.exists(program_name): + print program_name, "does not exist!" - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -372,9 +372,9 @@ - env=Environment(VAR="value") - n=File("foo.c") - print env.GetBuildPath([n, "sub/dir/$VAR"]) +env=Environment(VAR="value") +n=File("foo.c") +print env.GetBuildPath([n, "sub/dir/$VAR"]) @@ -412,13 +412,13 @@ - hello_c = File('hello.c') - contents = hello_c.read() - print "contents are:" - print contents +hello_c = File('hello.c') +contents = hello_c.read() +print "contents are:" +print contents - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } diff --git a/doc/user/output.xml b/doc/user/output.xml index d601e720..de6b8d4d 100644 --- a/doc/user/output.xml +++ b/doc/user/output.xml @@ -74,10 +74,10 @@ - Help(""" - Type: 'scons program' to build the production program, - 'scons debug' to build the debug version. - """) +Help(""" +Type: 'scons program' to build the production program, + 'scons debug' to build the debug version. +""") @@ -214,12 +214,12 @@ - env = Environment(CCCOMSTR = "Compiling $TARGET", - LINKCOMSTR = "Linking $TARGET") - env.Program('foo.c') +env = Environment(CCCOMSTR = "Compiling $TARGET", + LINKCOMSTR = "Linking $TARGET") +env.Program('foo.c') - foo.c +foo.c @@ -238,9 +238,9 @@ --> - % scons -Q - Compiling foo.o - Linking foo +% scons -Q +Compiling foo.o +Linking foo @@ -286,14 +286,14 @@ - env = Environment() - if ARGUMENTS.get('VERBOSE') != "1': - env['CCCOMSTR'] = "Compiling $TARGET" - env['LINKCOMSTR'] = "Linking $TARGET" - env.Program('foo.c') +env = Environment() +if ARGUMENTS.get('VERBOSE') != "1': + env['CCCOMSTR'] = "Compiling $TARGET" + env['LINKCOMSTR'] = "Linking $TARGET" +env.Program('foo.c') - foo.c +foo.c @@ -322,15 +322,15 @@ --> - % scons -Q - Compiling foo.o - Linking foo - % scons -Q -c - Removed foo.o - Removed foo - % scons -Q VERBOSE=1 - cc -o foo.o -c foo.c - cc -o foo foo.o +% scons -Q +Compiling foo.o +Linking foo +% scons -Q -c +Removed foo.o +Removed foo +% scons -Q VERBOSE=1 +cc -o foo.o -c foo.c +cc -o foo foo.o @@ -372,15 +372,15 @@ - Progress('Evaluating $TARGET\n') - Program('f1.c') - Program('f2.c') +Progress('Evaluating $TARGET\n') +Program('f1.c') +Program('f2.c') - f1.c +f1.c - f2.c +f2.c @@ -425,11 +425,11 @@ - Progress('$TARGET\r', - file=open('/dev/tty', 'w'), - overwrite=True) - Program('f1.c') - Program('f2.c') +Progress('$TARGET\r', + file=open('/dev/tty', 'w'), + overwrite=True) +Program('f1.c') +Program('f2.c') @@ -482,9 +482,9 @@ - Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) - Program('f1.c') - Program('f2.c') +Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) +Program('f1.c') +Program('f2.c') diff --git a/doc/user/parseconfig.xml b/doc/user/parseconfig.xml index cf3531bb..6125812d 100644 --- a/doc/user/parseconfig.xml +++ b/doc/user/parseconfig.xml @@ -84,10 +84,10 @@ - env = Environment() - env['CPPPATH'] = ['/lib/compat'] - env.ParseConfig("pkg-config x11 --cflags --libs") - print env['CPPPATH'] +env = Environment() +env['CPPPATH'] = ['/lib/compat'] +env.ParseConfig("pkg-config x11 --cflags --libs") +print env['CPPPATH'] @@ -111,9 +111,9 @@ --> - % scons -Q - ['/lib/compat', '/usr/X11/include'] - scons: `.' is up to date. +% scons -Q +['/lib/compat', '/usr/X11/include'] +scons: `.' is up to date. @@ -136,10 +136,10 @@ - env = Environment() - env.ParseConfig("pkg-config x11 --cflags --libs") - env.ParseConfig("pkg-config x11 --cflags --libs") - print env['CPPPATH'] +env = Environment() +env.ParseConfig("pkg-config x11 --cflags --libs") +env.ParseConfig("pkg-config x11 --cflags --libs") +print env['CPPPATH'] @@ -155,9 +155,9 @@ --> - % scons -Q - ['/usr/X11/include'] - scons: `.' is up to date. +% scons -Q +['/usr/X11/include'] +scons: `.' is up to date. diff --git a/doc/user/parseflags.xml b/doc/user/parseflags.xml index d20df80e..a3462a52 100644 --- a/doc/user/parseflags.xml +++ b/doc/user/parseflags.xml @@ -80,16 +80,16 @@ - env = Environment() - d = env.ParseFlags("-I/opt/include -L/opt/lib -lfoo") - for k,v in sorted(d.items()): - if v: - print k, v - env.MergeFlags(d) - env.Program('f1.c') +env = Environment() +d = env.ParseFlags("-I/opt/include -L/opt/lib -lfoo") +for k,v in sorted(d.items()): + if v: + print k, v +env.MergeFlags(d) +env.Program('f1.c') - int main() { return 0; } +int main() { return 0; } @@ -119,16 +119,16 @@ - env = Environment() - d = env.ParseFlags("-whatever") - for k,v in sorted(d.items()): - if v: - print k, v - env.MergeFlags(d) - env.Program('f1.c') +env = Environment() +d = env.ParseFlags("-whatever") +for k,v in sorted(d.items()): + if v: + print k, v +env.MergeFlags(d) +env.Program('f1.c') - int main() { return 0; } + int main() { return 0; } @@ -145,16 +145,16 @@ - env = Environment() - d = env.ParseFlags(["-I/opt/include", ["-L/opt/lib", "-lfoo"]]) - for k,v in sorted(d.items()): - if v: - print k, v - env.MergeFlags(d) - env.Program('f1.c') +env = Environment() +d = env.ParseFlags(["-I/opt/include", ["-L/opt/lib", "-lfoo"]]) +for k,v in sorted(d.items()): + if v: + print k, v +env.MergeFlags(d) +env.Program('f1.c') - int main() { return 0; } +int main() { return 0; } @@ -172,16 +172,16 @@ - env = Environment() - d = env.ParseFlags(["!echo -I/opt/include", "!echo -L/opt/lib", "-lfoo"]) - for k,v in sorted(d.items()): - if v: - print k, v - env.MergeFlags(d) - env.Program('f1.c') +env = Environment() +d = env.ParseFlags(["!echo -I/opt/include", "!echo -L/opt/lib", "-lfoo"]) +for k,v in sorted(d.items()): + if v: + print k, v +env.MergeFlags(d) +env.Program('f1.c') - int main() { return 0; } +int main() { return 0; } diff --git a/doc/user/repositories.xml b/doc/user/repositories.xml index 8e8ba4eb..4ff8b931 100644 --- a/doc/user/repositories.xml +++ b/doc/user/repositories.xml @@ -96,12 +96,12 @@ - env = Environment() - env.Program('hello.c') - Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2') +env = Environment() +env.Program('hello.c') +Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -165,12 +165,12 @@ - env = Environment() - env.Program('hello.c') - Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2') +env = Environment() +env.Program('hello.c') +Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -188,12 +188,12 @@ - env = Environment() - env.Program('hello.c') - Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2') +env = Environment() +env.Program('hello.c') +Repository('__ROOT__/usr/repository1', '__ROOT__/usr/repository2') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -238,9 +238,9 @@ - % scons -Q - cc -o hello.o -c hello.c - hello.c:1: hello.h: No such file or directory +% scons -Q +cc -o hello.o -c hello.c +hello.c:1: hello.h: No such file or directory @@ -256,12 +256,12 @@ - env = Environment(CPPPATH = ['.']) - env.Program('hello.c') - Repository('__ROOT__/usr/repository1') +env = Environment(CPPPATH = ['.']) +env.Program('hello.c') +Repository('__ROOT__/usr/repository1') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -292,12 +292,12 @@ - env = Environment(CPPPATH = ['dir1', 'dir2', 'dir3']) - env.Program('hello.c') - Repository('__ROOT__/r1', '__ROOT__/r2') +env = Environment(CPPPATH = ['dir1', 'dir2', 'dir3']) +env.Program('hello.c') +Repository('__ROOT__/r1', '__ROOT__/r2') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -355,13 +355,13 @@ coming into existence.) - #include "hello.h" - int - main(int argc, char *argv[]) - { - printf(HELLO_MESSAGE); - return (0); - } +#include "hello.h" +int +main(int argc, char *argv[]) +{ + printf(HELLO_MESSAGE); + return (0); +} @@ -376,12 +376,12 @@ coming into existence.) - env = Environment(CPPPATH = ['.']) - env.Program('hello.c') - Repository('__ROOT__/usr/repository1') +env = Environment(CPPPATH = ['.']) +env.Program('hello.c') +Repository('__ROOT__/usr/repository1') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -471,7 +471,7 @@ coming into existence.) - % scons -Q -Y /usr/repository1 -Y /usr/repository2 +% scons -Q -Y /usr/repository1 -Y /usr/repository2 @@ -515,18 +515,18 @@ coming into existence.) - env = Environment() - env.Program(['hello.c', 'file1.c', 'file2.c']) - Repository('/usr/repository1', '/usr/repository2') +env = Environment() +env.Program(['hello.c', 'file1.c', 'file2.c']) +Repository('/usr/repository1', '/usr/repository2') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int f1() { printf("file1\n"); } +int f1() { printf("file1\n"); } - int f2() { printf("file2.c\n"); } +int f2() { printf("file2.c\n"); } @@ -563,11 +563,11 @@ coming into existence.) --> - % cd $HOME/build - % edit hello.c - % scons -Q -Y /usr/repository1 - cc -c -o hello.o hello.c - cc -o hello hello.o /usr/repository1/file1.o /usr/repository1/file2.o +% cd $HOME/build +% edit hello.c +% scons -Q -Y /usr/repository1 +cc -c -o hello.o hello.c +cc -o hello hello.o /usr/repository1/file1.o /usr/repository1/file2.o @@ -594,10 +594,10 @@ coming into existence.) - % mkdir $HOME/build2 - % cd $HOME/build2 - % scons -Q -Y /usr/all/repository hello - scons: `hello' is up-to-date. +% mkdir $HOME/build2 +% cd $HOME/build2 +% scons -Q -Y /usr/all/repository hello +scons: `hello' is up-to-date. @@ -627,12 +627,12 @@ coming into existence.) - env = Environment() - hello = env.Program('hello.c') - Local(hello) +env = Environment() +hello = env.Program('hello.c') +Local(hello) - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -646,9 +646,9 @@ coming into existence.) - % scons -Y /usr/all/repository hello - Local copy of hello from /usr/all/repository/hello - scons: `hello' is up-to-date. +% scons -Y /usr/all/repository hello +Local copy of hello from /usr/all/repository/hello +scons: `hello' is up-to-date. diff --git a/doc/user/scanners.xml b/doc/user/scanners.xml index 46b2a9f1..5ed0d625 100644 --- a/doc/user/scanners.xml +++ b/doc/user/scanners.xml @@ -172,7 +172,7 @@ over the file scanning rather than being called for each input line: - include filename.foo +include filename.foo @@ -186,13 +186,13 @@ over the file scanning rather than being called for each input line: - import re - - include_re = re.compile(r'^include\s+(\S+)$', re.M) - - def kfile_scan(node, env, path, arg): - contents = node.get_text_contents() - return env.File(include_re.findall(contents)) +import re + +include_re = re.compile(r'^include\s+(\S+)$', re.M) + +def kfile_scan(node, env, path, arg): + contents = node.get_text_contents() + return env.File(include_re.findall(contents)) @@ -295,9 +295,9 @@ over the file scanning rather than being called for each input line: - kscan = Scanner(function = kfile_scan, - skeys = ['.k']) - env.Append(SCANNERS = kscan) +kscan = Scanner(function = kfile_scan, + skeys = ['.k']) +env.Append(SCANNERS = kscan) @@ -393,9 +393,9 @@ over the file scanning rather than being called for each input line: - kscan = Scanner(function = kfile_scan, - skeys = ['.k'], - path=FindPathDirs('KPATH')) +kscan = Scanner(function = kfile_scan, + skeys = ['.k'], + path=FindPathDirs('KPATH')) diff --git a/doc/user/sconf.xml b/doc/user/sconf.xml index 92fb4548..e787db96 100644 --- a/doc/user/sconf.xml +++ b/doc/user/sconf.xml @@ -80,10 +80,10 @@ - env = Environment() - conf = Configure(env) - # Checks for libraries, header files, etc. go here! - env = conf.Finish() +env = Environment() +conf = Configure(env) +# Checks for libraries, header files, etc. go here! +env = conf.Finish() @@ -131,14 +131,14 @@ - env = Environment() - conf = Configure(env) - if not conf.CheckCHeader('math.h'): - print 'Math.h must be installed!' - Exit(1) - if conf.CheckCHeader('foo.h'): - conf.env.Append('-DHAS_FOO_H') - env = conf.Finish() +env = Environment() +conf = Configure(env) +if not conf.CheckCHeader('math.h'): + print 'Math.h must be installed!' + Exit(1) +if conf.CheckCHeader('foo.h'): + conf.env.Append('-DHAS_FOO_H') +env = conf.Finish() @@ -159,12 +159,12 @@ - env = Environment() - conf = Configure(env) - if not conf.CheckCXXHeader('vector.h'): - print 'vector.h must be installed!' - Exit(1) - env = conf.Finish() +env = Environment() +conf = Configure(env) +if not conf.CheckCXXHeader('vector.h'): + print 'vector.h must be installed!' + Exit(1) +env = conf.Finish() @@ -180,12 +180,12 @@ - env = Environment() - conf = Configure(env) - if not conf.CheckFunc('strcpy'): - print 'Did not find strcpy(), using local version' - conf.env.Append(CPPDEFINES = '-Dstrcpy=my_local_strcpy') - env = conf.Finish() +env = Environment() +conf = Configure(env) +if not conf.CheckFunc('strcpy'): + print 'Did not find strcpy(), using local version' + conf.env.Append(CPPDEFINES = '-Dstrcpy=my_local_strcpy') +env = conf.Finish() @@ -204,12 +204,12 @@ - env = Environment() - conf = Configure(env) - if not conf.CheckLib('m'): - print 'Did not find libm.a or m.lib, exiting!' - Exit(1) - env = conf.Finish() +env = Environment() +conf = Configure(env) +if not conf.CheckLib('m'): + print 'Did not find libm.a or m.lib, exiting!' + Exit(1) +env = conf.Finish() @@ -225,12 +225,12 @@ - env = Environment() - conf = Configure(env) - if not conf.CheckLibWithHeader('m', 'math.h', 'c'): - print 'Did not find libm.a or m.lib, exiting!' - Exit(1) - env = conf.Finish() +env = Environment() +conf = Configure(env) +if not conf.CheckLibWithHeader('m', 'math.h', 'c'): + print 'Did not find libm.a or m.lib, exiting!' + Exit(1) +env = conf.Finish() @@ -254,12 +254,12 @@ - env = Environment() - conf = Configure(env) - if not conf.CheckType('off_t'): - print 'Did not find off_t typedef, assuming int' - conf.env.Append(CCFLAGS = '-Doff_t=int') - env = conf.Finish() +env = Environment() +conf = Configure(env) +if not conf.CheckType('off_t'): + print 'Did not find off_t typedef, assuming int' + conf.env.Append(CCFLAGS = '-Doff_t=int') +env = conf.Finish() @@ -273,12 +273,12 @@ - env = Environment() - conf = Configure(env) - if not conf.CheckType('off_t', '#include &lt;sys/types.h&gt;\n'): - print 'Did not find off_t typedef, assuming int' - conf.env.Append(CCFLAGS = '-Doff_t=int') - env = conf.Finish() +env = Environment() +conf = Configure(env) +if not conf.CheckType('off_t', '#include &lt;sys/types.h&gt;\n'): + print 'Did not find off_t typedef, assuming int' + conf.env.Append(CCFLAGS = '-Doff_t=int') +env = conf.Finish() @@ -358,8 +358,8 @@ - env = Environment() - conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary}) +env = Environment() +conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary}) @@ -414,10 +414,10 @@ - % scons - scons: Reading SConscript file ... - Checking for MyLibrary... failed - MyLibrary is not installed! +% scons +scons: Reading SConscript file ... +Checking for MyLibrary... failed +MyLibrary is not installed! @@ -428,14 +428,14 @@ - % scons - scons: Reading SConscript file ... - Checking for MyLibrary... failed - scons: done reading SConscript - scons: Building targets ... - . - . - . +% scons +scons: Reading SConscript file ... +Checking for MyLibrary... failed +scons: done reading SConscript +scons: Building targets ... + . + . + . @@ -455,10 +455,10 @@ - % scons -Q -c - Checking for MyLibrary... yes - Removed foo.o - Removed foo +% scons -Q -c +Checking for MyLibrary... yes +Removed foo.o +Removed foo @@ -474,19 +474,19 @@ - env = Environment() - if not env.GetOption('clean'): - conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary}) - if not conf.CheckMyLibrary(): - print 'MyLibrary is not installed!' - Exit(1) - env = conf.Finish() +env = Environment() +if not env.GetOption('clean'): + conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary}) + if not conf.CheckMyLibrary(): + print 'MyLibrary is not installed!' + Exit(1) + env = conf.Finish() - % scons -Q -c - Removed foo.o - Removed foo +% scons -Q -c +Removed foo.o +Removed foo diff --git a/doc/user/separate.xml b/doc/user/separate.xml index dfe83f65..0a2e0dbe 100644 --- a/doc/user/separate.xml +++ b/doc/user/separate.xml @@ -174,14 +174,14 @@ program using the F path name. - SConscript('src/SConscript', variant_dir='build') +SConscript('src/SConscript', variant_dir='build') - env = Environment() - env.Program('hello.c') +env = Environment() +env.Program('hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -267,7 +267,7 @@ program using the F path name. - #include "file.h" +#include "file.h" @@ -320,7 +320,7 @@ program using the F path name. - SConscript('src/SConscript', variant_dir='build', duplicate=0) +SConscript('src/SConscript', variant_dir='build', duplicate=0) @@ -334,15 +334,15 @@ program using the F path name. - % ls src - SConscript - hello.c - % scons -Q - cc -c src/hello.c -o build/hello.o - cc -o build/hello build/hello.o - % ls build - hello - hello.o +% ls src +SConscript +hello.c +% scons -Q +cc -c src/hello.c -o build/hello.o +cc -o build/hello build/hello.o +% ls build +hello +hello.o @@ -360,12 +360,12 @@ program using the F path name. - VariantDir('build', 'src') - env = Environment() - env.Program('build/hello.c') +VariantDir('build', 'src') +env = Environment() +env.Program('build/hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -404,12 +404,12 @@ program using the F path name. - VariantDir('build', 'src', duplicate=0) - env = Environment() - env.Program('build/hello.c') +VariantDir('build', 'src', duplicate=0) +env = Environment() +env.Program('build/hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -444,15 +444,15 @@ program using the F path name. - VariantDir('build', 'src') - SConscript('build/SConscript') +VariantDir('build', 'src') +SConscript('build/SConscript') - env = Environment() - env.Program('hello.c') +env = Environment() +env.Program('hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -502,22 +502,22 @@ program using the F path name. - VariantDir('build', 'src') - SConscript('build/SConscript') +VariantDir('build', 'src') +SConscript('build/SConscript') - env = Environment() - env.Program('hello', Glob('*.c')) +env = Environment() +env.Program('hello', Glob('*.c')) - #include "f2.h" - int main() { printf(f2()); } +#include "f2.h" +int main() { printf(f2()); } - const char * f2() { return("Hello, world!\n"); } +const char * f2() { return("Hello, world!\n"); } - const char * f2(); +const char * f2(); diff --git a/doc/user/sideeffect.xml b/doc/user/sideeffect.xml index c0c7ecab..cf959af3 100644 --- a/doc/user/sideeffect.xml +++ b/doc/user/sideeffect.xml @@ -77,12 +77,12 @@ - env = Environment() - f2 = env.Command('file2', 'log', Copy('$TARGET', '$SOURCE')) - f1 = env.Command('file1', [], - 'echo >$TARGET data1; echo >log updated file1')) - env.SideEffect('log', env.Command('file1', [], - 'echo >$TARGET data1; echo >log updated file1')) +env = Environment() +f2 = env.Command('file2', 'log', Copy('$TARGET', '$SOURCE')) +f1 = env.Command('file1', [], + 'echo >$TARGET data1; echo >log updated file1')) +env.SideEffect('log', env.Command('file1', [], + 'echo >$TARGET data1; echo >log updated file1')) @@ -114,11 +114,11 @@ - env = Environment() - env.Command('file1.out', 'file.in', - './build --log logfile.txt $SOURCE $TARGET') - env.Command('file2.out', 'file.in', - './build --log logfile.txt $SOURCE $TARGET') +env = Environment() +env.Command('file1.out', 'file.in', + './build --log logfile.txt $SOURCE $TARGET') +env.Command('file2.out', 'file.in', + './build --log logfile.txt $SOURCE $TARGET') @@ -155,17 +155,17 @@ - env = Environment() - f1 = env.Command('file1.out', 'file1.in', - './build --log logfile.txt $SOURCE $TARGET') - f2 = env.Command('file2.out', 'file2.in', - './build --log logfile.txt $SOURCE $TARGET') - env.SideEffect('logfile.txt', f1 + f2) +env = Environment() +f1 = env.Command('file1.out', 'file1.in', + './build --log logfile.txt $SOURCE $TARGET') +f2 = env.Command('file2.out', 'file2.in', + './build --log logfile.txt $SOURCE $TARGET') +env.SideEffect('logfile.txt', f1 + f2) file1.in file2.in - cat +cat @@ -199,11 +199,11 @@ - env = Environment() - f1 = env.Command('file1.out', [], 'echo >$TARGET data1') - env.SideEffect('not_really_updated', f1) - f2 = env.Command('file2.out', [], 'echo >$TARGET data2') - env.SideEffect('not_really_updated', f2) +env = Environment() +f1 = env.Command('file1.out', [], 'echo >$TARGET data1') +env.SideEffect('not_really_updated', f1) +f2 = env.Command('file2.out', [], 'echo >$TARGET data2') +env.SideEffect('not_really_updated', f2) diff --git a/doc/user/simple.xml b/doc/user/simple.xml index 0e67e1ee..33b9e279 100644 --- a/doc/user/simple.xml +++ b/doc/user/simple.xml @@ -66,11 +66,11 @@ - int - main() - { - printf("Hello, world!\n"); - } +int +main() +{ + printf("Hello, world!\n"); +} @@ -82,10 +82,10 @@ - Program('hello.c') +Program('hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -179,10 +179,10 @@ - Object('hello.c') +Object('hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -228,16 +228,16 @@ - Java('classes', 'src') +Java('classes', 'src') - public class Example1 - { - public static void main(String[] args) - { - System.out.println("Hello Java world!\n"); - } - } +public class Example1 +{ + public static void main(String[] args) + { + System.out.println("Hello Java world!\n"); + } +} @@ -285,10 +285,10 @@ - Program('hello.c') +Program('hello.c') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } @@ -358,8 +358,8 @@ - # Arrange to build the "hello" program. - Program('hello.c') # "hello.c" is the source file. +# Arrange to build the "hello" program. +Program('hello.c') # "hello.c" is the source file. @@ -442,17 +442,17 @@ - print "Calling Program('hello.c')" - Program('hello.c') - print "Calling Program('goodbye.c')" - Program('goodbye.c') - print "Finished calling Program()" +print "Calling Program('hello.c')" +Program('hello.c') +print "Calling Program('goodbye.c')" +Program('goodbye.c') +print "Finished calling Program()" - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - int main() { printf("Goodbye, world!\n"); } +int main() { printf("Goodbye, world!\n"); } diff --git a/doc/user/sourcecode.xml b/doc/user/sourcecode.xml index 22258823..c6d645f3 100644 --- a/doc/user/sourcecode.xml +++ b/doc/user/sourcecode.xml @@ -65,12 +65,12 @@ - env = Environment() - env.SourceCode('.', env.BitKeeper()) - env.Program('hello.c') +env = Environment() +env.SourceCode('.', env.BitKeeper()) +env.Program('hello.c') - s.hello.c +s.hello.c @@ -91,9 +91,9 @@ - env = Environment() - env.SourceCode('.', env.CVS('/usr/local/CVS')) - env.Program('hello.c') +env = Environment() +env.SourceCode('.', env.CVS('/usr/local/CVS')) +env.Program('hello.c') @@ -114,12 +114,12 @@ - env = Environment() - env.SourceCode('.', env.RCS()) - env.Program('hello.c') +env = Environment() +env.SourceCode('.', env.RCS()) +env.Program('hello.c') - hello.c,v +hello.c,v @@ -140,12 +140,12 @@ - env = Environment() - env.SourceCode('.', env.SCCS()) - env.Program('hello.c') +env = Environment() +env.SourceCode('.', env.SCCS()) +env.Program('hello.c') - s.hello.c +s.hello.c @@ -168,9 +168,9 @@ - env = Environment() - env.SourceCode('.', env.Subversion('XXX')) - env.Program('hello.c') +env = Environment() +env.SourceCode('.', env.Subversion('XXX')) +env.Program('hello.c') diff --git a/doc/user/troubleshoot.xml b/doc/user/troubleshoot.xml index 076c0544..94af7275 100644 --- a/doc/user/troubleshoot.xml +++ b/doc/user/troubleshoot.xml @@ -92,12 +92,12 @@ - # Intentionally misspell the output file name in the - # command used to create the file: - Command('file.out', 'file.in', 'cp $SOURCE file.oout') +# Intentionally misspell the output file name in the +# command used to create the file: +Command('file.out', 'file.in', 'cp $SOURCE file.oout') - file.in +file.in @@ -174,16 +174,16 @@ - Program('prog', ['file1.c', 'file2.c', 'file3.c']) +Program('prog', ['file1.c', 'file2.c', 'file3.c']) - file1.c +file1.c - file2.c +file2.c - file3.c +file3.c @@ -212,21 +212,21 @@ - Program('prog', ['file1.c', 'file2.c', 'file3.c'], CPPPATH='.') +Program('prog', ['file1.c', 'file2.c', 'file3.c'], CPPPATH='.') - #include <hello.h> - file1.c +#include <hello.h> +file1.c - file2.c +file2.c - #include <hello.h> - file3.c +#include <hello.h> +file3.c - #define string "world" +#define string "world" @@ -278,8 +278,8 @@ - env = Environment() - print env.Dump() +env = Environment() +print env.Dump() @@ -338,8 +338,8 @@ - env = Environment() - print env.Dump('ENV') +env = Environment() +print env.Dump('ENV') @@ -391,20 +391,20 @@ - env = Environment(CPPPATH = ['.']) - env.Program('prog', ['f1.c', 'f2.c', 'f3.c']) +env = Environment(CPPPATH = ['.']) +env.Program('prog', ['f1.c', 'f2.c', 'f3.c']) - #include "inc.h" +#include "inc.h" - #include "inc.h" +#include "inc.h" - #include "inc.h" +#include "inc.h" - inc.h +inc.h @@ -523,30 +523,30 @@ - env = Environment(CPPPATH = ['.'], - LIBS = ['foo'], - LIBPATH = ['.']) - env.Library('foo', ['f1.c', 'f2.c', 'f3.c']) - env.Program('prog1.c') - env.Program('prog2.c') +env = Environment(CPPPATH = ['.'], + LIBS = ['foo'], + LIBPATH = ['.']) +env.Library('foo', ['f1.c', 'f2.c', 'f3.c']) +env.Program('prog1.c') +env.Program('prog2.c') - #include "inc.h" +#include "inc.h" - #include "inc.h" +#include "inc.h" - #include "inc.h" +#include "inc.h" - #include "inc.h" +#include "inc.h" - #include "inc.h" +#include "inc.h" - inc.h +inc.h @@ -609,11 +609,11 @@ - env = Environment(CPPPATH = ['.']) - env.Program('prog', 'prog.c') +env = Environment(CPPPATH = ['.']) +env.Program('prog', 'prog.c') - prog.c +prog.c @@ -630,13 +630,13 @@ --> - % scons -Q --debug=presub - Building prog.o with action: - $CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCOMCOM $SOURCES - cc -o prog.o -c -I. prog.c - Building prog with action: - $SMART_LINKCOM - cc -o prog prog.o +% scons -Q --debug=presub +Building prog.o with action: + $CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCOMCOM $SOURCES +cc -o prog.o -c -I. prog.c +Building prog with action: + $SMART_LINKCOM +cc -o prog prog.o @@ -657,17 +657,17 @@ - env = Environment(LIBPATH = ['libs1', 'libs2']) - env.Program('prog.c', LIBS=['foo', 'bar']) +env = Environment(LIBPATH = ['libs1', 'libs2']) +env.Program('prog.c', LIBS=['foo', 'bar']) - prog.c +prog.c - libs1/libfoo.a +libs1/libfoo.a - libs2/libbar.a +libs2/libbar.a @@ -701,19 +701,19 @@ - env = Environment(CPPPATH = ['inc1', 'inc2']) - env.Program('prog.c') +env = Environment(CPPPATH = ['inc1', 'inc2']) +env.Program('prog.c') - #include "file1.h" - #include "file2.h" - prog.c +#include "file1.h" +#include "file2.h" +prog.c - inc1/file1.h +inc1/file1.h - inc2/file2.h +inc2/file2.h @@ -749,7 +749,7 @@ - Program('prog.c') +Program('prog.c') @@ -829,15 +829,15 @@ - env = Environment(CPPPATH = ['.']) - env.Program('prog.c') +env = Environment(CPPPATH = ['.']) +env.Program('prog.c') - #include "inc.h" - prog.c +#include "inc.h" +prog.c - #define STRING "one" +#define STRING "one" diff --git a/doc/user/variants.xml b/doc/user/variants.xml index 491074f6..f14cf6e0 100644 --- a/doc/user/variants.xml +++ b/doc/user/variants.xml @@ -159,9 +159,9 @@ is pretty smart about rebuilding things when you change options. - env = Environment(OS = ARGUMENTS.get('OS')) - for os in ['newell', 'post']: - SConscript('src/SConscript', variant_dir='build/' + os) +env = Environment(OS = ARGUMENTS.get('OS')) +for os in ['newell', 'post']: + SConscript('src/SConscript', variant_dir='build/' + os) -- cgit v1.2.1 From 4ebe99885427c680c151010a2d67b409983c15d9 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sun, 6 Oct 2013 18:48:36 +0200 Subject: - additional corrections for left alignment --- doc/generated/variables.gen | 2 + doc/user/add-method.xml | 36 ++++++------ doc/user/builders-writing.xml | 44 +++++++-------- doc/user/caching.xml | 22 ++++---- doc/user/command-line.xml | 44 +++++++-------- doc/user/depends.xml | 96 ++++++++++++++++---------------- doc/user/environments.xml | 96 +++++++++++++++----------------- doc/user/less-simple.xml | 14 ++--- doc/user/misc.xml | 36 ++++++------ doc/user/nodes.xml | 8 +-- doc/user/output.xml | 124 +++++++++++++++++++++--------------------- doc/user/scanners.xml | 28 +++++----- doc/user/sconf.xml | 74 ++++++++++++------------- doc/user/variants.xml | 56 +++++++++---------- 14 files changed, 337 insertions(+), 343 deletions(-) (limited to 'doc') diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index b2139160..784cd288 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -7355,11 +7355,13 @@ General options passed to the zip utility. ZIPROOT + An optional zip root directory (default empty). The filenames stored in the zip file will be relative to this directory, if given. Otherwise the filenames are relative to the current directory of the command. For instance: + env = Environment() env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1') diff --git a/doc/user/add-method.xml b/doc/user/add-method.xml index e94626bc..c50786cd 100644 --- a/doc/user/add-method.xml +++ b/doc/user/add-method.xml @@ -100,28 +100,28 @@ int main() { printf("Hello, world!\n"); } - def BuildTestProg(env, testfile, resourcefile, testdir="tests"): - """Build the test program; - prepends "test_" to src and target, - and puts target into testdir.""" - srcfile = "test_%s.c" % testfile - target = "%s/test_%s" % (testdir, testfile) - if env['PLATFORM'] == 'win32': - resfile = env.RES(resourcefile) - p = env.Program(target, [srcfile, resfile]) - else: - p = env.Program(target, srcfile) - return p - AddMethod(Environment, BuildTestProg) - - env = Environment() - env.BuildTestProg('stuff', resourcefile='res.rc') +def BuildTestProg(env, testfile, resourcefile, testdir="tests"): + """Build the test program; + prepends "test_" to src and target, + and puts target into testdir.""" + srcfile = "test_%s.c" % testfile + target = "%s/test_%s" % (testdir, testfile) + if env['PLATFORM'] == 'win32': + resfile = env.RES(resourcefile) + p = env.Program(target, [srcfile, resfile]) + else: + p = env.Program(target, srcfile) + return p +AddMethod(Environment, BuildTestProg) + +env = Environment() +env.BuildTestProg('stuff', resourcefile='res.rc') - int main() { printf("Hello, world!\n"); } +int main() { printf("Hello, world!\n"); } - res.rc +res.rc diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index 383823a3..e6e2aaf2 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -812,38 +812,38 @@ env.Foo('file') - bld = Builder(action = 'my_command $SOURCES > $TARGET', - suffix = '.foo', - src_suffix = '.input', - emitter = '$MY_EMITTER') - def modify1(target, source, env): - return target, source + ['modify1.in'] - def modify2(target, source, env): - return target, source + ['modify2.in'] - env1 = Environment(BUILDERS = {'Foo' : bld}, - MY_EMITTER = modify1) - env2 = Environment(BUILDERS = {'Foo' : bld}, - MY_EMITTER = modify2) - env1.Foo('file1') - env2.Foo('file2') - import os - env1['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd() - env2['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd() +bld = Builder(action = 'my_command $SOURCES > $TARGET', + suffix = '.foo', + src_suffix = '.input', + emitter = '$MY_EMITTER') +def modify1(target, source, env): + return target, source + ['modify1.in'] +def modify2(target, source, env): + return target, source + ['modify2.in'] +env1 = Environment(BUILDERS = {'Foo' : bld}, + MY_EMITTER = modify1) +env2 = Environment(BUILDERS = {'Foo' : bld}, + MY_EMITTER = modify2) +env1.Foo('file1') +env2.Foo('file2') +import os +env1['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd() +env2['ENV']['PATH'] = env2['ENV']['PATH'] + os.pathsep + os.getcwd() - file1.input +file1.input - file2.input +file2.input - modify1.input +modify1.input - modify2.input +modify2.input - cat +cat diff --git a/doc/user/caching.xml b/doc/user/caching.xml index f7286539..9c66c318 100644 --- a/doc/user/caching.xml +++ b/doc/user/caching.xml @@ -424,20 +424,20 @@ Program('prog', scons -Q - -random - We captured it directly here to guarantee a "random" order, - guarding against the potential for - -random to happen - to return things in the original sorted order. +We captured it directly here to guarantee a "random" order, +guarding against the potential for - -random to happen +to return things in the original sorted order. - --> +--> - % scons -Q --random - cc -o f3.o -c f3.c - cc -o f1.o -c f1.c - cc -o f5.o -c f5.c - cc -o f2.o -c f2.c - cc -o f4.o -c f4.c - cc -o prog f1.o f2.o f3.o f4.o f5.o + % scons -Q --random + cc -o f3.o -c f3.c + cc -o f1.o -c f1.c + cc -o f5.o -c f5.c + cc -o f2.o -c f2.c + cc -o f4.o -c f4.c + cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml index d2e41462..f410b3ee 100644 --- a/doc/user/command-line.xml +++ b/doc/user/command-line.xml @@ -628,21 +628,21 @@ foo.in - AddOption('--prefix', - dest='prefix', - type='string', - nargs=1, - action='store', - metavar='DIR', - help='installation prefix') - - env = Environment(PREFIX = GetOption('prefix')) - - installed_foo = env.Install('$PREFIX/usr/bin', 'foo.in') - Default(installed_foo) +AddOption('--prefix', + dest='prefix', + type='string', + nargs=1, + action='store', + metavar='DIR', + help='installation prefix') + +env = Environment(PREFIX = GetOption('prefix')) + +installed_foo = env.Install('$PREFIX/usr/bin', 'foo.in') +Default(installed_foo) - foo.in +foo.in @@ -1092,21 +1092,21 @@ RELEASE = 1 - vars = Variables('custom.py') - vars.Add('RELEASE', 'Set to 1 to build for release', 0) - env = Environment(variables = vars, - CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) - env.Program(['foo.c', 'bar.c']) - Help(vars.GenerateHelpText(env)) + vars = Variables('custom.py') + vars.Add('RELEASE', 'Set to 1 to build for release', 0) + env = Environment(variables = vars, + CPPDEFINES={'RELEASE_BUILD' : '${RELEASE}'}) + env.Program(['foo.c', 'bar.c']) + Help(vars.GenerateHelpText(env)) - foo.c +foo.c - bar.c +bar.c - RELEASE = 0 +RELEASE = 0 diff --git a/doc/user/depends.xml b/doc/user/depends.xml index 2dd7ea6b..3882af77 100644 --- a/doc/user/depends.xml +++ b/doc/user/depends.xml @@ -657,7 +657,7 @@ def update_file(): f = open("test.txt","a") f.write("some line\n") f.close() - + update_file() # Activate our own decider function @@ -1364,18 +1364,18 @@ cc -o hello hello.o - #define FOO_HEADER <foo.h> - #include FOO_HEADER +#define FOO_HEADER <foo.h> +#include FOO_HEADER - int main() { - return FOO; - } +int main() { + return FOO; +} - Program('hello', 'hello.c', CPPPATH='.') +Program('hello', 'hello.c', CPPPATH='.') - #define FOO 42 +#define FOO 42 @@ -1416,24 +1416,24 @@ cc -o hello hello.o - #define FOO_HEADER <foo.h> - #include FOO_HEADER +#define FOO_HEADER <foo.h> +#include FOO_HEADER - int main() { - return FOO; - } +int main() { + return FOO; +} - obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.') - SideEffect('hello.d', obj) - ParseDepends('hello.d') - Program('hello', obj) +obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.') +SideEffect('hello.d', obj) +ParseDepends('hello.d') +Program('hello', obj) - #define FOO 42 +#define FOO 42 - hello.o: hello.c foo.h +hello.o: hello.c foo.h @@ -1453,21 +1453,21 @@ cc -o hello hello.o - #define FOO_HEADER <foo.h> - #include FOO_HEADER +#define FOO_HEADER <foo.h> +#include FOO_HEADER - int main() { - return FOO; - } +int main() { + return FOO; +} - obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.') - SideEffect('hello.d', obj) - ParseDepends('hello.d') - Program('hello', obj) +obj = Object('hello.c', CCFLAGS='-MD -MF hello.d', CPPPATH='.') +SideEffect('hello.d', obj) +ParseDepends('hello.d') +Program('hello', obj) - #define FOO 42 +#define FOO 42 @@ -1669,18 +1669,18 @@ int main() { printf("Hello!\n"); } - import time +import time - version_c_text = """ - char *date = "%s"; - """ % time.ctime(time.time()) - open('version.c', 'w').write(version_c_text) +version_c_text = """ +char *date = "%s"; +""" % time.ctime(time.time()) +open('version.c', 'w').write(version_c_text) - hello = Program(['hello.c', 'version.c']) +hello = Program(['hello.c', 'version.c']) - extern char *date; - int main() { printf("Hello, %s! I was built: %s\n", date); } +extern char *date; +int main() { printf("Hello, %s! I was built: %s\n", date); } @@ -1728,23 +1728,23 @@ int main() { printf("Hello!\n"); } - import time +import time - version_c_text = """ - char *date = "%s"; - """ % time.ctime(time.time()) - open('version.c', 'w').write(version_c_text) +version_c_text = """ +char *date = "%s"; +""" % time.ctime(time.time()) +open('version.c', 'w').write(version_c_text) - version_obj = Object('version.c') +version_obj = Object('version.c') - hello = Program('hello.c', - LINKFLAGS = str(version_obj[0])) +hello = Program('hello.c', + LINKFLAGS = str(version_obj[0])) - Requires(hello, version_obj) +Requires(hello, version_obj) - extern char *date; - int main() { printf("Hello, %s! I was built: %s\n", date); } +extern char *date; +int main() { printf("Hello, %s! I was built: %s\n", date); } diff --git a/doc/user/environments.xml b/doc/user/environments.xml index f11a95b6..b9585cb3 100644 --- a/doc/user/environments.xml +++ b/doc/user/environments.xml @@ -579,13 +579,13 @@ env = Environment() - env = Environment(CC = 'gcc', - CCFLAGS = '-O2') + env = Environment(CC = 'gcc', + CCFLAGS = '-O2') - env.Program('foo.c') + env.Program('foo.c') - int main() { } +int main() { } @@ -861,8 +861,6 @@ print "value is:", env.subst( '->${1 / 0}<-' ) scons -Q - - If &AllowSubstExceptions; is called multiple times, each call @@ -903,9 +901,7 @@ print "value is:", env.subst( '->${1 / 0}<-' ) - - DefaultEnvironment(CC = '/usr/local/bin/gcc') - +DefaultEnvironment(CC = '/usr/local/bin/gcc') @@ -937,10 +933,8 @@ print "value is:", env.subst( '->${1 / 0}<-' ) - - env = DefaultEnvironment() - env['CC'] = '/usr/local/bin/gcc' - +env = DefaultEnvironment() +env['CC'] = '/usr/local/bin/gcc' @@ -966,10 +960,8 @@ print "value is:", env.subst( '->${1 / 0}<-' ) - - env = DefaultEnvironment(tools = ['gcc', 'gnulink'], - CC = '/usr/local/bin/gcc') - +env = DefaultEnvironment(tools = ['gcc', 'gnulink'], + CC = '/usr/local/bin/gcc') @@ -1005,18 +997,18 @@ print "value is:", env.subst( '->${1 / 0}<-' ) - opt = Environment(CCFLAGS = '-O2') - dbg = Environment(CCFLAGS = '-g') +opt = Environment(CCFLAGS = '-O2') +dbg = Environment(CCFLAGS = '-g') - opt.Program('foo', 'foo.c') +opt.Program('foo', 'foo.c') - dbg.Program('bar', 'bar.c') +dbg.Program('bar', 'bar.c') - int main() { } +int main() { } - int main() { } +int main() { } @@ -1036,15 +1028,15 @@ print "value is:", env.subst( '->${1 / 0}<-' ) - opt = Environment(CCFLAGS = '-O2') - dbg = Environment(CCFLAGS = '-g') +opt = Environment(CCFLAGS = '-O2') +dbg = Environment(CCFLAGS = '-g') - opt.Program('foo', 'foo.c') +opt.Program('foo', 'foo.c') - dbg.Program('foo', 'foo.c') +dbg.Program('foo', 'foo.c') - int main() { } +int main() { } @@ -1081,17 +1073,17 @@ print "value is:", env.subst( '->${1 / 0}<-' ) - opt = Environment(CCFLAGS = '-O2') - dbg = Environment(CCFLAGS = '-g') +opt = Environment(CCFLAGS = '-O2') +dbg = Environment(CCFLAGS = '-g') - o = opt.Object('foo-opt', 'foo.c') - opt.Program(o) +o = opt.Object('foo-opt', 'foo.c') +opt.Program(o) - d = dbg.Object('foo-dbg', 'foo.c') - dbg.Program(d) +d = dbg.Object('foo-dbg', 'foo.c') +dbg.Program(d) - int main() { } +int main() { } @@ -1149,20 +1141,20 @@ print "value is:", env.subst( '->${1 / 0}<-' ) - env = Environment(CC = 'gcc') - opt = env.Clone(CCFLAGS = '-O2') - dbg = env.Clone(CCFLAGS = '-g') +env = Environment(CC = 'gcc') +opt = env.Clone(CCFLAGS = '-O2') +dbg = env.Clone(CCFLAGS = '-g') - env.Program('foo', 'foo.c') +env.Program('foo', 'foo.c') - o = opt.Object('foo-opt', 'foo.c') - opt.Program(o) +o = opt.Object('foo-opt', 'foo.c') +opt.Program(o) - d = dbg.Object('foo-dbg', 'foo.c') - dbg.Program(d) +d = dbg.Object('foo-dbg', 'foo.c') +dbg.Program(d) - int main() { } +int main() { } @@ -1258,19 +1250,19 @@ print "NEW_VARIABLE =", env['NEW_VARIABLE'] - env = Environment(CCFLAGS = '-DDEFINE1') - print "CCFLAGS =", env['CCFLAGS'] - env.Program('foo.c') +env = Environment(CCFLAGS = '-DDEFINE1') +print "CCFLAGS =", env['CCFLAGS'] +env.Program('foo.c') - env.Replace(CCFLAGS = '-DDEFINE2') - print "CCFLAGS =", env['CCFLAGS'] - env.Program('bar.c') +env.Replace(CCFLAGS = '-DDEFINE2') +print "CCFLAGS =", env['CCFLAGS'] +env.Program('bar.c') - int main() { } +int main() { } - int main() { } +int main() { } diff --git a/doc/user/less-simple.xml b/doc/user/less-simple.xml index 4c60cc71..41a1f3d4 100644 --- a/doc/user/less-simple.xml +++ b/doc/user/less-simple.xml @@ -337,15 +337,15 @@ Program('program2', ['program2.c']) - common_sources = ['file1.c', 'file2.c'] +common_sources = ['file1.c', 'file2.c'] - # THE FOLLOWING IS INCORRECT AND GENERATES A PYTHON ERROR - # BECAUSE IT TRIES TO ADD A STRING TO A LIST: - Program('program1', common_sources + 'program1.c') +# THE FOLLOWING IS INCORRECT AND GENERATES A PYTHON ERROR +# BECAUSE IT TRIES TO ADD A STRING TO A LIST: +Program('program1', common_sources + 'program1.c') - # The following works correctly, because it's adding two - # lists together to make another list. - Program('program2', common_sources + ['program2.c']) +# The following works correctly, because it's adding two +# lists together to make another list. +Program('program2', common_sources + ['program2.c']) diff --git a/doc/user/misc.xml b/doc/user/misc.xml index 4145d49e..d0aeb59f 100644 --- a/doc/user/misc.xml +++ b/doc/user/misc.xml @@ -501,20 +501,20 @@ prog2.c - objects = [ - Object('prog1.c'), - Object('prog2.c', CCFLAGS='-DFOO'), - ] - Program(objects) +objects = [ + Object('prog1.c'), + Object('prog2.c', CCFLAGS='-DFOO'), +] +Program(objects) - for object_file in objects: - print object_file.abspath +for object_file in objects: + print object_file.abspath - prog1.c +prog1.c - prog2.c +prog2.c @@ -542,20 +542,20 @@ prog2.c - objects = [ - Object('prog1.c'), - Object('prog2.c', CCFLAGS='-DFOO'), - ] - Program(objects) +objects = [ + Object('prog1.c'), + Object('prog2.c', CCFLAGS='-DFOO'), +] +Program(objects) - for object_file in Flatten(objects): - print object_file.abspath +for object_file in Flatten(objects): + print object_file.abspath - prog1.c +prog1.c - prog2.c +prog2.c diff --git a/doc/user/nodes.xml b/doc/user/nodes.xml index 78f15e32..1c9b4fd9 100644 --- a/doc/user/nodes.xml +++ b/doc/user/nodes.xml @@ -183,11 +183,11 @@ int main() { printf("Goodbye, world!\n"); } - hello_c = File('hello.c') - Program(hello_c) +hello_c = File('hello.c') +Program(hello_c) - classes = Dir('classes') - Java(classes, 'src') +classes = Dir('classes') +Java(classes, 'src') diff --git a/doc/user/output.xml b/doc/user/output.xml index de6b8d4d..069d525a 100644 --- a/doc/user/output.xml +++ b/doc/user/output.xml @@ -132,12 +132,12 @@ Type: 'scons program' to build the production program, - env = Environment() +env = Environment() - Help("\nType: 'scons program' to build the production program.\n") +Help("\nType: 'scons program' to build the production program.\n") - if env['PLATFORM'] == 'win32': - Help("\nType: 'scons windebug' to build the Windows debug version.\n") +if env['PLATFORM'] == 'win32': + Help("\nType: 'scons windebug' to build the Windows debug version.\n") @@ -522,13 +522,13 @@ Program('f2.c') - screen = open('/dev/tty', 'w') - count = 0 - def progress_function(node) - count += 1 - screen.write('Node %4d: %s\r' % (count, node)) +screen = open('/dev/tty', 'w') +count = 0 +def progress_function(node) + count += 1 + screen.write('Node %4d: %s\r' % (count, node)) - Progress(progress_function) +Progress(progress_function) @@ -595,13 +595,13 @@ Program('f2.c') - import atexit +import atexit - def print_build_failures(): - from SCons.Script import GetBuildFailures - for bf in GetBuildFailures(): - print "%s failed: %s" % (bf.node, bf.errstr) - atexit.register(print_build_failures) +def print_build_failures(): + from SCons.Script import GetBuildFailures + for bf in GetBuildFailures(): + print "%s failed: %s" % (bf.node, bf.errstr) +atexit.register(print_build_failures) @@ -639,52 +639,52 @@ Program('f2.c') - # Make the build fail if we pass fail=1 on the command line - if ARGUMENTS.get('fail', 0): - Command('target', 'source', ['/bin/false']) - - def bf_to_str(bf): - """Convert an element of GetBuildFailures() to a string - in a useful way.""" - import SCons.Errors - if bf is None: # unknown targets product None in list - return '(unknown tgt)' - elif isinstance(bf, SCons.Errors.StopError): - return str(bf) - elif bf.node: - return str(bf.node) + ': ' + bf.errstr - elif bf.filename: - return bf.filename + ': ' + bf.errstr - return 'unknown failure: ' + bf.errstr - import atexit - - def build_status(): - """Convert the build status to a 2-tuple, (status, msg).""" - from SCons.Script import GetBuildFailures - bf = GetBuildFailures() - if bf: - # bf is normally a list of build failures; if an element is None, - # it's because of a target that scons doesn't know anything about. - status = 'failed' - failures_message = "\n".join(["Failed building %s" % bf_to_str(x) - for x in bf if x is not None]) - else: - # if bf is None, the build completed successfully. - status = 'ok' - failures_message = '' - return (status, failures_message) - - def display_build_status(): - """Display the build status. Called by atexit. - Here you could do all kinds of complicated things.""" - status, failures_message = build_status() - if status == 'failed': - print "FAILED!!!!" # could display alert, ring bell, etc. - elif status == 'ok': - print "Build succeeded." - print failures_message - - atexit.register(display_build_status) +# Make the build fail if we pass fail=1 on the command line +if ARGUMENTS.get('fail', 0): + Command('target', 'source', ['/bin/false']) + +def bf_to_str(bf): + """Convert an element of GetBuildFailures() to a string + in a useful way.""" + import SCons.Errors + if bf is None: # unknown targets product None in list + return '(unknown tgt)' + elif isinstance(bf, SCons.Errors.StopError): + return str(bf) + elif bf.node: + return str(bf.node) + ': ' + bf.errstr + elif bf.filename: + return bf.filename + ': ' + bf.errstr + return 'unknown failure: ' + bf.errstr +import atexit + +def build_status(): + """Convert the build status to a 2-tuple, (status, msg).""" + from SCons.Script import GetBuildFailures + bf = GetBuildFailures() + if bf: + # bf is normally a list of build failures; if an element is None, + # it's because of a target that scons doesn't know anything about. + status = 'failed' + failures_message = "\n".join(["Failed building %s" % bf_to_str(x) + for x in bf if x is not None]) + else: + # if bf is None, the build completed successfully. + status = 'ok' + failures_message = '' + return (status, failures_message) + +def display_build_status(): + """Display the build status. Called by atexit. + Here you could do all kinds of complicated things.""" + status, failures_message = build_status() + if status == 'failed': + print "FAILED!!!!" # could display alert, ring bell, etc. + elif status == 'ok': + print "Build succeeded." + print failures_message + +atexit.register(display_build_status) diff --git a/doc/user/scanners.xml b/doc/user/scanners.xml index 5ed0d625..758a8490 100644 --- a/doc/user/scanners.xml +++ b/doc/user/scanners.xml @@ -308,34 +308,34 @@ env.Append(SCANNERS = kscan) - import re + import re - include_re = re.compile(r'^include\s+(\S+)$', re.M) + include_re = re.compile(r'^include\s+(\S+)$', re.M) - def kfile_scan(node, env, path): - contents = node.get_text_contents() - includes = include_re.findall(contents) - return env.File(includes) + def kfile_scan(node, env, path): + contents = node.get_text_contents() + includes = include_re.findall(contents) + return env.File(includes) - kscan = Scanner(function = kfile_scan, - skeys = ['.k']) + kscan = Scanner(function = kfile_scan, + skeys = ['.k']) - env = Environment(ENV = {'PATH' : '__ROOT__/usr/local/bin'}) - env.Append(SCANNERS = kscan) + env = Environment(ENV = {'PATH' : '__ROOT__/usr/local/bin'}) + env.Append(SCANNERS = kscan) - env.Command('foo', 'foo.k', 'kprocess < $SOURCES > $TARGET') + env.Command('foo', 'foo.k', 'kprocess < $SOURCES > $TARGET') - include other_file +include other_file - other_file +other_file - cat +cat diff --git a/doc/user/sconf.xml b/doc/user/sconf.xml index e787db96..31bd45e0 100644 --- a/doc/user/sconf.xml +++ b/doc/user/sconf.xml @@ -303,20 +303,20 @@ env = conf.Finish() - mylib_test_source_file = """ - #include &lt;mylib.h&gt; - int main(int argc, char **argv) - { - MyLibrary mylib(argc, argv); - return 0; - } - """ - - def CheckMyLibrary(context): - context.Message('Checking for MyLibrary...') - result = context.TryLink(mylib_test_source_file, '.c') - context.Result(result) - return result +mylib_test_source_file = """ +#include &lt;mylib.h&gt; +int main(int argc, char **argv) +{ + MyLibrary mylib(argc, argv); + return 0; +} +""" + +def CheckMyLibrary(context): + context.Message('Checking for MyLibrary...') + result = context.TryLink(mylib_test_source_file, '.c') + context.Result(result) + return result @@ -380,30 +380,30 @@ conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary}) - mylib_test_source_file = """ - #include &lt;mylib.h&gt; - int main(int argc, char **argv) - { - MyLibrary mylib(argc, argv); - return 0; - } - """ - - def CheckMyLibrary(context): - context.Message('Checking for MyLibrary... ') - result = context.TryLink(mylib_test_source_file, '.c') - context.Result(result) - return result - - env = Environment() - conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary}) - if not conf.CheckMyLibrary(): - print 'MyLibrary is not installed!' - Exit(1) - env = conf.Finish() +mylib_test_source_file = """ +#include &lt;mylib.h&gt; +int main(int argc, char **argv) +{ + MyLibrary mylib(argc, argv); + return 0; +} +""" + +def CheckMyLibrary(context): + context.Message('Checking for MyLibrary... ') + result = context.TryLink(mylib_test_source_file, '.c') + context.Result(result) + return result + +env = Environment() +conf = Configure(env, custom_tests = {'CheckMyLibrary' : CheckMyLibrary}) +if not conf.CheckMyLibrary(): + print 'MyLibrary is not installed!' + Exit(1) +env = conf.Finish() - # We would then add actual calls like Program() to build - # something using the "env" construction environment. +# We would then add actual calls like Program() to build +# something using the "env" construction environment. diff --git a/doc/user/variants.xml b/doc/user/variants.xml index f14cf6e0..74a155b0 100644 --- a/doc/user/variants.xml +++ b/doc/user/variants.xml @@ -84,53 +84,53 @@ is pretty smart about rebuilding things when you change options. - platform = ARGUMENTS.get('OS', Platform()) +platform = ARGUMENTS.get('OS', Platform()) - include = "#export/$PLATFORM/include" - lib = "#export/$PLATFORM/lib" - bin = "#export/$PLATFORM/bin" +include = "#export/$PLATFORM/include" +lib = "#export/$PLATFORM/lib" +bin = "#export/$PLATFORM/bin" - env = Environment(PLATFORM = platform, - BINDIR = bin, - INCDIR = include, - LIBDIR = lib, - CPPPATH = [include], - LIBPATH = [lib], - LIBS = 'world') +env = Environment(PLATFORM = platform, + BINDIR = bin, + INCDIR = include, + LIBDIR = lib, + CPPPATH = [include], + LIBPATH = [lib], + LIBS = 'world') - Export('env') +Export('env') - env.SConscript('src/SConscript', variant_dir='build/$PLATFORM') +env.SConscript('src/SConscript', variant_dir='build/$PLATFORM') - Import('env') - SConscript('hello/SConscript') - SConscript('world/SConscript') +Import('env') +SConscript('hello/SConscript') +SConscript('world/SConscript') - Import('env') - hello = env.Program('hello.c') - env.Install('$BINDIR', hello) +Import('env') +hello = env.Program('hello.c') +env.Install('$BINDIR', hello) - #include "world.h" - int main(int argc, char *argv[]) { printf "hello.c\n"; world(); } +#include "world.h" +int main(int argc, char *argv[]) { printf "hello.c\n"; world(); } - Import('env') - world = env.Library('world.c') - env.Install('$LIBDIR', world) - env.Install('$INCDIR', 'world.h') +Import('env') +world = env.Library('world.c') +env.Install('$LIBDIR', world) +env.Install('$INCDIR', 'world.h') - #define STRING "world.h" - extern int world(); +#define STRING "world.h" +extern int world(); - int world() { printf "world.c\n"; } +int world() { printf "world.c\n"; } -- cgit v1.2.1 From 22a213e14568ab8df5f4c754989c01700c3e5e26 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sun, 6 Oct 2013 20:04:55 +0200 Subject: - corrected dependency example --- doc/generated/examples/depends_ex1_5.xml | 2 +- doc/user/depends.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/generated/examples/depends_ex1_5.xml b/doc/generated/examples/depends_ex1_5.xml index 136def6f..abbe64ea 100644 --- a/doc/generated/examples/depends_ex1_5.xml +++ b/doc/generated/examples/depends_ex1_5.xml @@ -5,5 +5,5 @@ cc -o hello hello.o % [CHANGE A COMMENT IN hello.c] % scons -Q hello cc -o hello.o -c hello.c -cc -o hello hello.o +scons: `hello' is up to date. diff --git a/doc/user/depends.xml b/doc/user/depends.xml index 3882af77..a5639a19 100644 --- a/doc/user/depends.xml +++ b/doc/user/depends.xml @@ -64,7 +64,7 @@ Program('hello.c') int main() { printf("Hello, world!\n"); } - + -- cgit v1.2.1 From 812791de757c76dc90f42312f6ba663aa45191f4 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Tue, 8 Oct 2013 12:12:21 +0200 Subject: - minor change to the SCons Docbook XSD: stricter handling of para within the special tags "tool", "builder" and "cvar" - fixed current docs accordingly --- doc/editor_configs/serna/scons/xsd/dbpoolx.xsd | 3 --- doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd | 3 --- doc/xsd/dbpoolx.xsd | 3 --- 3 files changed, 9 deletions(-) (limited to 'doc') diff --git a/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd b/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd index f0a3f1ca..0ce5cb7b 100644 --- a/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd +++ b/doc/editor_configs/serna/scons/xsd/dbpoolx.xsd @@ -2589,7 +2589,6 @@ - @@ -2616,7 +2615,6 @@ - @@ -2644,7 +2642,6 @@ - diff --git a/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd b/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd index f0a3f1ca..0ce5cb7b 100644 --- a/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd +++ b/doc/editor_configs/xmlmind/addon/config/scons/scons_xsd/dbpoolx.xsd @@ -2589,7 +2589,6 @@ - @@ -2616,7 +2615,6 @@ - @@ -2644,7 +2642,6 @@ - diff --git a/doc/xsd/dbpoolx.xsd b/doc/xsd/dbpoolx.xsd index f0a3f1ca..0ce5cb7b 100644 --- a/doc/xsd/dbpoolx.xsd +++ b/doc/xsd/dbpoolx.xsd @@ -2589,7 +2589,6 @@ - @@ -2616,7 +2615,6 @@ - @@ -2644,7 +2642,6 @@ - -- cgit v1.2.1 From 7dd5945866a3044d3295a7bb3dc81bd2c094a88d Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Tue, 8 Oct 2013 12:54:45 +0200 Subject: - added an explicit Gs() Builder to the gs.py Tool - updated documentation accordingly and added a (very) simple test --- doc/generated/builders.gen | 21 +++++++++++++++++++++ doc/generated/builders.mod | 4 ++++ doc/generated/tools.gen | 7 ++++++- doc/generated/variables.gen | 18 +++++++++++------- 4 files changed, 42 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index 3fdafb61..5cd92f21 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -395,6 +395,27 @@ env.DVI(target = 'bbb', source = 'bbb.ltx') # builds from ccc.latex env.DVI(target = 'ccc.dvi', source = 'ccc.latex') + + + + + Gs() + + + env.Gs() + + + +A Builder for explicitly calling the gs executable. +Depending on the underlying OS, the different names gs, +gsos2 and gswin32c +are tried. + +env = Environment(tools=['gs']) +env.Gs('cover.jpg','scons-scons.pdf', + GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q') + ) + diff --git a/doc/generated/builders.mod b/doc/generated/builders.mod index 59900cc1..b8c7d802 100644 --- a/doc/generated/builders.mod +++ b/doc/generated/builders.mod @@ -21,6 +21,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. DocbookXInclude"> DocbookXslt"> DVI"> +Gs"> Install"> InstallAs"> InstallVersionedLib"> @@ -74,6 +75,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.DocbookXInclude"> env.DocbookXslt"> env.DVI"> +env.Gs"> env.Install"> env.InstallAs"> env.InstallVersionedLib"> @@ -137,6 +139,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. DocbookXInclude"> DocbookXslt"> DVI"> +Gs"> Install"> InstallAs"> InstallVersionedLib"> @@ -190,6 +193,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.DocbookXInclude"> env.DocbookXslt"> env.DVI"> +env.Gs"> env.Install"> env.InstallAs"> env.InstallVersionedLib"> diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index 57bb0a24..7d756381 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -444,7 +444,12 @@ Set construction variables for GNU linker/loader. gs -Set construction variables for Ghostscript. +This Tool sets the required construction variables for working with +the Ghostscript command. It also registers an appropriate Action +with the PDF Builder (PDF), such that the conversion from +PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain. +Finally, it adds an explicit Ghostscript Builder (Gs) to the +environment. Sets: &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.Uses: &cv-link-GSCOMSTR;. diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 784cd288..ee5a0dd7 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -2324,7 +2324,7 @@ described above.) GS -The Ghostscript program used to convert PostScript to PDF files. +The Ghostscript program used, e.g. to convert PostScript to PDF files. @@ -2332,7 +2332,8 @@ The Ghostscript program used to convert PostScript to PDF files. GSCOM -The Ghostscript command line used to convert PostScript to PDF files. +The full Ghostscript command line used for the conversion process. Its default +value is $GS $GSFLAGS -sOutputFile=$TARGET $SOURCES. @@ -2341,9 +2342,8 @@ The Ghostscript command line used to convert PostScript to PDF files. The string displayed when -Ghostscript is used to convert -a PostScript file to a PDF file. -If this is not set, then $GSCOM (the command line) is displayed. +Ghostscript is called for the conversion process. +If this is not set (the default), then $GSCOM (the command line) is displayed. @@ -2351,8 +2351,9 @@ If this is not set, then -General options passed to the Ghostscript program -when converting PostScript to PDF files. +General options passed to the Ghostscript program, +when converting PostScript to PDF files for example. Its default value +is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite @@ -3548,6 +3549,9 @@ See m Internal ``macro''. Computes locale (language) name based on target filename (default: '${TARGET.filebase}' ). + +See msginit tool and POInit builder. + -- cgit v1.2.1 From d7eb9a43dc1ced51057f1b540a008506c323b503 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Tue, 8 Oct 2013 12:54:25 +0100 Subject: Adding documentation and a couple of tests --- doc/man/scons.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 947d86d6..80bbd447 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -671,8 +671,9 @@ directory. --debug=type Debug the build process. -type -specifies what type of debugging: +type[,type...] +specifies what type of debugging. Multiple types may be specified, +separated by commas. The following types are valid: -- cgit v1.2.1 From d612abd4a499483759fc66ca487c1542902da243 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Tue, 8 Oct 2013 15:45:37 +0200 Subject: - added EPUB as output format for documentation ("user" and "man" targets) --- doc/SConscript | 30 ++++++++++++++++++++++++++++-- doc/man/MANIFEST | 3 ++- doc/man/SConstruct | 22 +++++++++++++++++++++- doc/man/cover.jpg | Bin 0 -> 306 bytes doc/man/epub.css | 33 +++++++++++++++++++++++++++++++++ doc/man/epub.xsl | 35 +++++++++++++++++++++++++++++++++++ doc/man/html.xsl | 4 ++++ doc/man/pdf.xsl | 5 ++++- doc/man/scons.xml | 3 +++ doc/user/MANIFEST | 2 +- doc/user/SConstruct | 22 +++++++++++++++++++++- doc/user/chtml.xsl | 4 ++++ doc/user/cover.jpg | Bin 0 -> 306 bytes doc/user/epub.css | 33 +++++++++++++++++++++++++++++++++ doc/user/epub.xsl | 36 ++++++++++++++++++++++++++++++++++++ doc/user/html.xsl | 4 ++++ doc/user/main.xml | 1 + doc/user/pdf.xsl | 4 ++++ 18 files changed, 234 insertions(+), 7 deletions(-) create mode 100644 doc/man/cover.jpg create mode 100644 doc/man/epub.css create mode 100644 doc/man/epub.xsl create mode 100644 doc/user/cover.jpg create mode 100644 doc/user/epub.css create mode 100644 doc/user/epub.xsl (limited to 'doc') diff --git a/doc/SConscript b/doc/SConscript index 8dcf697c..c731dabb 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -41,6 +41,7 @@ build = os.path.join(build_dir, 'doc') fop = whereis('fop') xep = whereis('xep') epydoc_cli = whereis('epydoc') +gs = whereis('gs') # # @@ -158,6 +159,8 @@ else: env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['html'])))) env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['fo'])))) env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['manpages'])))) + env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['epub'])))) + env.Execute(Mkdir(os.path.join(build_dir, *(dbpath + ['xhtml-1_1'])))) env.Execute(Copy(os.path.join(build_dir, *dbpath), os.path.join('..', *(dbpath + ['VERSION'])))) for g in glob.glob(os.path.join('..', *(dbpath + ['common', '*.*']))): @@ -170,6 +173,20 @@ else: env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['fo'])), g)) for g in glob.glob(os.path.join('..', *(dbpath + ['manpages', '*.*']))): env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['manpages'])), g)) + for g in glob.glob(os.path.join('..', *(dbpath + ['epub', '*.xsl']))): + env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['epub'])), g)) + for g in glob.glob(os.path.join('..', *(dbpath + ['xhtml-1_1', '*.*']))): + env.Execute(Copy(os.path.join(build_dir, *(dbpath + ['xhtml-1_1'])), g)) + + # + # Copy additional Tools (gs, zip) + # + toolpath = ['src', 'engine', 'SCons', 'Tool'] + env.Execute(Copy(os.path.join(build_dir, *toolpath), + os.path.join('..', *(toolpath + ['gs.py'])))) + env.Execute(Copy(os.path.join(build_dir, *toolpath), + os.path.join('..', *(toolpath + ['zip.py'])))) + # # Each document will live in its own subdirectory. List them here @@ -182,8 +199,8 @@ else: #'python10' : ['chtml','html','pdf'], 'reference' : ['chtml','html','pdf'], #'developer' : ['chtml','html','pdf'], - 'user' : ['chtml','html','pdf'], - 'man' : ['man'] + 'user' : ['chtml','html','pdf','epub'], + 'man' : ['man','epub'] } # The names of the target files for the MAN pages man_page_list = ['scons.1','scons-time.1','sconsign.1'] @@ -247,6 +264,7 @@ else: htmlindex = os.path.join(htmldir, 'index.html') html = os.path.join(build, 'HTML', 'scons-%s.html' % doc) pdf = os.path.join(build, 'PDF', 'scons-%s.pdf' % doc) + epub = os.path.join(build, 'EPUB', 'scons-%s.epub' % doc) if 'chtml' in docs[doc]: env.Install(htmldir, Glob(os.path.join(build, doc,'scons-%s' % doc, '*.html'))) tar_deps.extend([htmlindex]) @@ -268,6 +286,14 @@ else: tar_deps.append(pdf) tar_list.append(pdf) + + if 'epub' in docs[doc] and gs: + env.InstallAs(epub, os.path.join(build, doc,'scons-%s.epub' % doc)) + Local(epub) + env.Ignore(epub, version_xml) + + tar_deps.append(epub) + tar_list.append(epub) if 'man' in docs[doc]: # diff --git a/doc/man/MANIFEST b/doc/man/MANIFEST index 7f0ad45b..4b3ce9ff 100644 --- a/doc/man/MANIFEST +++ b/doc/man/MANIFEST @@ -5,8 +5,9 @@ scons.xml sconsign.xml scons-time.xml *.xsl -scons.css +*.css SConstruct +cover.jpg titlepage/bricks.jpg titlepage/mapnik_final_colors.svg titlepage/SCons_path.svg diff --git a/doc/man/SConstruct b/doc/man/SConstruct index cd940215..cfdbb2d5 100644 --- a/doc/man/SConstruct +++ b/doc/man/SConstruct @@ -27,7 +27,7 @@ import os env = Environment(ENV={'PATH' : os.environ['PATH']}, - tools=['docbook'], + tools=['docbook','gs','zip'], toolpath=['../../src/engine/SCons/Tool'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') @@ -53,3 +53,23 @@ def createManPages(env, target): createManPages(env, "scons") createManPages(env, "sconsign") createManPages(env, "scons-time") + +has_gs = False +if env.WhereIs('gs'): + has_gs = True + +# +# Create the EPUB format +# +if has_gs and has_pdf: + metainf = env.Command('META-INF','',[Mkdir('META-INF'), Mkdir('OEBPS')]) + css = env.Command('OEBPS/epub.css','epub.css',[Copy('OEBPS/epub.css','epub.css')]) + env.Depends(css, metainf) + jpg = env.Gs('OEBPS/cover.jpg','scons-scons.pdf', + GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q') + env.Depends(jpg, metainf) + oebps = env.DocbookXslt('OEBPS/toc.ncx', 'scons_db.xml', xsl='epub.xsl') + env.Depends(oebps, jpg) + env.Zip('scons-man.epub', 'OEBPS', ZIPFLAGS='-Xr9D') + env.Clean(oebps, Glob('OEBPS/*.*')) + env.Clean(oebps, Glob('META-INF/*.*')) diff --git a/doc/man/cover.jpg b/doc/man/cover.jpg new file mode 100644 index 00000000..e2c2cb39 Binary files /dev/null and b/doc/man/cover.jpg differ diff --git a/doc/man/epub.css b/doc/man/epub.css new file mode 100644 index 00000000..31cebe54 --- /dev/null +++ b/doc/man/epub.css @@ -0,0 +1,33 @@ +/* This defines styles and classes used in the book */ +body { } +code { font-family: monospace; } +h1, h2, h3, h4, h5, h6 { text-align: center; margin-bottom:2em;} +h1.title { } +h2.author { } +p{ + padding:0; + margin:0; + text-indent:2em; +} +blockquote{ + margin-left:3em; + margin-right:3em; +} +.caption{ + text-align:center; + font-style:italic; + margin-bottom:1em; + margin-top:.2em; + font-size:.8em; +} +blockquote > p{ + text-indent:0; + margin-bottom:1em; +} +img{ + display:block; + margin-left: auto; + margin-right: auto; + text-align:center; + margin-top:1em; +} diff --git a/doc/man/epub.xsl b/doc/man/epub.xsl new file mode 100644 index 00000000..bc1d4b3f --- /dev/null +++ b/doc/man/epub.xsl @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/doc/man/html.xsl b/doc/man/html.xsl index 71a847a3..864af882 100644 --- a/doc/man/html.xsl +++ b/doc/man/html.xsl @@ -51,5 +51,9 @@ reference title set toc,title + + + + diff --git a/doc/man/pdf.xsl b/doc/man/pdf.xsl index 652975f0..f3141030 100644 --- a/doc/man/pdf.xsl +++ b/doc/man/pdf.xsl @@ -67,5 +67,8 @@ set toc,title - + + + + diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 3f47b470..82c782d2 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -60,6 +60,9 @@ version &buildversion; + + + SCons &buildversion; diff --git a/doc/user/MANIFEST b/doc/user/MANIFEST index e5f8988f..62da288d 100644 --- a/doc/user/MANIFEST +++ b/doc/user/MANIFEST @@ -51,7 +51,7 @@ variants.xml variables.xml *.jpg *.xsl -scons.css +*.css SConstruct titlepage/bricks.jpg titlepage/mapnik_final_colors.svg diff --git a/doc/user/SConstruct b/doc/user/SConstruct index 002aea4f..5d36a5e9 100644 --- a/doc/user/SConstruct +++ b/doc/user/SConstruct @@ -27,7 +27,7 @@ import os env = Environment(ENV={'PATH' : os.environ['PATH']}, - tools=['docbook'], + tools=['docbook','gs','zip'], toolpath=['../../src/engine/SCons/Tool'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_HTMLCHUNKED='chtml.xsl', @@ -51,3 +51,23 @@ env.DocbookHtml('index.html','scons_db.xml') env.DocbookHtmlChunked('index.html', 'scons_db.xml', base_dir='scons-user/') if has_pdf: env.DocbookPdf('scons-user.pdf','scons_db.xml') + +has_gs = False +if env.WhereIs('gs'): + has_gs = True + +# +# Create the EPUB format +# +if has_gs and has_pdf: + metainf = env.Command('META-INF','',[Mkdir('META-INF'), Mkdir('OEBPS')]) + css = env.Command('OEBPS/epub.css','epub.css',[Copy('OEBPS/epub.css','epub.css')]) + env.Depends(css, metainf) + jpg = env.Gs('OEBPS/cover.jpg','scons-user.pdf', + GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q') + env.Depends(jpg, metainf) + oebps = env.DocbookXslt('OEBPS/toc.ncx', 'scons_db.xml', xsl='epub.xsl') + env.Depends(oebps, jpg) + env.Zip('scons-user.epub', 'OEBPS', ZIPFLAGS='-Xr9D') + env.Clean(oebps, Glob('OEBPS/*.*')) + env.Clean(oebps, Glob('META-INF/*.*')) diff --git a/doc/user/chtml.xsl b/doc/user/chtml.xsl index fa01b464..e292c88e 100644 --- a/doc/user/chtml.xsl +++ b/doc/user/chtml.xsl @@ -52,5 +52,9 @@ reference toc,title set toc,title + + + + diff --git a/doc/user/cover.jpg b/doc/user/cover.jpg new file mode 100644 index 00000000..e2c2cb39 Binary files /dev/null and b/doc/user/cover.jpg differ diff --git a/doc/user/epub.css b/doc/user/epub.css new file mode 100644 index 00000000..31cebe54 --- /dev/null +++ b/doc/user/epub.css @@ -0,0 +1,33 @@ +/* This defines styles and classes used in the book */ +body { } +code { font-family: monospace; } +h1, h2, h3, h4, h5, h6 { text-align: center; margin-bottom:2em;} +h1.title { } +h2.author { } +p{ + padding:0; + margin:0; + text-indent:2em; +} +blockquote{ + margin-left:3em; + margin-right:3em; +} +.caption{ + text-align:center; + font-style:italic; + margin-bottom:1em; + margin-top:.2em; + font-size:.8em; +} +blockquote > p{ + text-indent:0; + margin-bottom:1em; +} +img{ + display:block; + margin-left: auto; + margin-right: auto; + text-align:center; + margin-top:1em; +} diff --git a/doc/user/epub.xsl b/doc/user/epub.xsl new file mode 100644 index 00000000..6ff435ce --- /dev/null +++ b/doc/user/epub.xsl @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/doc/user/html.xsl b/doc/user/html.xsl index 74ea5296..c275c3d1 100644 --- a/doc/user/html.xsl +++ b/doc/user/html.xsl @@ -51,5 +51,9 @@ reference toc,title set toc,title + + + + diff --git a/doc/user/main.xml b/doc/user/main.xml index cb516e14..60dd8c92 100644 --- a/doc/user/main.xml +++ b/doc/user/main.xml @@ -85,6 +85,7 @@ version &buildversion; + diff --git a/doc/user/pdf.xsl b/doc/user/pdf.xsl index 652975f0..9c545925 100644 --- a/doc/user/pdf.xsl +++ b/doc/user/pdf.xsl @@ -67,5 +67,9 @@ set toc,title + + + + -- cgit v1.2.1 From df6504117902e279c34566b29f14f7ae932d5532 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Mon, 4 Nov 2013 10:15:12 +0000 Subject: Add some information about --warn=target-not-built to the troubleshooting page. --- doc/generated/examples/troubleshoot_explain1_3.xml | 7 +++++++ doc/user/troubleshoot.xml | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 doc/generated/examples/troubleshoot_explain1_3.xml (limited to 'doc') diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml new file mode 100644 index 00000000..b62be879 --- /dev/null +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -0,0 +1,7 @@ + +% scons -Q --warn=target-not-built +scons: building `file.out' because it doesn't exist +cp file.in file.oout + +scons: warning: Cannot find target file.out after building + diff --git a/doc/user/troubleshoot.xml b/doc/user/troubleshoot.xml index 94af7275..634c7a67 100644 --- a/doc/user/troubleshoot.xml +++ b/doc/user/troubleshoot.xml @@ -2,7 +2,7 @@ %scons; - + %builders-mod; @@ -157,6 +157,17 @@ file.in that something was wrong with the command that we invoked to build it. + + Note that you can also use --warn=target-not-built which checks + whether or not expected targets exist after a build rule is + executed. + + + + + scons -Q --warn=target-not-built + + -- cgit v1.2.1 From e9731f754faf42e8d7323c70dfdf3ede370f984f Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Mon, 4 Nov 2013 10:21:47 +0000 Subject: Fix a missing which became didn't become apparent till I created the pull request. --- doc/user/troubleshoot.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/user/troubleshoot.xml b/doc/user/troubleshoot.xml index 634c7a67..b6098551 100644 --- a/doc/user/troubleshoot.xml +++ b/doc/user/troubleshoot.xml @@ -157,6 +157,8 @@ file.in that something was wrong with the command that we invoked to build it. + + Note that you can also use --warn=target-not-built which checks whether or not expected targets exist after a build rule is -- cgit v1.2.1 From ad2ddfc3467f09ecb0db22467729398d3d74a927 Mon Sep 17 00:00:00 2001 From: Tom Tanner Date: Mon, 4 Nov 2013 10:24:31 +0000 Subject: Another problem with tags. --- doc/user/troubleshoot.xml | 3 --- 1 file changed, 3 deletions(-) (limited to 'doc') diff --git a/doc/user/troubleshoot.xml b/doc/user/troubleshoot.xml index b6098551..65c91994 100644 --- a/doc/user/troubleshoot.xml +++ b/doc/user/troubleshoot.xml @@ -165,13 +165,10 @@ file.in executed. - scons -Q --warn=target-not-built - - The &debug-explain; option also comes in handy -- cgit v1.2.1 From 89122015d5a9a3c87fcba3e4ffc7538419f5aee4 Mon Sep 17 00:00:00 2001 From: Dirk Baechle Date: Sat, 21 Dec 2013 01:24:25 +0100 Subject: - added EPUB Builder to the DocBook Tool, based on the work of Andrew Featherstone --- doc/generated/builders.gen | 26 ++++++++++++++++++++++++++ doc/generated/builders.mod | 4 ++++ doc/generated/functions.gen | 22 ++++++++++++++++++++++ doc/generated/functions.mod | 4 ++++ doc/generated/tools.gen | 5 +++-- doc/generated/variables.gen | 9 +++++++++ doc/generated/variables.mod | 2 ++ doc/man/SConstruct | 11 ++--------- doc/user/SConstruct | 11 ++--------- 9 files changed, 74 insertions(+), 20 deletions(-) (limited to 'doc') diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index 5cd92f21..41239d4f 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -82,6 +82,32 @@ env.CXXFile(target = 'foo.cc', source = 'foo.ll') # builds bar.cc env.CXXFile(target = 'bar', source = 'bar.yy') + + + + + DocbookEpub() + + + env.DocbookEpub() + + + +A pseudo-Builder, providing a Docbook toolchain for EPUB output. + + +env = Environment(tools=['docbook']) +env.DocbookEpub('manual.epub', 'manual.xml') + + + +or simply + + +env = Environment(tools=['docbook']) +env.DocbookEpub('manual') + + diff --git a/doc/generated/builders.mod b/doc/generated/builders.mod index b8c7d802..50591b45 100644 --- a/doc/generated/builders.mod +++ b/doc/generated/builders.mod @@ -11,6 +11,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. CFile"> Command"> CXXFile"> +DocbookEpub"> DocbookHtml"> DocbookHtmlChunked"> DocbookHtmlhelp"> @@ -65,6 +66,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.CFile"> env.Command"> env.CXXFile"> +env.DocbookEpub"> env.DocbookHtml"> env.DocbookHtmlChunked"> env.DocbookHtmlhelp"> @@ -129,6 +131,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. CFile"> Command"> CXXFile"> +DocbookEpub"> DocbookHtml"> DocbookHtmlChunked"> DocbookHtmlhelp"> @@ -183,6 +186,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.CFile"> env.Command"> env.CXXFile"> +env.DocbookEpub"> env.DocbookHtml"> env.DocbookHtmlChunked"> env.DocbookHtmlhelp"> diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index 4849ac6d..072b91ca 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -3417,6 +3417,28 @@ on the user's screen as follows: Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) + + + + + Pseudo(target, ...) + + + env.Pseudo(target, ...) + + + +This indicates that each given +target +should not be created by the build rule, and if the target is created, +an error will be generated. This is similar to the gnu make .PHONY +target. However, in the vast majority of cases, an +Alias +is more appropriate. + +Multiple targets can be passed in to a single call to +Pseudo. + diff --git a/doc/generated/functions.mod b/doc/generated/functions.mod index 0f5dd21a..99aaa480 100644 --- a/doc/generated/functions.mod +++ b/doc/generated/functions.mod @@ -71,6 +71,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. PrependENVPath"> PrependUnique"> Progress"> +Pseudo"> RCS"> Replace"> Repository"> @@ -158,6 +159,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.PrependENVPath"> env.PrependUnique"> env.Progress"> +env.Pseudo"> env.RCS"> env.Replace"> env.Repository"> @@ -255,6 +257,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. PrependENVPath"> PrependUnique"> Progress"> +Pseudo"> RCS"> Replace"> Repository"> @@ -342,6 +345,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.PrependENVPath"> env.PrependUnique"> env.Progress"> +env.Pseudo"> env.RCS"> env.Replace"> env.Repository"> diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index 7d756381..a0a709e9 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -222,7 +222,7 @@ accordingly. The rules given above are valid for the Builders DocbookHtml, -DocbookPdf, DocbookSlidesPdf and DocbookXInclude. For the +DocbookPdf, DocbookEpub, DocbookSlidesPdf and DocbookXInclude. For the DocbookMan transformation you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. @@ -261,6 +261,7 @@ variables for setting the default XSL name is provided. These are: DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF +DOCBOOK_DEFAULT_XSL_EPUB DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML @@ -272,7 +273,7 @@ DOCBOOK_DEFAULT_XSL_SLIDESHTML DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') env.DocbookHtml('manual') # now uses html.xsl -Sets: &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. +Sets: &cv-link-DOCBOOK_DEFAULT_XSL_EPUB;, &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. dvi diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index ee5a0dd7..efdac8ef 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -907,6 +907,15 @@ into a Dir instance relative to the target being built. A function that converts a list of strings into a list of Dir instances relative to the target being built. + + + + DOCBOOK_DEFAULT_XSL_EPUB + + +The default XSLT file for the DocbookEpub builder within the +current environment, if no other XSLT gets specified via keyword. + diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 8a898ec3..b55b2188 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -70,6 +70,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $DESCRIPTION_lang"> $Dir"> $Dirs"> +$DOCBOOK_DEFAULT_XSL_EPUB"> $DOCBOOK_DEFAULT_XSL_HTML"> $DOCBOOK_DEFAULT_XSL_HTMLCHUNKED"> $DOCBOOK_DEFAULT_XSL_HTMLHELP"> @@ -651,6 +652,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $DESCRIPTION_lang"> $Dir"> $Dirs"> +$DOCBOOK_DEFAULT_XSL_EPUB"> $DOCBOOK_DEFAULT_XSL_HTML"> $DOCBOOK_DEFAULT_XSL_HTMLCHUNKED"> $DOCBOOK_DEFAULT_XSL_HTMLHELP"> diff --git a/doc/man/SConstruct b/doc/man/SConstruct index cfdbb2d5..927bfa24 100644 --- a/doc/man/SConstruct +++ b/doc/man/SConstruct @@ -62,14 +62,7 @@ if env.WhereIs('gs'): # Create the EPUB format # if has_gs and has_pdf: - metainf = env.Command('META-INF','',[Mkdir('META-INF'), Mkdir('OEBPS')]) - css = env.Command('OEBPS/epub.css','epub.css',[Copy('OEBPS/epub.css','epub.css')]) - env.Depends(css, metainf) jpg = env.Gs('OEBPS/cover.jpg','scons-scons.pdf', GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q') - env.Depends(jpg, metainf) - oebps = env.DocbookXslt('OEBPS/toc.ncx', 'scons_db.xml', xsl='epub.xsl') - env.Depends(oebps, jpg) - env.Zip('scons-man.epub', 'OEBPS', ZIPFLAGS='-Xr9D') - env.Clean(oebps, Glob('OEBPS/*.*')) - env.Clean(oebps, Glob('META-INF/*.*')) + epub = env.DocbookEpub('scons-man.epub', 'scons_db.xml', xsl='epub.xsl') + env.Depends(epub, jpg) diff --git a/doc/user/SConstruct b/doc/user/SConstruct index 5d36a5e9..701fb7bc 100644 --- a/doc/user/SConstruct +++ b/doc/user/SConstruct @@ -60,14 +60,7 @@ if env.WhereIs('gs'): # Create the EPUB format # if has_gs and has_pdf: - metainf = env.Command('META-INF','',[Mkdir('META-INF'), Mkdir('OEBPS')]) - css = env.Command('OEBPS/epub.css','epub.css',[Copy('OEBPS/epub.css','epub.css')]) - env.Depends(css, metainf) jpg = env.Gs('OEBPS/cover.jpg','scons-user.pdf', GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -dJPEGQ=100 -r72x72 -q') - env.Depends(jpg, metainf) - oebps = env.DocbookXslt('OEBPS/toc.ncx', 'scons_db.xml', xsl='epub.xsl') - env.Depends(oebps, jpg) - env.Zip('scons-user.epub', 'OEBPS', ZIPFLAGS='-Xr9D') - env.Clean(oebps, Glob('OEBPS/*.*')) - env.Clean(oebps, Glob('META-INF/*.*')) + epub = env.DocbookEpub('scons-user.epub', 'scons_db.xml', xsl='epub.xsl') + env.Depends(epub, jpg) -- cgit v1.2.1