diff options
| author | Andrea Bastoni <bastoni@cs.unc.edu> | 2009-12-13 13:42:28 -0500 |
|---|---|---|
| committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2009-12-13 13:42:28 -0500 |
| commit | a8e360a9c4eda23015e749110cc75c44f6925875 (patch) | |
| tree | 655fcd81a9a00841716dc95a41c7508f0b64ee0d | |
| parent | 05d7c26fbe8ce8edc2e3cb43268d567bdbecae81 (diff) | |
Update Makefile e SConstruct for liblitmus 2010
- add all-32, all-64 targets in Makefile (cross compilation for x86)
- update SConstruct kernel search path
- add architecture dependent include dirs in search path
| -rw-r--r-- | Makefile | 12 | ||||
| -rw-r--r-- | SConstruct | 18 |
2 files changed, 22 insertions, 8 deletions
| @@ -1,7 +1,13 @@ | |||
| 1 | all: | 1 | .PHONY: all-32 all-64 clean purge |
| 2 | echo "Legacy warning: Building is done with scons." | ||
| 3 | scons | ||
| 4 | 2 | ||
| 3 | all-32: | ||
| 4 | echo "Legacy warning: Building is done with scons." | ||
| 5 | ARCH=x86 scons | ||
| 6 | all-64: | ||
| 7 | ARCH=x86_64 scons | ||
| 5 | clean: | 8 | clean: |
| 6 | echo "Legacy warning: Building is now done with scons." | 9 | echo "Legacy warning: Building is now done with scons." |
| 7 | scons -c | 10 | scons -c |
| 11 | |||
| 12 | purge: clean | ||
| 13 | rm -rf .sconf_temp .sconsign.dblite | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | # ##################################################################### | 1 | # ##################################################################### |
| 2 | # User configuration. | 2 | # User configuration. |
| 3 | LITMUS_KERNEL = '../litmus2008' | 3 | LITMUS_KERNEL = '../litmus2010' |
| 4 | 4 | ||
| 5 | # ##################################################################### | 5 | # ##################################################################### |
| 6 | # Internal configuration. | 6 | # Internal configuration. |
| @@ -10,10 +10,9 @@ X86_32_FLAGS = '-m32' | |||
| 10 | X86_64_FLAGS = '-m64' | 10 | X86_64_FLAGS = '-m64' |
| 11 | V9_FLAGS = '-mcpu=v9 -m64' | 11 | V9_FLAGS = '-mcpu=v9 -m64' |
| 12 | SUPPORTED_ARCHS = { | 12 | SUPPORTED_ARCHS = { |
| 13 | 'sparc64' : V9_FLAGS, | 13 | 'sparc64' : V9_FLAGS, |
| 14 | 'i686' : X86_32_FLAGS, | 14 | 'x86' : X86_32_FLAGS, |
| 15 | 'i386' : X86_32_FLAGS, | 15 | 'x86_64' : X86_64_FLAGS, |
| 16 | 'x86_64' : X86_64_FLAGS, | ||
| 17 | } | 16 | } |
| 18 | 17 | ||
| 19 | KERNEL_INCLUDE = '%s/include/' % LITMUS_KERNEL | 18 | KERNEL_INCLUDE = '%s/include/' % LITMUS_KERNEL |
| @@ -58,6 +57,11 @@ if arch not in SUPPORTED_ARCHS: | |||
| 58 | else: | 57 | else: |
| 59 | arch_flags = Split(SUPPORTED_ARCHS[arch]) | 58 | arch_flags = Split(SUPPORTED_ARCHS[arch]) |
| 60 | 59 | ||
| 60 | # add architecture dependent include search path | ||
| 61 | KERNEL_ARCH_INCLUDE = '%s/arch/%s/include' % (LITMUS_KERNEL, arch) | ||
| 62 | INCLUDE_DIRS = INCLUDE_DIRS + ' ' + KERNEL_ARCH_INCLUDE | ||
| 63 | |||
| 64 | # Set Environment | ||
| 61 | env = Environment( | 65 | env = Environment( |
| 62 | CC = 'gcc', | 66 | CC = 'gcc', |
| 63 | CPPPATH = Split(INCLUDE_DIRS), | 67 | CPPPATH = Split(INCLUDE_DIRS), |
| @@ -71,11 +75,15 @@ if not env.GetOption('clean'): | |||
| 71 | # Check for kernel headers. | 75 | # Check for kernel headers. |
| 72 | conf = Configure(env, custom_tests = {'CheckASMLink' : CheckASMLink}) | 76 | conf = Configure(env, custom_tests = {'CheckASMLink' : CheckASMLink}) |
| 73 | if not conf.CheckCHeader('litmus/rt_param.h'): | 77 | if not conf.CheckCHeader('litmus/rt_param.h'): |
| 78 | print 'Env CCFLAGS = %s' % env['CCFLAGS'] | ||
| 79 | print 'Env CPPPATH = %s' % env['CPPPATH'] | ||
| 74 | print "Error: Canot find kernel headers in '%s'." % LITMUS_KERNEL | 80 | print "Error: Canot find kernel headers in '%s'." % LITMUS_KERNEL |
| 75 | print "Please ensure that LITMUS_KERNEL in SConstruct", \ | 81 | print "Please ensure that LITMUS_KERNEL in SConstruct", \ |
| 76 | "contains a valid path." | 82 | "contains a valid path." |
| 77 | Exit(1) | 83 | Exit(1) |
| 78 | if not conf.CheckASMLink(): | 84 | if not conf.CheckASMLink(): |
| 85 | print 'Env CCFLAGS = %s' % env['CCFLAGS'] | ||
| 86 | print 'Env CPPPATH = %s' % env['CPPPATH'] | ||
| 79 | print "Error: The LITMUS^RT syscall numbers are not available." | 87 | print "Error: The LITMUS^RT syscall numbers are not available." |
| 80 | print "Please ensure sure that the kernel in '%s' is configured." \ | 88 | print "Please ensure sure that the kernel in '%s' is configured." \ |
| 81 | % LITMUS_KERNEL | 89 | % LITMUS_KERNEL |
