Andrew de los Reyes | 5fdae4a | 2010-10-05 10:47:42 -0700 | [diff] [blame] | 1 | # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Andrew de los Reyes | 1e338b8 | 2010-01-22 14:57:27 -0800 | [diff] [blame] | 5 | import os |
| 6 | |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 7 | # Protobuffer compilation |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 8 | def ProtocolBufferEmitter(target, source, env): |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 9 | """ Inputs: |
| 10 | target: list of targets to compile to |
| 11 | source: list of sources to compile |
| 12 | env: the scons environment in which we are compiling |
| 13 | Outputs: |
| 14 | target: the list of targets we'll emit |
| 15 | source: the list of sources we'll compile""" |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 16 | output = str(source[0]) |
| 17 | output = output[0:output.rfind('.proto')] |
| 18 | target = [ |
| 19 | output + '.pb.cc', |
| 20 | output + '.pb.h', |
| 21 | ] |
| 22 | return target, source |
| 23 | |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 24 | def ProtocolBufferGenerator(source, target, env, for_signature): |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 25 | """ Inputs: |
| 26 | source: list of sources to process |
| 27 | target: list of targets to generate |
| 28 | env: scons environment in which we are working |
| 29 | for_signature: unused |
| 30 | Outputs: a list of commands to execute to generate the targets from |
| 31 | the sources.""" |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 32 | commands = [ |
| 33 | '/usr/bin/protoc ' |
| 34 | ' --proto_path . ${SOURCES} --cpp_out .'] |
| 35 | return commands |
| 36 | |
| 37 | proto_builder = Builder(generator = ProtocolBufferGenerator, |
| 38 | emitter = ProtocolBufferEmitter, |
| 39 | single_source = 1, |
| 40 | suffix = '.pb.cc') |
| 41 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 42 | def DbusBindingsEmitter(target, source, env): |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 43 | """ Inputs: |
| 44 | target: unused |
| 45 | source: list containing the source .xml file |
| 46 | env: the scons environment in which we are compiling |
| 47 | Outputs: |
| 48 | target: the list of targets we'll emit |
| 49 | source: the list of sources we'll process""" |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 50 | output = str(source[0]) |
| 51 | output = output[0:output.rfind('.xml')] |
| 52 | target = [ |
| 53 | output + '.dbusserver.h', |
| 54 | output + '.dbusclient.h' |
| 55 | ] |
| 56 | return target, source |
| 57 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 58 | def DbusBindingsGenerator(source, target, env, for_signature): |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 59 | """ Inputs: |
| 60 | source: list of sources to process |
| 61 | target: list of targets to generate |
| 62 | env: scons environment in which we are working |
| 63 | for_signature: unused |
| 64 | Outputs: a list of commands to execute to generate the targets from |
| 65 | the sources.""" |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 66 | commands = [] |
| 67 | for target_file in target: |
| 68 | if str(target_file).endswith('.dbusserver.h'): |
| 69 | mode_flag = '--mode=glib-server ' |
| 70 | else: |
| 71 | mode_flag = '--mode=glib-client ' |
| 72 | cmd = '/usr/bin/dbus-binding-tool %s --prefix=update_engine_service ' \ |
| 73 | '%s > %s' % (mode_flag, str(source[0]), str(target_file)) |
| 74 | commands.append(cmd) |
| 75 | return commands |
| 76 | |
| 77 | dbus_bindings_builder = Builder(generator = DbusBindingsGenerator, |
| 78 | emitter = DbusBindingsEmitter, |
| 79 | single_source = 1, |
| 80 | suffix = 'dbusclient.h') |
| 81 | |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 82 | def GlibMarshalEmitter(target, source, env): |
| 83 | """ Inputs: |
| 84 | target: unused |
| 85 | source: list containing the source .list file |
| 86 | env: the scons environment in which we are compiling |
| 87 | Outputs: |
| 88 | target: the list of targets we'll emit |
| 89 | source: the list of sources we'll process""" |
| 90 | output = str(source[0]) |
| 91 | output = output[0:output.rfind('.list')] |
| 92 | target = [ |
| 93 | output + '.glibmarshal.c', |
| 94 | output + '.glibmarshal.h' |
| 95 | ] |
| 96 | return target, source |
| 97 | |
| 98 | def GlibMarshalGenerator(source, target, env, for_signature): |
| 99 | """ Inputs: |
| 100 | source: list of sources to process |
| 101 | target: list of targets to generate |
| 102 | env: scons environment in which we are working |
| 103 | for_signature: unused |
| 104 | Outputs: a list of commands to execute to generate the targets from |
| 105 | the sources.""" |
| 106 | commands = [] |
| 107 | for target_file in target: |
| 108 | if str(target_file).endswith('.glibmarshal.h'): |
| 109 | mode_flag = '--header ' |
| 110 | else: |
| 111 | mode_flag = '--body ' |
| 112 | cmd = '/usr/bin/glib-genmarshal %s --prefix=update_engine ' \ |
| 113 | '%s > %s' % (mode_flag, str(source[0]), str(target_file)) |
| 114 | commands.append(cmd) |
| 115 | return commands |
| 116 | |
| 117 | glib_marshal_builder = Builder(generator = GlibMarshalGenerator, |
| 118 | emitter = GlibMarshalEmitter, |
| 119 | single_source = 1, |
| 120 | suffix = 'glibmarshal.c') |
| 121 | |
Darin Petkov | d7061ab | 2010-10-06 14:37:09 -0700 | [diff] [blame] | 122 | # Public key generation |
| 123 | def PublicKeyEmitter(target, source, env): |
| 124 | """ Inputs: |
| 125 | target: list of targets to compile to |
| 126 | source: list of sources to compile |
| 127 | env: the scons environment in which we are compiling |
| 128 | Outputs: |
| 129 | target: the list of targets we'll emit |
| 130 | source: the list of sources we'll compile""" |
| 131 | targets = [] |
| 132 | for source_file in source: |
| 133 | output = str(source_file) |
| 134 | output = output[0:output.rfind('.pem')] |
| 135 | output += '.pub.pem' |
| 136 | targets.append(output) |
| 137 | return targets, source |
| 138 | |
| 139 | def PublicKeyGenerator(source, target, env, for_signature): |
| 140 | """ Inputs: |
| 141 | source: list of sources to process |
| 142 | target: list of targets to generate |
| 143 | env: scons environment in which we are working |
| 144 | for_signature: unused |
| 145 | Outputs: a list of commands to execute to generate the targets from |
| 146 | the sources.""" |
| 147 | commands = [] |
| 148 | for source_file in source: |
| 149 | output = str(source_file) |
| 150 | output = output[0:output.rfind('.pem')] |
| 151 | output += '.pub.pem' |
| 152 | cmd = '/usr/bin/openssl rsa -in %s -pubout -out %s' % (source_file, output) |
| 153 | commands.append(cmd) |
| 154 | return commands |
| 155 | |
| 156 | public_key_builder = Builder(generator = PublicKeyGenerator, |
| 157 | emitter = PublicKeyEmitter, |
| 158 | suffix = '.pub.pem') |
| 159 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 160 | env = Environment() |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 161 | for key in Split('CC CXX AR RANLIB LD NM'): |
| 162 | value = os.environ.get(key) |
| 163 | if value != None: |
| 164 | env[key] = value |
| 165 | for key in Split('CFLAGS CCFLAGS CPPPATH LIBPATH'): |
| 166 | value = os.environ.get(key) |
| 167 | if value != None: |
| 168 | env[key] = Split(value) |
| 169 | |
| 170 | for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH SYSROOT'): |
| 171 | if os.environ.has_key(key): |
| 172 | env['ENV'][key] = os.environ[key] |
| 173 | |
| 174 | |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 175 | env['CCFLAGS'] = ' '.join("""-g |
| 176 | -fno-exceptions |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 177 | -fno-strict-aliasing |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 178 | -Wall |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 179 | -Wclobbered |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 180 | -Wclobbered |
| 181 | -Wempty-body |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 182 | -Wempty-body |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 183 | -Werror |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 184 | -Wignored-qualifiers |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 185 | -Wignored-qualifiers |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 186 | -Wmissing-field-initializers |
| 187 | -Wsign-compare |
| 188 | -Wtype-limits |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 189 | -Wtype-limits |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 190 | -Wuninitialized |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 191 | -D__STDC_FORMAT_MACROS=1 |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 192 | -D_FILE_OFFSET_BITS=64 |
| 193 | -I/usr/include/libxml2""".split()); |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 194 | env['CCFLAGS'] += (' ' + ' '.join(env['CFLAGS'])) |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 195 | |
| 196 | env['LIBS'] = Split("""base |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 197 | bz2 |
Darin Petkov | c91dd6b | 2011-01-10 12:31:34 -0800 | [diff] [blame^] | 198 | cros_boot_mode |
Raymes Khoury | e3d8d4c | 2010-09-17 10:35:54 -0700 | [diff] [blame] | 199 | crypto |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 200 | curl |
Thieu Le | 5c7d975 | 2010-12-15 16:09:28 -0800 | [diff] [blame] | 201 | ext2fs |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 202 | gflags |
| 203 | glib-2.0 |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 204 | gthread-2.0 |
| 205 | libpcrecpp |
Darin Petkov | 9d65b7b | 2010-07-20 09:13:01 -0700 | [diff] [blame] | 206 | metrics |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 207 | protobuf |
| 208 | pthread |
Will Drewry | 8f71da8 | 2010-08-30 14:07:11 -0500 | [diff] [blame] | 209 | rootdev |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 210 | ssl |
| 211 | xml2 |
| 212 | z""") |
Andrew de los Reyes | b70e33d | 2010-08-12 21:49:02 -0700 | [diff] [blame] | 213 | env['CPPPATH'] = ['..'] |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 214 | env['BUILDERS']['ProtocolBuffer'] = proto_builder |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 215 | env['BUILDERS']['DbusBindings'] = dbus_bindings_builder |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 216 | env['BUILDERS']['GlibMarshal'] = glib_marshal_builder |
Darin Petkov | d7061ab | 2010-10-06 14:37:09 -0700 | [diff] [blame] | 217 | env['BUILDERS']['PublicKey'] = public_key_builder |
Colin Watson | f2c29ec | 2010-01-08 18:50:56 +0000 | [diff] [blame] | 218 | |
| 219 | # Fix issue with scons not passing pkg-config vars through the environment. |
| 220 | for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): |
| 221 | if os.environ.has_key(key): |
| 222 | env['ENV'][key] = os.environ[key] |
| 223 | |
Andrew de los Reyes | c702078 | 2010-04-28 10:46:04 -0700 | [diff] [blame] | 224 | env.ParseConfig('pkg-config --cflags --libs ' |
| 225 | 'dbus-1 dbus-glib-1 gio-2.0 gio-unix-2.0 glib-2.0') |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 226 | env.ProtocolBuffer('update_metadata.pb.cc', 'update_metadata.proto') |
Darin Petkov | d7061ab | 2010-10-06 14:37:09 -0700 | [diff] [blame] | 227 | env.PublicKey('unittest_key.pub.pem', 'unittest_key.pem') |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 228 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 229 | env.DbusBindings('update_engine.dbusclient.h', 'update_engine.xml') |
| 230 | |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 231 | env.GlibMarshal('marshal.glibmarshal.c', 'marshal.list') |
| 232 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 233 | if ARGUMENTS.get('debug', 0): |
Andrew de los Reyes | 819fef2 | 2010-12-17 11:33:58 -0800 | [diff] [blame] | 234 | env['CCFLAGS'] += ['-fprofile-arcs', '-ftest-coverage'] |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 235 | env['LIBS'] += ['bz2', 'gcov'] |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 236 | |
| 237 | sources = Split("""action_processor.cc |
Darin Petkov | e971f33 | 2010-09-22 16:57:25 -0700 | [diff] [blame] | 238 | buffered_file_writer.cc |
Andrew de los Reyes | d2135f3 | 2010-03-11 16:00:28 -0800 | [diff] [blame] | 239 | bzip.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 240 | bzip_extent_writer.cc |
Andrew de los Reyes | 9cd120d | 2010-11-18 17:50:03 -0800 | [diff] [blame] | 241 | chrome_proxy_resolver.cc |
Andrew de los Reyes | 35a7af1 | 2010-03-10 16:33:26 -0800 | [diff] [blame] | 242 | cycle_breaker.cc |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 243 | dbus_service.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 244 | decompressing_file_writer.cc |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 245 | delta_diff_generator.cc |
| 246 | delta_performer.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 247 | download_action.cc |
Andrew de los Reyes | b4025e6 | 2010-02-23 17:47:03 -0800 | [diff] [blame] | 248 | extent_mapper.cc |
Andrew de los Reyes | 5fdae4a | 2010-10-05 10:47:42 -0700 | [diff] [blame] | 249 | extent_ranges.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 250 | extent_writer.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 251 | filesystem_copier_action.cc |
| 252 | filesystem_iterator.cc |
| 253 | file_writer.cc |
Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 254 | flimflam_proxy.cc |
Darin Petkov | 7a22d79 | 2010-11-08 14:10:00 -0800 | [diff] [blame] | 255 | full_update_generator.cc |
Andrew de los Reyes | 0ce161b | 2010-02-22 15:27:01 -0800 | [diff] [blame] | 256 | graph_utils.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 257 | gzip.cc |
Andrew de los Reyes | 4516810 | 2010-11-22 11:13:50 -0800 | [diff] [blame] | 258 | http_fetcher.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 259 | libcurl_http_fetcher.cc |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 260 | marshal.glibmarshal.c |
Thieu Le | 5c7d975 | 2010-12-15 16:09:28 -0800 | [diff] [blame] | 261 | metadata.cc |
Andrew de los Reyes | 819fef2 | 2010-12-17 11:33:58 -0800 | [diff] [blame] | 262 | multi_range_http_fetcher.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 263 | omaha_hash_calculator.cc |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 264 | omaha_request_action.cc |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 265 | omaha_request_params.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 266 | omaha_response_handler_action.cc |
Andrew de los Reyes | 0c44005 | 2010-08-20 11:25:54 -0700 | [diff] [blame] | 267 | payload_signer.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 268 | postinstall_runner_action.cc |
Darin Petkov | 3003059 | 2010-07-27 13:53:20 -0700 | [diff] [blame] | 269 | prefs.cc |
Andrew de los Reyes | 9cd120d | 2010-11-18 17:50:03 -0800 | [diff] [blame] | 270 | proxy_resolver.cc |
Andrew de los Reyes | 785bc35 | 2010-05-26 12:34:53 -0700 | [diff] [blame] | 271 | simple_key_value_store.cc |
Andrew de los Reyes | 0cca421 | 2010-04-29 14:00:58 -0700 | [diff] [blame] | 272 | split_file_writer.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 273 | subprocess.cc |
Andrew de los Reyes | 81ebcd8 | 2010-03-09 15:56:18 -0800 | [diff] [blame] | 274 | tarjan.cc |
Darin Petkov | 9c0baf8 | 2010-10-07 13:44:48 -0700 | [diff] [blame] | 275 | terminator.cc |
Andrew de los Reyes | 5815155 | 2010-03-10 20:07:08 -0800 | [diff] [blame] | 276 | topological_sort.cc |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 277 | update_attempter.cc |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 278 | update_check_scheduler.cc |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 279 | update_metadata.pb.cc |
| 280 | utils.cc""") |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 281 | main = ['main.cc'] |
| 282 | |
| 283 | unittest_sources = Split("""action_unittest.cc |
| 284 | action_pipe_unittest.cc |
| 285 | action_processor_unittest.cc |
Darin Petkov | e971f33 | 2010-09-22 16:57:25 -0700 | [diff] [blame] | 286 | buffered_file_writer_unittest.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 287 | bzip_extent_writer_unittest.cc |
Andrew de los Reyes | 9cd120d | 2010-11-18 17:50:03 -0800 | [diff] [blame] | 288 | chrome_proxy_resolver_unittest.cc |
Andrew de los Reyes | 35a7af1 | 2010-03-10 16:33:26 -0800 | [diff] [blame] | 289 | cycle_breaker_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 290 | decompressing_file_writer_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 291 | delta_diff_generator_unittest.cc |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 292 | delta_performer_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 293 | download_action_unittest.cc |
Andrew de los Reyes | b4025e6 | 2010-02-23 17:47:03 -0800 | [diff] [blame] | 294 | extent_mapper_unittest.cc |
Andrew de los Reyes | 5fdae4a | 2010-10-05 10:47:42 -0700 | [diff] [blame] | 295 | extent_ranges_unittest.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 296 | extent_writer_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 297 | file_writer_unittest.cc |
Andrew de los Reyes | c702078 | 2010-04-28 10:46:04 -0700 | [diff] [blame] | 298 | filesystem_copier_action_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 299 | filesystem_iterator_unittest.cc |
Andrew de los Reyes | d57d147 | 2010-10-21 13:34:08 -0700 | [diff] [blame] | 300 | flimflam_proxy_unittest.cc |
Darin Petkov | 7a22d79 | 2010-11-08 14:10:00 -0800 | [diff] [blame] | 301 | full_update_generator_unittest.cc |
Andrew de los Reyes | 0ce161b | 2010-02-22 15:27:01 -0800 | [diff] [blame] | 302 | graph_utils_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 303 | http_fetcher_unittest.cc |
Thieu Le | 5c7d975 | 2010-12-15 16:09:28 -0800 | [diff] [blame] | 304 | metadata_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 305 | mock_http_fetcher.cc |
| 306 | omaha_hash_calculator_unittest.cc |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 307 | omaha_request_action_unittest.cc |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 308 | omaha_request_params_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 309 | omaha_response_handler_action_unittest.cc |
Andrew de los Reyes | 0c44005 | 2010-08-20 11:25:54 -0700 | [diff] [blame] | 310 | payload_signer_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 311 | postinstall_runner_action_unittest.cc |
Darin Petkov | 3003059 | 2010-07-27 13:53:20 -0700 | [diff] [blame] | 312 | prefs_unittest.cc |
Andrew de los Reyes | 785bc35 | 2010-05-26 12:34:53 -0700 | [diff] [blame] | 313 | simple_key_value_store_unittest.cc |
Andrew de los Reyes | 0cca421 | 2010-04-29 14:00:58 -0700 | [diff] [blame] | 314 | split_file_writer_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 315 | subprocess_unittest.cc |
Andrew de los Reyes | 81ebcd8 | 2010-03-09 15:56:18 -0800 | [diff] [blame] | 316 | tarjan_unittest.cc |
Darin Petkov | 80f1956 | 2010-11-19 12:00:15 -0800 | [diff] [blame] | 317 | terminator_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 318 | test_utils.cc |
Andrew de los Reyes | 5815155 | 2010-03-10 20:07:08 -0800 | [diff] [blame] | 319 | topological_sort_unittest.cc |
Darin Petkov | f42cc1c | 2010-09-01 09:03:02 -0700 | [diff] [blame] | 320 | update_attempter_unittest.cc |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 321 | update_check_scheduler_unittest.cc |
Andrew de los Reyes | d2135f3 | 2010-03-11 16:00:28 -0800 | [diff] [blame] | 322 | utils_unittest.cc |
| 323 | zip_unittest.cc""") |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 324 | unittest_main = ['testrunner.cc'] |
| 325 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 326 | client_main = ['update_engine_client.cc'] |
| 327 | |
Andrew de los Reyes | 4fe15d0 | 2009-12-10 19:01:36 -0800 | [diff] [blame] | 328 | delta_generator_main = ['generate_delta_main.cc'] |
| 329 | |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 330 | # Hack to generate header files first. They are generated as a side effect |
| 331 | # of generating other files (usually their corresponding .c(c) files), |
| 332 | # so we make all sources depend on those other files. |
| 333 | all_sources = [] |
| 334 | all_sources.extend(sources) |
| 335 | all_sources.extend(unittest_sources) |
| 336 | all_sources.extend(main) |
| 337 | all_sources.extend(unittest_main) |
| 338 | all_sources.extend(client_main) |
| 339 | all_sources.extend(delta_generator_main) |
| 340 | for source in all_sources: |
Darin Petkov | d7061ab | 2010-10-06 14:37:09 -0700 | [diff] [blame] | 341 | if source.endswith('_unittest.cc'): |
| 342 | env.Depends(source, 'unittest_key.pub.pem') |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 343 | if source.endswith('.glibmarshal.c') or source.endswith('.pb.cc'): |
| 344 | continue |
| 345 | env.Depends(source, 'update_metadata.pb.cc') |
| 346 | env.Depends(source, 'marshal.glibmarshal.c') |
| 347 | env.Depends(source, 'update_engine.dbusclient.h') |
Andrew de los Reyes | 4fe15d0 | 2009-12-10 19:01:36 -0800 | [diff] [blame] | 348 | |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 349 | update_engine_core = env.Library('update_engine_core', sources) |
| 350 | env.Prepend(LIBS=[update_engine_core]) |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 351 | |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 352 | env.Program('update_engine', main) |
| 353 | |
| 354 | client_cmd = env.Program('update_engine_client', client_main); |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 355 | |
| 356 | delta_generator_cmd = env.Program('delta_generator', |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 357 | delta_generator_main) |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 358 | |
| 359 | http_server_cmd = env.Program('test_http_server', 'test_http_server.cc') |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 360 | |
| 361 | unittest_env = env.Clone() |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 362 | unittest_env.Append(LIBS=['gmock', 'gtest']) |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 363 | unittest_cmd = unittest_env.Program('update_engine_unittests', |
| 364 | unittest_sources + unittest_main) |
| 365 | Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + |
Andrew de los Reyes | 819fef2 | 2010-12-17 11:33:58 -0800 | [diff] [blame] | 366 | Split('html app.info')) |