Gilad Arnold | 6eccc53 | 2012-05-17 15:44:22 -0700 | [diff] [blame] | 1 | # Copyright (c) 2012 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 |
Yunlian Jiang | b97fc8b | 2013-09-04 11:27:51 -0700 | [diff] [blame^] | 165 | for key in Split('CFLAGS CCFLAGS LDFLAGS CPPPATH LIBPATH'): |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 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 | |
Yunlian Jiang | b97fc8b | 2013-09-04 11:27:51 -0700 | [diff] [blame^] | 175 | env['LINKFLAGS'] = env['LDFLAGS'] |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 176 | env['CCFLAGS'] = ' '.join("""-g |
| 177 | -fno-exceptions |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 178 | -fno-strict-aliasing |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 179 | -Wall |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 180 | -Wclobbered |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 181 | -Wclobbered |
| 182 | -Wempty-body |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 183 | -Wempty-body |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 184 | -Werror |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 185 | -Wignored-qualifiers |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 186 | -Wignored-qualifiers |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 187 | -Wmissing-field-initializers |
Han Shen | 2643cb7 | 2012-06-26 14:45:33 -0700 | [diff] [blame] | 188 | -Wno-format |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 189 | -Wsign-compare |
| 190 | -Wtype-limits |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 191 | -Wtype-limits |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 192 | -Wuninitialized |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 193 | -D__STDC_FORMAT_MACROS=1 |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 194 | -D_FILE_OFFSET_BITS=64 |
David Zeuthen | 9a017f2 | 2013-04-11 16:10:26 -0700 | [diff] [blame] | 195 | -D_POSIX_C_SOURCE=199309L |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 196 | -I/usr/include/libxml2""".split()); |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 197 | env['CCFLAGS'] += (' ' + ' '.join(env['CFLAGS'])) |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 198 | |
Gilad Arnold | 461a3d5 | 2013-03-20 08:21:51 -0700 | [diff] [blame] | 199 | BASE_VER = os.environ.get('BASE_VER', '180609') |
Mike Frysinger | dd465db | 2012-03-09 11:59:31 -0500 | [diff] [blame] | 200 | env['LIBS'] = Split("""bz2 |
Raymes Khoury | e3d8d4c | 2010-09-17 10:35:54 -0700 | [diff] [blame] | 201 | crypto |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 202 | curl |
Thieu Le | 5c7d975 | 2010-12-15 16:09:28 -0800 | [diff] [blame] | 203 | ext2fs |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 204 | gflags |
| 205 | glib-2.0 |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 206 | gthread-2.0 |
Darin Petkov | 9d65b7b | 2010-07-20 09:13:01 -0700 | [diff] [blame] | 207 | metrics |
Mike Frysinger | dd465db | 2012-03-09 11:59:31 -0500 | [diff] [blame] | 208 | policy-%s |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 209 | protobuf |
| 210 | pthread |
Will Drewry | 8f71da8 | 2010-08-30 14:07:11 -0500 | [diff] [blame] | 211 | rootdev |
David Zeuthen | 9a017f2 | 2013-04-11 16:10:26 -0700 | [diff] [blame] | 212 | rt |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 213 | ssl |
Gilad Arnold | 28e2f39 | 2012-02-09 14:36:46 -0800 | [diff] [blame] | 214 | udev |
Mike Frysinger | dd465db | 2012-03-09 11:59:31 -0500 | [diff] [blame] | 215 | xml2""" % BASE_VER) |
Andrew de los Reyes | b70e33d | 2010-08-12 21:49:02 -0700 | [diff] [blame] | 216 | env['CPPPATH'] = ['..'] |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 217 | env['BUILDERS']['ProtocolBuffer'] = proto_builder |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 218 | env['BUILDERS']['DbusBindings'] = dbus_bindings_builder |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 219 | env['BUILDERS']['GlibMarshal'] = glib_marshal_builder |
Darin Petkov | d7061ab | 2010-10-06 14:37:09 -0700 | [diff] [blame] | 220 | env['BUILDERS']['PublicKey'] = public_key_builder |
Colin Watson | f2c29ec | 2010-01-08 18:50:56 +0000 | [diff] [blame] | 221 | |
| 222 | # Fix issue with scons not passing pkg-config vars through the environment. |
| 223 | for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): |
| 224 | if os.environ.has_key(key): |
| 225 | env['ENV'][key] = os.environ[key] |
| 226 | |
Diego Elio Pettenò | 8707b5b | 2011-05-15 18:22:29 +0200 | [diff] [blame] | 227 | pkgconfig = os.environ.get('PKG_CONFIG', 'pkg-config') |
| 228 | |
| 229 | env.ParseConfig(pkgconfig + ' --cflags --libs ' |
Mike Frysinger | dd465db | 2012-03-09 11:59:31 -0500 | [diff] [blame] | 230 | 'dbus-1 dbus-glib-1 gio-2.0 gio-unix-2.0 glib-2.0 libchrome-%s ' |
| 231 | 'libchromeos-%s' % (BASE_VER, BASE_VER)) |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 232 | env.ProtocolBuffer('update_metadata.pb.cc', 'update_metadata.proto') |
Darin Petkov | d7061ab | 2010-10-06 14:37:09 -0700 | [diff] [blame] | 233 | env.PublicKey('unittest_key.pub.pem', 'unittest_key.pem') |
Andrew de los Reyes | c24e3f3 | 2011-08-30 15:45:20 -0700 | [diff] [blame] | 234 | env.PublicKey('unittest_key2.pub.pem', 'unittest_key2.pem') |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 235 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 236 | env.DbusBindings('update_engine.dbusclient.h', 'update_engine.xml') |
| 237 | |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 238 | env.GlibMarshal('marshal.glibmarshal.c', 'marshal.list') |
| 239 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 240 | if ARGUMENTS.get('debug', 0): |
Andrew de los Reyes | 819fef2 | 2010-12-17 11:33:58 -0800 | [diff] [blame] | 241 | env['CCFLAGS'] += ['-fprofile-arcs', '-ftest-coverage'] |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 242 | env['LIBS'] += ['bz2', 'gcov'] |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 243 | |
| 244 | sources = Split("""action_processor.cc |
Andrew de los Reyes | d2135f3 | 2010-03-11 16:00:28 -0800 | [diff] [blame] | 245 | bzip.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 246 | bzip_extent_writer.cc |
Bruno Rocha | 7f9aea2 | 2011-09-12 14:31:24 -0700 | [diff] [blame] | 247 | certificate_checker.cc |
Andrew de los Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 248 | chrome_browser_proxy_resolver.cc |
David Zeuthen | f413fe5 | 2013-04-22 14:04:39 -0700 | [diff] [blame] | 249 | clock.cc |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 250 | connection_manager.cc |
Jay Srinivasan | 1c0fe79 | 2013-03-28 16:45:25 -0700 | [diff] [blame] | 251 | constants.cc |
Andrew de los Reyes | 35a7af1 | 2010-03-10 16:33:26 -0800 | [diff] [blame] | 252 | cycle_breaker.cc |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 253 | dbus_service.cc |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 254 | delta_diff_generator.cc |
| 255 | delta_performer.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 256 | download_action.cc |
Andrew de los Reyes | b4025e6 | 2010-02-23 17:47:03 -0800 | [diff] [blame] | 257 | extent_mapper.cc |
Andrew de los Reyes | 5fdae4a | 2010-10-05 10:47:42 -0700 | [diff] [blame] | 258 | extent_ranges.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 259 | extent_writer.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 260 | filesystem_copier_action.cc |
| 261 | filesystem_iterator.cc |
Gilad Arnold | 11c066f | 2012-05-10 14:37:25 -0700 | [diff] [blame] | 262 | file_descriptor.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 263 | file_writer.cc |
Darin Petkov | 7a22d79 | 2010-11-08 14:10:00 -0800 | [diff] [blame] | 264 | full_update_generator.cc |
Gilad Arnold | 1ebd813 | 2012-03-05 10:19:29 -0800 | [diff] [blame] | 265 | gpio_handler.cc |
Andrew de los Reyes | 0ce161b | 2010-02-22 15:27:01 -0800 | [diff] [blame] | 266 | graph_utils.cc |
Alex Deymo | 4243291 | 2013-07-12 20:21:15 -0700 | [diff] [blame] | 267 | hardware.cc |
Gilad Arnold | 9bedeb5 | 2011-11-17 16:19:57 -0800 | [diff] [blame] | 268 | http_common.cc |
Andrew de los Reyes | 4516810 | 2010-11-22 11:13:50 -0800 | [diff] [blame] | 269 | http_fetcher.cc |
Jay Srinivasan | ae4697c | 2013-03-18 17:08:08 -0700 | [diff] [blame] | 270 | install_plan.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 271 | libcurl_http_fetcher.cc |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 272 | marshal.glibmarshal.c |
Thieu Le | 5c7d975 | 2010-12-15 16:09:28 -0800 | [diff] [blame] | 273 | metadata.cc |
Andrew de los Reyes | 819fef2 | 2010-12-17 11:33:58 -0800 | [diff] [blame] | 274 | multi_range_http_fetcher.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 275 | omaha_hash_calculator.cc |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 276 | omaha_request_action.cc |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 277 | omaha_request_params.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 278 | omaha_response_handler_action.cc |
David Zeuthen | 27a48bc | 2013-08-06 12:06:29 -0700 | [diff] [blame] | 279 | p2p_manager.cc |
Andrew de los Reyes | 0c44005 | 2010-08-20 11:25:54 -0700 | [diff] [blame] | 280 | payload_signer.cc |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 281 | payload_state.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 282 | postinstall_runner_action.cc |
Darin Petkov | 3003059 | 2010-07-27 13:53:20 -0700 | [diff] [blame] | 283 | prefs.cc |
Andrew de los Reyes | 9cd120d | 2010-11-18 17:50:03 -0800 | [diff] [blame] | 284 | proxy_resolver.cc |
Andrew de los Reyes | 785bc35 | 2010-05-26 12:34:53 -0700 | [diff] [blame] | 285 | simple_key_value_store.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 286 | subprocess.cc |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 287 | system_state.cc |
Andrew de los Reyes | 81ebcd8 | 2010-03-09 15:56:18 -0800 | [diff] [blame] | 288 | tarjan.cc |
Darin Petkov | 9c0baf8 | 2010-10-07 13:44:48 -0700 | [diff] [blame] | 289 | terminator.cc |
Andrew de los Reyes | 5815155 | 2010-03-10 20:07:08 -0800 | [diff] [blame] | 290 | topological_sort.cc |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 291 | update_attempter.cc |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 292 | update_check_scheduler.cc |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 293 | update_metadata.pb.cc |
| 294 | utils.cc""") |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 295 | main = ['main.cc'] |
| 296 | |
| 297 | unittest_sources = Split("""action_unittest.cc |
| 298 | action_pipe_unittest.cc |
| 299 | action_processor_unittest.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 300 | bzip_extent_writer_unittest.cc |
Bruno Rocha | 7f9aea2 | 2011-09-12 14:31:24 -0700 | [diff] [blame] | 301 | certificate_checker_unittest.cc |
Andrew de los Reyes | 000d895 | 2011-03-02 15:21:14 -0800 | [diff] [blame] | 302 | chrome_browser_proxy_resolver_unittest.cc |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 303 | connection_manager_unittest.cc |
Andrew de los Reyes | 35a7af1 | 2010-03-10 16:33:26 -0800 | [diff] [blame] | 304 | cycle_breaker_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 305 | delta_diff_generator_unittest.cc |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 306 | delta_performer_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 307 | download_action_unittest.cc |
Andrew de los Reyes | b4025e6 | 2010-02-23 17:47:03 -0800 | [diff] [blame] | 308 | extent_mapper_unittest.cc |
Andrew de los Reyes | 5fdae4a | 2010-10-05 10:47:42 -0700 | [diff] [blame] | 309 | extent_ranges_unittest.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 310 | extent_writer_unittest.cc |
Alex Deymo | 4243291 | 2013-07-12 20:21:15 -0700 | [diff] [blame] | 311 | fake_hardware.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 312 | file_writer_unittest.cc |
Andrew de los Reyes | c702078 | 2010-04-28 10:46:04 -0700 | [diff] [blame] | 313 | filesystem_copier_action_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 314 | filesystem_iterator_unittest.cc |
Darin Petkov | 7a22d79 | 2010-11-08 14:10:00 -0800 | [diff] [blame] | 315 | full_update_generator_unittest.cc |
Gilad Arnold | 4d740eb | 2012-05-15 08:48:13 -0700 | [diff] [blame] | 316 | gpio_handler_unittest.cc |
Gilad Arnold | 6eccc53 | 2012-05-17 15:44:22 -0700 | [diff] [blame] | 317 | gpio_mock_file_descriptor.cc |
Gilad Arnold | 4d740eb | 2012-05-15 08:48:13 -0700 | [diff] [blame] | 318 | gpio_mock_udev_interface.cc |
Andrew de los Reyes | 0ce161b | 2010-02-22 15:27:01 -0800 | [diff] [blame] | 319 | graph_utils_unittest.cc |
Alex Deymo | 4243291 | 2013-07-12 20:21:15 -0700 | [diff] [blame] | 320 | hardware_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 321 | http_fetcher_unittest.cc |
Thieu Le | 5c7d975 | 2010-12-15 16:09:28 -0800 | [diff] [blame] | 322 | metadata_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 323 | mock_http_fetcher.cc |
Jay Srinivasan | 55f50c2 | 2013-01-10 19:24:35 -0800 | [diff] [blame] | 324 | mock_system_state.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 325 | omaha_hash_calculator_unittest.cc |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 326 | omaha_request_action_unittest.cc |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 327 | omaha_request_params_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 328 | omaha_response_handler_action_unittest.cc |
David Zeuthen | 27a48bc | 2013-08-06 12:06:29 -0700 | [diff] [blame] | 329 | p2p_manager_unittest.cc |
Andrew de los Reyes | 0c44005 | 2010-08-20 11:25:54 -0700 | [diff] [blame] | 330 | payload_signer_unittest.cc |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 331 | payload_state_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 332 | postinstall_runner_action_unittest.cc |
Darin Petkov | 3003059 | 2010-07-27 13:53:20 -0700 | [diff] [blame] | 333 | prefs_unittest.cc |
Andrew de los Reyes | 785bc35 | 2010-05-26 12:34:53 -0700 | [diff] [blame] | 334 | simple_key_value_store_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 335 | subprocess_unittest.cc |
Andrew de los Reyes | 81ebcd8 | 2010-03-09 15:56:18 -0800 | [diff] [blame] | 336 | tarjan_unittest.cc |
Darin Petkov | 80f1956 | 2010-11-19 12:00:15 -0800 | [diff] [blame] | 337 | terminator_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 338 | test_utils.cc |
Andrew de los Reyes | 5815155 | 2010-03-10 20:07:08 -0800 | [diff] [blame] | 339 | topological_sort_unittest.cc |
Darin Petkov | f42cc1c | 2010-09-01 09:03:02 -0700 | [diff] [blame] | 340 | update_attempter_unittest.cc |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 341 | update_check_scheduler_unittest.cc |
Andrew de los Reyes | d2135f3 | 2010-03-11 16:00:28 -0800 | [diff] [blame] | 342 | utils_unittest.cc |
| 343 | zip_unittest.cc""") |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 344 | unittest_main = ['testrunner.cc'] |
| 345 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 346 | client_main = ['update_engine_client.cc'] |
| 347 | |
Andrew de los Reyes | 4fe15d0 | 2009-12-10 19:01:36 -0800 | [diff] [blame] | 348 | delta_generator_main = ['generate_delta_main.cc'] |
| 349 | |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 350 | # Hack to generate header files first. They are generated as a side effect |
| 351 | # of generating other files (usually their corresponding .c(c) files), |
| 352 | # so we make all sources depend on those other files. |
| 353 | all_sources = [] |
| 354 | all_sources.extend(sources) |
| 355 | all_sources.extend(unittest_sources) |
| 356 | all_sources.extend(main) |
| 357 | all_sources.extend(unittest_main) |
| 358 | all_sources.extend(client_main) |
| 359 | all_sources.extend(delta_generator_main) |
| 360 | for source in all_sources: |
Darin Petkov | d7061ab | 2010-10-06 14:37:09 -0700 | [diff] [blame] | 361 | if source.endswith('_unittest.cc'): |
| 362 | env.Depends(source, 'unittest_key.pub.pem') |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 363 | if source.endswith('.glibmarshal.c') or source.endswith('.pb.cc'): |
| 364 | continue |
| 365 | env.Depends(source, 'update_metadata.pb.cc') |
| 366 | env.Depends(source, 'marshal.glibmarshal.c') |
| 367 | env.Depends(source, 'update_engine.dbusclient.h') |
Andrew de los Reyes | 4fe15d0 | 2009-12-10 19:01:36 -0800 | [diff] [blame] | 368 | |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 369 | update_engine_core = env.Library('update_engine_core', sources) |
| 370 | env.Prepend(LIBS=[update_engine_core]) |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 371 | |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 372 | env.Program('update_engine', main) |
| 373 | |
| 374 | client_cmd = env.Program('update_engine_client', client_main); |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 375 | |
| 376 | delta_generator_cmd = env.Program('delta_generator', |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 377 | delta_generator_main) |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 378 | |
| 379 | 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] | 380 | |
| 381 | unittest_env = env.Clone() |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 382 | unittest_env.Append(LIBS=['gmock', 'gtest']) |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 383 | unittest_cmd = unittest_env.Program('update_engine_unittests', |
| 384 | unittest_sources + unittest_main) |
| 385 | Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + |
Andrew de los Reyes | 819fef2 | 2010-12-17 11:33:58 -0800 | [diff] [blame] | 386 | Split('html app.info')) |