Commit Graph

155 Commits

Author SHA1 Message Date
ArdaFu 099062de78 [tools][building] Add ASFLAGS in DefineGroup. 2018-06-04 14:18:31 +08:00
Bernard Xiong 9f0998abb8 [Tools] Remove `scons --test` argument. 2018-05-31 09:58:35 +08:00
Bernard Xiong fd0ae67289 [Tools] Add target=vsc in building script. 2018-05-30 18:01:24 +08:00
Bernard Xiong 6ac213d622 Add GCC version detection.
Add cconfig.h file for different version of GCC, which is automatically
detected and generated by scons script.
2018-05-14 21:37:11 +08:00
Bernard Xiong 74d045093b [tools] Fix the sys.path issue in IARVersion. 2018-04-15 14:39:35 +08:00
aozima 0d1f75453b update scons script: strict SrcRemove() match rule. 2018-04-07 17:50:14 +08:00
Bernard Xiong 15fa3084c3 [Kernel] include finsh.h file in rtthread.h when RT_USING_FINSH enable 2018-03-01 18:12:49 +08:00
Bernard Xiong c472533f02 [Tools] Add _REENT_SMALL definition when enable nano-newlib 2018-01-16 20:21:40 +08:00
bernard bc6703d0be [Tools] Add useconfig option for scons. 2017-12-29 22:26:39 +08:00
bernard c0b2a1a4b4 [Tools] Add g++ link patch when enble C++. 2017-12-02 10:53:19 +08:00
Bernard Xiong 89afad784c [Tools] Add menuconfig script 2017-11-30 19:56:05 +08:00
bernard adfb73cd8c [Tools] Fix the abspath issue of Rtt_Root in building.py. 2017-11-25 07:37:07 +08:00
MurphyZhao 7b2628393b [tools/building.py][Fix] Add `do_copy_file` function form `mkdist` 2017-11-13 14:15:16 +08:00
Bernard Xiong 5293dddd00 [Tools] Remove menuconfig command in scons 2017-11-06 14:01:48 +08:00
bernard 6f6dd80103 [Tools] Add scons --dist command. 2017-11-04 17:39:45 +08:00
bernard f08d1f5034 [Tools] Add genconfig command in scons. 2017-11-02 16:57:17 +08:00
aozima a1902f2de0 update SrcRemove(): auto detect string or file object. 2017-10-24 09:49:48 +08:00
Bernard Xiong a7c4a23c67 [tools] add --menuconfig option for scons 2017-01-31 13:22:56 +00:00
Bernard Xiong 4730a45ab3 [tools] Add LocalOption routines. 2016-10-28 22:12:24 +08:00
onelife aee3a1d4c5 SCons PreProcessor patch: Stop processing "#define" in false condition
Example "rtconfig.h" content:
 ...
 //#define BOARD_USING_LED
 #if defined(BOARD_USING_LED)
 #define RT_USING_RTGUI
 #endif
 ...

- Before patching, RTGUI module will be built although not intend to do so.
- After patching, RTGUI module will not be built.
2016-03-08 01:42:01 +08:00
Bernard Xiong 1086f6cfa0 [Tools] Fix the buildlib with LOCAL_* options group 2015-10-14 11:07:42 +08:00
Bernard Xiong 2e2886168e [Tools] Add win32 spawn patch for module building. 2015-10-11 15:34:32 +08:00
Bernard Xiong fc54a74abb [BSP] stm32f7-disco cleanup 2015-08-09 09:17:28 +08:00
Bernard Xiong 1a5c579e71 [Tools] merge local modification 2015-08-09 00:03:40 +08:00
Bernard Xiong 804e23a3aa [tools] fix the list in list issue when use LOCAL_* options 2015-08-04 09:43:27 +08:00
Bernard Xiong 0af2be6b5d [Tools] Add LOCAL_* options for group definition 2015-07-27 10:34:53 +08:00
Bernard Xiong f5217d6a9c [Tools] Add LOCAL_* options for group definition 2015-07-25 23:50:17 +08:00
Bernard Xiong 448f9c9a7a [tools] Fix ua target issue. 2015-05-04 22:04:01 +08:00
Bernard Xiong 1f95de43aa [tools] Add package.json as building script 2015-04-10 06:35:59 +00:00
Grissiom 43e020d481 building: PrepareBuilding forgot to declare BuildOptions as global
The global variables in the building.py are totally a pile of shit.
2015-03-18 15:50:10 +08:00
Bernard Xiong 1d23ce6cbd [Tools] Add bsp_directory.
Add bsp_directory for PrepareModuleBuilding function and module building environment can parse rtconfig.h too.
2015-03-14 09:46:37 +08:00
Bernard Xiong 950c3a4298 [Tools] Add copyright information for scons script files 2015-01-23 14:34:09 +08:00
Bright Pan 777d3c059b Add mdk5 support in SCons tools 2014-11-19 14:57:10 +08:00
Bright Pan 06f8426f59 Delete trailing whitespace 2014-11-19 14:52:36 +08:00
Grissiom 767720c1f7 SCons: allow set object files in DefineGroup
The source files can be the raw file names end with .c or .o. So return
the raw file names is more flexible than wrap them with Object.
2014-11-18 17:08:21 +08:00
Grissiom d33df46f19 tools: fix SrcRemove on empty src
If the src is empty list, it will crash at:

    IndexError: list index out of range:
      File "/home/xxx/src/SConstruct", line 39:
        objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=True)
      ...
      File "/home/xxx/src/drivers/SConscript", line 12:
        SrcRemove(src, src_need_remove)
      File "/home/rt-thread-stable/tools/building.py", line 496:
        if type(src[0]) == type('str'):
