rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 1 | # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
| 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 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 122 | env = Environment() |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 123 | for key in Split('CC CXX AR RANLIB LD NM'): |
| 124 | value = os.environ.get(key) |
| 125 | if value != None: |
| 126 | env[key] = value |
| 127 | for key in Split('CFLAGS CCFLAGS CPPPATH LIBPATH'): |
| 128 | value = os.environ.get(key) |
| 129 | if value != None: |
| 130 | env[key] = Split(value) |
| 131 | |
| 132 | for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH SYSROOT'): |
| 133 | if os.environ.has_key(key): |
| 134 | env['ENV'][key] = os.environ[key] |
| 135 | |
| 136 | |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 137 | env['CCFLAGS'] = ' '.join("""-g |
| 138 | -fno-exceptions |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 139 | -fno-strict-aliasing |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 140 | -Wall |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 141 | -Wclobbered |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 142 | -Wclobbered |
| 143 | -Wempty-body |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 144 | -Wempty-body |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 145 | -Werror |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 146 | -Wignored-qualifiers |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 147 | -Wignored-qualifiers |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 148 | -Wmissing-field-initializers |
| 149 | -Wsign-compare |
| 150 | -Wtype-limits |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 151 | -Wtype-limits |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 152 | -Wuninitialized |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 153 | -D__STDC_FORMAT_MACROS=1 |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 154 | -D_FILE_OFFSET_BITS=64 |
| 155 | -I/usr/include/libxml2""".split()); |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 156 | env['CCFLAGS'] += (' ' + ' '.join(env['CFLAGS'])) |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 157 | |
| 158 | env['LIBS'] = Split("""base |
Andrew de los Reyes | 08c4e27 | 2010-04-15 14:02:17 -0700 | [diff] [blame] | 159 | bz2 |
Raymes Khoury | e3d8d4c | 2010-09-17 10:35:54 -0700 | [diff] [blame] | 160 | crypto |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 161 | curl |
| 162 | gflags |
| 163 | glib-2.0 |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 164 | gthread-2.0 |
| 165 | libpcrecpp |
Darin Petkov | 9d65b7b | 2010-07-20 09:13:01 -0700 | [diff] [blame] | 166 | metrics |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 167 | protobuf |
| 168 | pthread |
Will Drewry | 8f71da8 | 2010-08-30 14:07:11 -0500 | [diff] [blame] | 169 | rootdev |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 170 | ssl |
| 171 | xml2 |
| 172 | z""") |
Andrew de los Reyes | b70e33d | 2010-08-12 21:49:02 -0700 | [diff] [blame] | 173 | env['CPPPATH'] = ['..'] |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 174 | env['BUILDERS']['ProtocolBuffer'] = proto_builder |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 175 | env['BUILDERS']['DbusBindings'] = dbus_bindings_builder |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 176 | env['BUILDERS']['GlibMarshal'] = glib_marshal_builder |
Colin Watson | f2c29ec | 2010-01-08 18:50:56 +0000 | [diff] [blame] | 177 | |
| 178 | # Fix issue with scons not passing pkg-config vars through the environment. |
| 179 | for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): |
| 180 | if os.environ.has_key(key): |
| 181 | env['ENV'][key] = os.environ[key] |
| 182 | |
Andrew de los Reyes | c702078 | 2010-04-28 10:46:04 -0700 | [diff] [blame] | 183 | env.ParseConfig('pkg-config --cflags --libs ' |
| 184 | '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] | 185 | env.ProtocolBuffer('update_metadata.pb.cc', 'update_metadata.proto') |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 186 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 187 | env.DbusBindings('update_engine.dbusclient.h', 'update_engine.xml') |
| 188 | |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 189 | env.GlibMarshal('marshal.glibmarshal.c', 'marshal.list') |
| 190 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 191 | if ARGUMENTS.get('debug', 0): |
| 192 | env['CCFLAGS'] += ' -fprofile-arcs -ftest-coverage' |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 193 | env['LIBS'] += ['bz2', 'gcov'] |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 194 | |
| 195 | sources = Split("""action_processor.cc |
Darin Petkov | e971f33 | 2010-09-22 16:57:25 -0700 | [diff] [blame^] | 196 | buffered_file_writer.cc |
Andrew de los Reyes | d2135f3 | 2010-03-11 16:00:28 -0800 | [diff] [blame] | 197 | bzip.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 198 | bzip_extent_writer.cc |
Andrew de los Reyes | 35a7af1 | 2010-03-10 16:33:26 -0800 | [diff] [blame] | 199 | cycle_breaker.cc |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 200 | dbus_service.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 201 | decompressing_file_writer.cc |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 202 | delta_diff_generator.cc |
| 203 | delta_performer.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 204 | download_action.cc |
Andrew de los Reyes | b4025e6 | 2010-02-23 17:47:03 -0800 | [diff] [blame] | 205 | extent_mapper.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 206 | extent_writer.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 207 | filesystem_copier_action.cc |
| 208 | filesystem_iterator.cc |
| 209 | file_writer.cc |
Andrew de los Reyes | 0ce161b | 2010-02-22 15:27:01 -0800 | [diff] [blame] | 210 | graph_utils.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 211 | gzip.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 212 | libcurl_http_fetcher.cc |
Andrew de los Reyes | 63b96d7 | 2010-05-10 13:08:54 -0700 | [diff] [blame] | 213 | marshal.glibmarshal.c |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 214 | omaha_hash_calculator.cc |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 215 | omaha_request_action.cc |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 216 | omaha_request_params.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 217 | omaha_response_handler_action.cc |
Andrew de los Reyes | 0c44005 | 2010-08-20 11:25:54 -0700 | [diff] [blame] | 218 | payload_signer.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 219 | postinstall_runner_action.cc |
Darin Petkov | 3003059 | 2010-07-27 13:53:20 -0700 | [diff] [blame] | 220 | prefs.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 221 | set_bootable_flag_action.cc |
Andrew de los Reyes | 785bc35 | 2010-05-26 12:34:53 -0700 | [diff] [blame] | 222 | simple_key_value_store.cc |
Andrew de los Reyes | 0cca421 | 2010-04-29 14:00:58 -0700 | [diff] [blame] | 223 | split_file_writer.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 224 | subprocess.cc |
Andrew de los Reyes | 81ebcd8 | 2010-03-09 15:56:18 -0800 | [diff] [blame] | 225 | tarjan.cc |
Andrew de los Reyes | 5815155 | 2010-03-10 20:07:08 -0800 | [diff] [blame] | 226 | topological_sort.cc |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 227 | update_attempter.cc |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 228 | update_check_scheduler.cc |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 229 | update_metadata.pb.cc |
| 230 | utils.cc""") |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 231 | main = ['main.cc'] |
| 232 | |
| 233 | unittest_sources = Split("""action_unittest.cc |
| 234 | action_pipe_unittest.cc |
| 235 | action_processor_unittest.cc |
Darin Petkov | e971f33 | 2010-09-22 16:57:25 -0700 | [diff] [blame^] | 236 | buffered_file_writer_unittest.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 237 | bzip_extent_writer_unittest.cc |
Andrew de los Reyes | 35a7af1 | 2010-03-10 16:33:26 -0800 | [diff] [blame] | 238 | cycle_breaker_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 239 | decompressing_file_writer_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 240 | delta_diff_generator_unittest.cc |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 241 | delta_performer_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 242 | download_action_unittest.cc |
Andrew de los Reyes | b4025e6 | 2010-02-23 17:47:03 -0800 | [diff] [blame] | 243 | extent_mapper_unittest.cc |
Andrew de los Reyes | 8006106 | 2010-02-04 14:25:00 -0800 | [diff] [blame] | 244 | extent_writer_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 245 | file_writer_unittest.cc |
Andrew de los Reyes | c702078 | 2010-04-28 10:46:04 -0700 | [diff] [blame] | 246 | filesystem_copier_action_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 247 | filesystem_iterator_unittest.cc |
Andrew de los Reyes | 0ce161b | 2010-02-22 15:27:01 -0800 | [diff] [blame] | 248 | graph_utils_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 249 | http_fetcher_unittest.cc |
| 250 | mock_http_fetcher.cc |
| 251 | omaha_hash_calculator_unittest.cc |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 252 | omaha_request_action_unittest.cc |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 253 | omaha_request_params_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 254 | omaha_response_handler_action_unittest.cc |
Andrew de los Reyes | 0c44005 | 2010-08-20 11:25:54 -0700 | [diff] [blame] | 255 | payload_signer_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 256 | postinstall_runner_action_unittest.cc |
Darin Petkov | 3003059 | 2010-07-27 13:53:20 -0700 | [diff] [blame] | 257 | prefs_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 258 | set_bootable_flag_action_unittest.cc |
Andrew de los Reyes | 785bc35 | 2010-05-26 12:34:53 -0700 | [diff] [blame] | 259 | simple_key_value_store_unittest.cc |
Andrew de los Reyes | 0cca421 | 2010-04-29 14:00:58 -0700 | [diff] [blame] | 260 | split_file_writer_unittest.cc |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 261 | subprocess_unittest.cc |
Andrew de los Reyes | 81ebcd8 | 2010-03-09 15:56:18 -0800 | [diff] [blame] | 262 | tarjan_unittest.cc |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 263 | test_utils.cc |
Andrew de los Reyes | 5815155 | 2010-03-10 20:07:08 -0800 | [diff] [blame] | 264 | topological_sort_unittest.cc |
Darin Petkov | f42cc1c | 2010-09-01 09:03:02 -0700 | [diff] [blame] | 265 | update_attempter_unittest.cc |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 266 | update_check_scheduler_unittest.cc |
Andrew de los Reyes | d2135f3 | 2010-03-11 16:00:28 -0800 | [diff] [blame] | 267 | utils_unittest.cc |
| 268 | zip_unittest.cc""") |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 269 | unittest_main = ['testrunner.cc'] |
| 270 | |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 271 | client_main = ['update_engine_client.cc'] |
| 272 | |
Andrew de los Reyes | 4fe15d0 | 2009-12-10 19:01:36 -0800 | [diff] [blame] | 273 | delta_generator_main = ['generate_delta_main.cc'] |
| 274 | |
Andrew de los Reyes | 82d8679 | 2010-06-30 17:00:44 -0700 | [diff] [blame] | 275 | # Hack to generate header files first. They are generated as a side effect |
| 276 | # of generating other files (usually their corresponding .c(c) files), |
| 277 | # so we make all sources depend on those other files. |
| 278 | all_sources = [] |
| 279 | all_sources.extend(sources) |
| 280 | all_sources.extend(unittest_sources) |
| 281 | all_sources.extend(main) |
| 282 | all_sources.extend(unittest_main) |
| 283 | all_sources.extend(client_main) |
| 284 | all_sources.extend(delta_generator_main) |
| 285 | for source in all_sources: |
| 286 | if source.endswith('.glibmarshal.c') or source.endswith('.pb.cc'): |
| 287 | continue |
| 288 | env.Depends(source, 'update_metadata.pb.cc') |
| 289 | env.Depends(source, 'marshal.glibmarshal.c') |
| 290 | env.Depends(source, 'update_engine.dbusclient.h') |
Andrew de los Reyes | 4fe15d0 | 2009-12-10 19:01:36 -0800 | [diff] [blame] | 291 | |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 292 | update_engine_core = env.Library('update_engine_core', sources) |
| 293 | env.Prepend(LIBS=[update_engine_core]) |
Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame] | 294 | |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 295 | env.Program('update_engine', main) |
| 296 | |
| 297 | client_cmd = env.Program('update_engine_client', client_main); |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 298 | |
| 299 | delta_generator_cmd = env.Program('delta_generator', |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 300 | delta_generator_main) |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 301 | |
| 302 | 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] | 303 | |
| 304 | unittest_env = env.Clone() |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 305 | unittest_env.Append(LIBS=['gmock', 'gtest']) |
Andrew de los Reyes | f98bff8 | 2010-05-06 13:33:25 -0700 | [diff] [blame] | 306 | unittest_cmd = unittest_env.Program('update_engine_unittests', |
| 307 | unittest_sources + unittest_main) |
| 308 | Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + |
| 309 | Split('html app.info')) |