1 # Copyright 2008, Google Inc.
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
14 # * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 '$SOURCE_ROOT/googleclient',
37 # So we can use generated things with paths from googleclient.
38 # TODO: figure out a better way to do this.
43 if env['TARGET_PLATFORM'] != 'WINDOWS':
50 # TODO: clean this up more
54 if env.Bit('windows'):
55 sdl_dll += sdl_env.Replicate('$STAGING_DIR', '$SDL_DIR/lib/SDL.dll')
56 sdl_dll += sdl_env.Replicate('.', '$SDL_DIR/lib/SDL.dll')
58 sdl_dll += sdl_env.Replicate('$TARGET_ROOT/Frameworks',
59 '$SDL_DIR/SDL.framework')
60 sdl_dll += sdl_env.Replicate('$OBJ_ROOT/Frameworks', '$SDL_DIR/SDL.framework')
61 elif env.Bit('linux'):
62 sdl_dll += sdl_env.Replicate('$STAGING_DIR', '$SDL_DIR/lib/libSDL-1.2.so.0')
63 sdl_dll += sdl_env.Replicate('.', '$SDL_DIR/lib/libSDL-1.2.so.0')
65 # Make a copy of debug CRT for now.
66 # TODO: there should be a better way to generalize this requirement.
68 if env.AllBits('windows', 'debug'):
69 for i in ['.', '$STAGING_DIR']:
70 crt += env.Replicate(i, '$VC80_DIR/vc/redist/Debug_NonRedist/'
71 'x86/Microsoft.VC80.DebugCRT')
72 crt += env.Replicate(i, '$VC80_DIR/vc/redist/x86/Microsoft.VC80.CRT')
75 # Isolate the environment for ncdecode_table to prevent a cycle.
76 env_decode_table = env.Clone()
77 env_decode_table['COVERAGE_LINKCOM_EXTRAS'] = None
78 ncdecode_table = env_decode_table.ComponentProgram('ncdecode_table',
80 env.Requires(ncdecode_table, crt)
81 env.Requires(ncdecode_table, sdl_dll)
83 # Link everyone else to ncvalidate.
84 env.Append(LIBS = ['ncvalidate', 'ncvtest'])
97 env.ComponentLibrary('ncvalidate', ncvalidate_inputs)
98 env.ComponentLibrary('ncvtest', ncv_test_inputs)
101 ['native_client/ncv/ncdecodetab.h', 'native_client/ncv/ncdisasmtab.h'],
103 'cd ${TARGET.dir} && ${SOURCE.abspath}')
105 nacl_cpuid = env.ComponentProgram('nacl_cpuid', 'nacl_cpuid_test.c')
106 env.Requires(nacl_cpuid, crt)
107 env.Requires(nacl_cpuid, sdl_dll)
109 env.ComponentProgram('ncdis', 'ncdis.c')
110 ncval = env.ComponentProgram('ncval', ['ncval.c', 'ncval_tests.c'])
111 env.Requires(ncval, crt)
112 env.Requires(ncval, sdl_dll)
115 # TODO: get OSX and Windows working below here
116 if env['TARGET_PLATFORM'] in ['WINDOWS', 'MAC']:
120 node = env.Command('nacl_cpuid_test.out',
122 '${SOURCES[0].abspath} > ${TARGET}')
124 env.ComponentTestOutput('cpuid_test', node)
126 env.AddNodeToLargeTestsSuite(node)