2014-10-08 18:03:12 +08:00
Grissiom 2c5eea4c21 tools: preserve the order of CPPPATH/CPPDEFINES/LIBPATH/LIBS
The order of them are important while the uniqueness has nothing to do
with the compiling.
2014-10-08 12:22:30 +08:00
Xiongfei Guo a1beec4ad3 Remove unsupport syntex for python 2.6.
Dict Comprehensions is imported in Python 2.7 & 3.0 which is PEP 274 [1]. Some
OS like CentOS 6 which is use Python 2.6 cannot support this syntex.

[1] http://legacy.python.org/dev/peps/pep-0274/

Signed-off-by: Xiongfei Guo <xfguo@credosemi.com>
2014-09-06 14:33:46 +08:00
Grissiom 51c4a3aeae tools/building: remove the use of startupinfo
The startupinfo does not have any visible effects on the building
process and some old Python version does not have it at all. So remove
it for the seek of simple.

Tested `scons -j4` in a dual core virtual machine.
2014-09-01 10:11:10 +08:00
Grissiom af3dc0e63e tools/building.py: more descriptive on error
Print the command that failed to execute and try to tell the reason to
fall.
2014-06-09 11:35:36 +08:00
Grissiom 66ac9821de Scons: fix the Win32Spawn
Windows(tm) CreateProcess does not use the env passed to it to find the
executables. So we have to modify our own PATH to make Popen work. Also,
detect the cmd build-in commands and execute it directly.

Tested on MDK toolchain on RB4088 and the MSVS toolchain on simulator
BSP.
2014-05-24 13:04:49 +08:00
Grissiom 81b284b316 scons: no need to set RTT_ROOT as Repository
In SCons manual:

=================
In order to inform the C compiler about the repositories,  SCons will
add appropriate -I flags to the compilation commands for each directory
in the $CPPPATH list. So if we add the current directory to the
construction environment $CPPPATH like so:

    env = Environment(CPPPATH = ['.'])
    env.Program('hello.c')
    Repository('/usr/repository1')

Then re-executing SCons yields:

    % scons -Q
    cc -o hello.o -c -I. -I/usr/repository1 hello.c
    cc -o hello hello.o
=================

