diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-12-25 09:08:48 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-12-25 09:08:48 -0500 |
| commit | e8f92b2d543fede24283f1d309aeb6aaaefdf6e3 (patch) | |
| tree | b0e033f0415b204de883ba5b985603bb5daf1334 /SConstruct | |
| parent | 7164f71e036afdf053191ff4d6c7a6a9ed4029e8 (diff) | |
new build system: use scons
Diffstat (limited to 'SConstruct')
| -rw-r--r-- | SConstruct | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..cf18b31 --- /dev/null +++ b/SConstruct | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | # ##################################################################### | ||
| 2 | # User configuration. | ||
| 3 | LITMUS_KERNEL = '../litmus2008' | ||
| 4 | |||
| 5 | # ##################################################################### | ||
| 6 | # Internal configuration. | ||
| 7 | DEBUG_FLAGS = '-Wall -g -Wdeclaration-after-statement' | ||
| 8 | API_FLAGS = '-D_XOPEN_SOURCE=600 -D_GNU_SOURCE' | ||
| 9 | |||
| 10 | INCLUDE_DIRS = 'include/ %s/include/' % LITMUS_KERNEL | ||
| 11 | |||
| 12 | # ##################################################################### | ||
| 13 | # Build configuration. | ||
| 14 | from os import uname | ||
| 15 | |||
| 16 | # sanity check | ||
| 17 | (os, _, _, _, arch) = uname() | ||
| 18 | if os != 'Linux': | ||
| 19 | print 'Error: Building liblitmus is only supported on Linux.' | ||
| 20 | Exit(1) | ||
| 21 | |||
| 22 | if arch not in ('sparc64', 'i686'): | ||
| 23 | print 'Error: Building liblitmus is only supported on i686 and sparc64.' | ||
| 24 | Exit(1) | ||
| 25 | |||
| 26 | env = Environment( | ||
| 27 | CC = 'gcc', | ||
| 28 | CPPPATH = Split(INCLUDE_DIRS), | ||
| 29 | CCFLAGS = Split(DEBUG_FLAGS) + Split(API_FLAGS) | ||
| 30 | ) | ||
| 31 | |||
| 32 | if arch == 'sparc64': | ||
| 33 | # build 64 bit sparc v9 binaries | ||
| 34 | env.Append(CCFLAGS = Split('-mcpu=v9 -m64')) | ||
| 35 | |||
| 36 | # link with lib libtmus | ||
| 37 | rt = env.Clone( | ||
| 38 | LIBS = 'litmus', | ||
| 39 | LIBPATH = '.' | ||
| 40 | ) | ||
| 41 | rt.Append(LINKFLAGS = '-static') | ||
| 42 | |||
| 43 | # multithreaded real-time tasks | ||
| 44 | mtrt = rt.Clone() | ||
| 45 | mtrt.Append(LINKFLAGS = '-pthread') | ||
| 46 | |||
| 47 | |||
| 48 | # ##################################################################### | ||
| 49 | # Targets: liblitmus | ||
| 50 | # All the files in src/ are part of the library. | ||
| 51 | env.Library('litmus', Glob('src/*.c')) | ||
| 52 | |||
| 53 | # ##################################################################### | ||
| 54 | # Targets: simple tools that do not depend on liblitmus | ||
| 55 | env.Program('cycles', 'bin/cycles.c') | ||
| 56 | |||
| 57 | # ##################################################################### | ||
| 58 | # Targets: tools that depend on liblitmus | ||
| 59 | rt.Program('base_task', 'bin/base_task.c') | ||
| 60 | mtrt.Program('base_mt_task', 'bin/base_mt_task.c') | ||
| 61 | rt.Program('wait_test', 'bin/wait_test.c') | ||
| 62 | rt.Program('mode_test', 'bin/mode_test.c') | ||
| 63 | rt.Program('np_test', 'bin/np_test.c') | ||
| 64 | rt.Program('rt_launch', ['bin/rt_launch.c', 'bin/common.c']) | ||
| 65 | rt.Program('rtspin', ['bin/rtspin.c', 'bin/common.c']) | ||
| 66 | rt.Program('release_ts', 'bin/release_ts.c') | ||
| 67 | rt.Program('showst', 'bin/showst.c') | ||