The additional include directory is definitely not what we want. Just
remove the additional Repository line.
2014-04-10 15:09:20 +08:00
Grissiom a03816ef9a scons: seperate the BSP build with the kernel build
BSPs could have their own components/ etc. If they point to the same
folder, SCons would find the wrong source code to compile.
2014-04-10 15:03:11 +08:00
bernard 6289a1aa25 Add UA building script. 2014-03-24 14:50:47 +08:00
Bernard Xiong 3d80e414ff [JS] fix the include path issue 2014-02-25 13:43:59 +08:00
bernard 5ce39b8ad8 [scons] Add the library to the group when used buildlib building 2014-02-23 00:08:38 +08:00
Bernard Xiong fd4554392a [scons] Use a single path for group (ci build) 2014-02-16 16:36:54 +08:00
bernard fb6b1c2520 [scons] fix library suffix issue. 2014-02-15 10:29:35 +08:00
bernard 07f8375783 Add more feature on buildlib 2014-02-07 23:23:44 +08:00
prife 821ab3b9aa scons script: support to generate vs2012 project xml
rename template.vcproj to template_vs2005.vcproj
add template_vs2012.vcxproj
NOTE: the vs2012.py is ugly, just can work.
2013-10-01 15:37:34 +08:00
Grissiom 3b4f3f5931 Scons: run `clang -Wall -fsyntax-only` in clang-analyze
The `clang -fsyntax-only` will give us additional warning messages in
the console.
2013-09-07 15:15:47 +08:00
bernard dce51ddf05 add buildlib for Keil MDK 2013-08-09 22:26:22 +08:00
Grissiom 34027e65e3 building.py: add clang static analyzer support
It adds the '--clang-analyzer' option that could invoke clang as the
static code checker. It is recommanded to work with 'scan-build' shipped
with Clang. For example, `scan-build scons --clang-analyzer`.
2013-07-09 21:08:36 +08:00
Grissiom 3ee4a18506 tools: add an option to generate cscope database
When --cscope option is given to Scons, it will generate a cscope
cross-reference database in current directory, which is useful in
Vim(and other cscope-aware text editors). For example, `scons -s
--cscope` will do nothing except generating the database. You can use
this option with other options together.

It is inspired by the `make cscope` of Linux.
2013-06-19 18:02:03 +08:00
Rogerz Zhang 158e9cdf91 add more command string for scons 2013-03-31 23:05:04 +08:00
prife cc3684847f tools script: fix up mdk460 link error 2013-03-01 02:27:32 +08:00
Grissiom c24c4f8e16 building.py: append messed up objs list, use extend to avoid that
The return type of SConscript is a subclass of UserList. We should use
extend to keep the depth of the list is always 1 when concatenate
SConscript return values. Thanks prife for making me realize that this
is really a problem.

Reported-and-Tested-by: prife
2013-02-24 23:29:27 +08:00
aozima 7bec8a242b update scons: support C::B 2013-02-21 17:37:30 +08:00
Rogerz Zhang 2f6bf3b5ec Rename `--default-comstr` to `--verbose` 2013-01-29 16:54:03 +08:00
Rogerz Zhang 8dcb8a6af6 Use customized command string in scons 2013-01-19 21:55:08 +08:00
xiongyihui3@gmail.com 5811daec0c add compability with MDK 4.6 which changes directory of armcc.exe
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2479 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-12-13 05:24:41 +00:00
goprife@gmail.com 877d1b38b0 support header files addition for vs script
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2461 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-12-01 07:01:55 +00:00
bernard.xiong 0d77b327a9 Add Visual Studio project generation script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2398 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-11-07 23:02:25 +00:00
bernard.xiong@gmail.com 42e003ac4d Fix LIBS and LIBPATH merge in building script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2393 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-11-05 06:58:25 +00:00
chaos.proton@gmail.com 66c5a05e62 building.py: add RegisterPreBuildingAction
One could register a callable object(normally a function) via RegisterPreBuildingAction in SConscript. It will be called when PreBuilding get invoked. PreBuilding should be called before the building procedure. It is currently used by RTGUI to generate the minimal perfect hash code when all the source files are scanned(i.e. just before building).

Maybe we should invoke PreBuilding in DoBuilding.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2353 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-10-15 13:16:35 +00:00
bernard.xiong@gmail.com 4cb779d743 Update GlobSubDir() function.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2321 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-10-06 03:01:02 +00:00
bernard.xiong 7cc241301a Add GlobSubDir() function in building.py; Fix the import issue in wizard.py.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2320 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-10-06 00:12:38 +00:00
bernard.xiong@gmail.com 3816661798 Add buildlib option; Add wizard script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2316 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-10-05 13:18:00 +00:00
wuyangyong 52fdfa1bf8 add GetConfigValue() by Grissiom.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2284 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-09-09 04:10:14 +00:00
bernard.xiong@gmail.com 8e95bc94b6 add --copy-header option to copy header of RT-Thread to local.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2257 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-08-22 06:19:04 +00:00
bernard.xiong@gmail.com 7472bfded3 Add MakeCopy function on the building script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2252 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-08-11 08:43:47 +00:00
bernard.xiong@gmail.com f6df9adbb2 fix the win32 path issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2244 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-08-01 07:33:58 +00:00
bernard.xiong@gmail.com dddbd5078b Fix the GNU GCC path issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2241 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-07-31 23:15:51 +00:00
chaos.proton@gmail.com 8cf479caaa add "remove_components" feature
If one do not want to use some components in the RTT_ROOT, it can pass a remove_components=['the_component'] parameter to PrepareBuilding. Sample code is:

RTT_RTGUI = os.getenv('RTT_RTGUI')
# if GUI dir is set to other place, don't use the one in RTT_ROOT
if RTT_RTGUI:
    # prepare building environment
    objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False, remove_components=['rtgui'])
    objs += SConscript(os.path.join(RTT_RTGUI, 'SConscript'))
else:
    objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

You can safely omit the parameter if you do not want to remove any components.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2227 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-07-22 11:17:04 +00:00
bernard.xiong@gmail.com 9e884249b4 fixed RTT_ROOT directory issue if there is a components directory under BSP.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1972 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-02-19 09:25:34 +00:00
bernard.xiong@gmail.com 3fd6fd1f05 cleanup the building script in tools.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1970 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-02-19 09:11:35 +00:00
bernard.xiong@gmail.com 4cc052e155 fix GNU GCC path issue in building script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1953 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-02-17 09:20:33 +00:00
bernard.xiong@gmail.com cc2ce9fa40 fix print out warning information when use GCC as compiler.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1952 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-02-17 00:41:19 +00:00
goprife@gmail.com e1b5d48c9b fix bugs in building.py that is when DefineGroup method's 3rd arges "CPPDEFINES" is not null, then "scons --target=mdk -s" will get errors.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1930 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-01-31 01:41:14 +00:00
bernard.xiong@gmail.com a5a7c47d04 add merge group function.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1832 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-12-10 15:31:55 +00:00
bernard.xiong@gmail.com 6bd0252e26 update SrcRemove function in building script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1830 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-12-10 13:14:26 +00:00
goprife@gmail.com 819fd97ff8 add source remove method
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1816 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-11-29 03:49:14 +00:00
chaos.proton@gmail.com f8bbcf9aef if --target is set, adjust CROSS_TOOL and PLATFORM automatically
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1792 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-11-09 02:42:48 +00:00
bernard.xiong@gmail.com 6aa93f460a fixed file name with Chinese encoding issue, which is merged from chaos.proton@gmail.com.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1779 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-10-30 00:44:18 +00:00
qiuyiuestc@gmail.com 02c43b16b0 add PrepareModuleBuilding function
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1736 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-10-04 01:05:11 +00:00
bernard.xiong c3854e20bb fix the output message.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1606 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-07-04 06:39:32 +00:00
bernard.xiong 8dd602108a rollback the command too long patch.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1598 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-07-04 04:06:38 +00:00
bernard.xiong 64b1c01fe0 MDK4 project generation can support same named file in project.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1567 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-07-01 08:22:47 +00:00
bernard.xiong@gmail.com 0af1367525 add '#define DD 0' support.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1553 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-29 15:18:51 +00:00
bernard.xiong 42d3a22e90 add GetCurrentDir function to get a SConscript directory.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1544 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-29 05:15:31 +00:00
bernard.xiong 06b8498d63 add IAR project file generation.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1537 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-24 09:05:40 +00:00
bernard.xiong 7008612767 support Keil MDK4 project file generation.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1536 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-24 06:16:20 +00:00
qiuyiuestc@gmail.com 28fbe864e4 fix command line too long problem
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1500 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-14 00:20:06 +00:00
mbbill@gmail.com 70bafa328a move net/apps to lwip folder
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1484 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-10 03:57:32 +00:00
bernard.xiong@gmail.com 0513333a10 Add RT_LWIP_VER130, RT_LWIP_VER140 options.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1476 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-09 14:07:59 +00:00
bernard.xiong@gmail.com d84cef41c4 add has_libcpu option in PrepareBuilding function.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1461 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-06-07 16:13:00 +00:00
qiuyiuestc@gmail.com 712aacd367 update rtconfig.h and SConstruct
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1424 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-05-23 01:46:59 +00:00
qiuyiuestc@gmail.com 6a27c24e1e modify DefineGroup function to return librarys
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1418 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-05-18 01:05:52 +00:00
bernard.xiong@gmail.com 62b4ca8d49 update building script.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1381 bbd45198-f89e-11dd-88c7-29a3b14d5316
2011-04-19 13:02:25 +00:00
bernard.xiong@gmail.com 58f21a0179 change output directory to 'build'
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1201 bbd45198-f89e-11dd-88c7-29a3b14d5316
2010-12-13 14:24:40 +00:00