Alexandre Rames | b78f139 | 2016-07-01 14:22:22 +0100 | [diff] [blame] | 1 | # Copyright 2015, VIXL authors |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 2 | # All rights reserved. |
| 3 | # |
| 4 | # Redistribution and use in source and binary forms, with or without |
| 5 | # modification, are permitted provided that the following conditions are met: |
| 6 | # |
| 7 | # * Redistributions of source code must retain the above copyright notice, |
| 8 | # this list of conditions and the following disclaimer. |
| 9 | # * Redistributions in binary form must reproduce the above copyright notice, |
| 10 | # this list of conditions and the following disclaimer in the documentation |
| 11 | # and/or other materials provided with the distribution. |
| 12 | # * Neither the name of ARM Limited nor the names of its contributors may be |
| 13 | # used to endorse or promote products derived from this software without |
| 14 | # specific prior written permission. |
| 15 | # |
| 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND |
| 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE |
| 20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 27 | import glob |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 28 | import itertools |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 29 | import os |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 30 | from os.path import join |
armvixl | c68cb64 | 2014-09-25 18:49:30 +0100 | [diff] [blame] | 31 | import platform |
armvixl | 4a102ba | 2014-07-14 09:02:40 +0100 | [diff] [blame] | 32 | import subprocess |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 33 | import sys |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 34 | from collections import OrderedDict |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 35 | |
armvixl | 4a102ba | 2014-07-14 09:02:40 +0100 | [diff] [blame] | 36 | root_dir = os.path.dirname(File('SConstruct').rfile().abspath) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 37 | sys.path.insert(0, join(root_dir, 'tools')) |
| 38 | import config |
armvixl | 4a102ba | 2014-07-14 09:02:40 +0100 | [diff] [blame] | 39 | import util |
| 40 | |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 41 | from SCons.Errors import UserError |
| 42 | |
armvixl | c68cb64 | 2014-09-25 18:49:30 +0100 | [diff] [blame] | 43 | |
| 44 | Help(''' |
| 45 | Build system for the VIXL project. |
| 46 | See README.md for documentation and details about the build system. |
armvixl | c68cb64 | 2014-09-25 18:49:30 +0100 | [diff] [blame] | 47 | ''') |
| 48 | |
| 49 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 50 | # We track top-level targets to automatically generate help and alias them. |
Pierre Langlois | 287e6d1 | 2016-11-21 14:56:01 +0000 | [diff] [blame] | 51 | class VIXLTargets: |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 52 | def __init__(self): |
| 53 | self.targets = [] |
| 54 | self.help_messages = [] |
| 55 | def Add(self, target, help_message): |
| 56 | self.targets.append(target) |
| 57 | self.help_messages.append(help_message) |
| 58 | def Help(self): |
armvixl | 684cd2a | 2015-10-23 13:38:33 +0100 | [diff] [blame] | 59 | res = "" |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 60 | for i in range(len(self.targets)): |
| 61 | res += '\t{0:<{1}}{2:<{3}}\n'.format( |
| 62 | 'scons ' + self.targets[i], |
| 63 | len('scons ') + max(map(len, self.targets)), |
| 64 | ' : ' + self.help_messages[i], |
| 65 | len(' : ') + max(map(len, self.help_messages))) |
| 66 | return res |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 67 | |
Pierre Langlois | 287e6d1 | 2016-11-21 14:56:01 +0000 | [diff] [blame] | 68 | top_level_targets = VIXLTargets() |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 69 | |
| 70 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 71 | |
| 72 | # Build options ---------------------------------------------------------------- |
| 73 | |
| 74 | # Store all the options in a dictionary. |
| 75 | # The SConstruct will check the build variables and construct the build |
| 76 | # environment as appropriate. |
| 77 | options = { |
| 78 | 'all' : { # Unconditionally processed. |
| 79 | 'CCFLAGS' : ['-Wall', |
| 80 | '-Werror', |
| 81 | '-fdiagnostics-show-option', |
| 82 | '-Wextra', |
| 83 | '-Wredundant-decls', |
| 84 | '-pedantic', |
Alexandre Rames | fd09817 | 2016-08-09 10:29:53 +0100 | [diff] [blame] | 85 | '-Wwrite-strings', |
Jacob Bramley | cff5a2e | 2019-03-15 09:34:56 +0000 | [diff] [blame] | 86 | '-Wunused', |
| 87 | '-Wno-missing-noreturn'], |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 88 | 'CPPPATH' : [config.dir_src_vixl] |
| 89 | }, |
| 90 | # 'build_option:value' : { |
| 91 | # 'environment_key' : 'values to append' |
| 92 | # }, |
| 93 | 'mode:debug' : { |
| 94 | 'CCFLAGS' : ['-DVIXL_DEBUG', '-O0'] |
| 95 | }, |
| 96 | 'mode:release' : { |
Alexandre Rames | fa4a4bd | 2016-07-25 14:14:22 +0100 | [diff] [blame] | 97 | 'CCFLAGS' : ['-O3'], |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 98 | }, |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 99 | 'simulator:aarch64' : { |
Pierre Langlois | 1e85b7f | 2016-08-05 14:20:36 +0100 | [diff] [blame] | 100 | 'CCFLAGS' : ['-DVIXL_INCLUDE_SIMULATOR_AARCH64'], |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 101 | }, |
| 102 | 'symbols:on' : { |
| 103 | 'CCFLAGS' : ['-g'], |
| 104 | 'LINKFLAGS' : ['-g'] |
| 105 | }, |
Georgia Kouveli | 38d5d1b | 2016-11-16 11:58:41 +0000 | [diff] [blame] | 106 | 'negative_testing:on' : { |
| 107 | 'CCFLAGS' : ['-DVIXL_NEGATIVE_TESTING'] |
Jacob Bramley | 1fa6f06 | 2016-12-19 11:40:08 +0000 | [diff] [blame] | 108 | }, |
| 109 | 'code_buffer_allocator:mmap' : { |
| 110 | 'CCFLAGS' : ['-DVIXL_CODE_BUFFER_MMAP'] |
| 111 | }, |
| 112 | 'code_buffer_allocator:malloc' : { |
| 113 | 'CCFLAGS' : ['-DVIXL_CODE_BUFFER_MALLOC'] |
Vincent Belliard | 4e52d4d | 2018-04-03 13:34:44 -0700 | [diff] [blame] | 114 | }, |
| 115 | 'ubsan:on' : { |
| 116 | 'CCFLAGS': ['-fsanitize=undefined'], |
| 117 | 'LINKFLAGS': ['-fsanitize=undefined'] |
Georgia Kouveli | 38d5d1b | 2016-11-16 11:58:41 +0000 | [diff] [blame] | 118 | } |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 119 | } |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 120 | |
| 121 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 122 | # A `DefaultVariable` has a default value that depends on elements not known |
| 123 | # when variables are first evaluated. |
| 124 | # Each `DefaultVariable` has a handler that will compute the default value for |
| 125 | # the given environment. |
| 126 | def modifiable_flags_handler(env): |
| 127 | env['modifiable_flags'] = \ |
| 128 | 'on' if 'mode' in env and env['mode'] == 'debug' else 'off' |
armvixl | 6e2c827 | 2015-03-31 11:04:14 +0100 | [diff] [blame] | 129 | |
| 130 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 131 | def symbols_handler(env): |
| 132 | env['symbols'] = 'on' if 'mode' in env and env['mode'] == 'debug' else 'off' |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 133 | |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 134 | def Is32BitHost(env): |
| 135 | return env['host_arch'] in ['aarch32', 'i386'] |
| 136 | |
| 137 | def IsAArch64Host(env): |
| 138 | return env['host_arch'] == 'aarch64' |
| 139 | |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 140 | def CanTargetA32(env): |
| 141 | return 'a32' in env['target'] |
| 142 | |
| 143 | def CanTargetT32(env): |
| 144 | return 't32' in env['target'] |
| 145 | |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 146 | def CanTargetAArch32(env): |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 147 | return CanTargetA32(env) or CanTargetT32(env) |
| 148 | |
| 149 | def CanTargetA64(env): |
| 150 | return 'a64' in env['target'] |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 151 | |
| 152 | def CanTargetAArch64(env): |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 153 | return CanTargetA64(env) |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 154 | |
| 155 | |
| 156 | # By default, include the simulator only if AArch64 is targeted and we are not |
| 157 | # building VIXL natively for AArch64. |
| 158 | def simulator_handler(env): |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 159 | if not IsAArch64Host(env) and CanTargetAArch64(env): |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 160 | env['simulator'] = 'aarch64' |
| 161 | else: |
| 162 | env['simulator'] = 'none' |
| 163 | |
| 164 | |
Jacob Bramley | 1fa6f06 | 2016-12-19 11:40:08 +0000 | [diff] [blame] | 165 | # 'mmap' is required for use with 'mprotect', which is needed for the tests |
| 166 | # (when running natively), so we use it by default where we can. |
| 167 | def code_buffer_allocator_handler(env): |
| 168 | directives = util.GetCompilerDirectives(env) |
| 169 | if '__linux__' in directives: |
| 170 | env['code_buffer_allocator'] = 'mmap' |
| 171 | else: |
| 172 | env['code_buffer_allocator'] = 'malloc' |
| 173 | |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 174 | # A validator checks the consistency of provided options against the environment. |
| 175 | def default_validator(env): |
| 176 | pass |
| 177 | |
| 178 | |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 179 | def simulator_validator(env): |
| 180 | if env['simulator'] == 'aarch64' and not CanTargetAArch64(env): |
| 181 | raise UserError('Building an AArch64 simulator implies that VIXL targets ' |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 182 | 'AArch64. Set `target` to include `aarch64` or `a64`.') |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 183 | |
| 184 | |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 185 | # Default variables may depend on each other, therefore we need this dictionnary |
| 186 | # to be ordered. |
| 187 | vars_default_handlers = OrderedDict({ |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 188 | # variable_name : [ 'default val', 'handler', 'validator'] |
| 189 | 'symbols' : [ 'mode==debug', symbols_handler, default_validator ], |
| 190 | 'modifiable_flags' : [ 'mode==debug', modifiable_flags_handler, default_validator], |
Jacob Bramley | 1fa6f06 | 2016-12-19 11:40:08 +0000 | [diff] [blame] | 191 | 'simulator' : [ 'on if the target architectures include AArch64 but ' |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 192 | 'the host is not AArch64, else off', |
Jacob Bramley | 1fa6f06 | 2016-12-19 11:40:08 +0000 | [diff] [blame] | 193 | simulator_handler, simulator_validator ], |
| 194 | 'code_buffer_allocator' : [ 'mmap with __linux__, malloc otherwise', |
| 195 | code_buffer_allocator_handler, default_validator ] |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 196 | }) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 197 | |
| 198 | |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 199 | def DefaultVariable(name, help, allowed_values): |
| 200 | help = '%s (%s)' % (help, '|'.join(allowed_values)) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 201 | default_value = vars_default_handlers[name][0] |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 202 | def validator(name, value, env): |
| 203 | if value != default_value and value not in allowed_values: |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 204 | raise UserError('Invalid value for option {name}: {value}. ' |
| 205 | 'Valid values are: {allowed_values}'.format( |
| 206 | name, value, allowed_values)) |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 207 | return (name, help, default_value, validator) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 208 | |
| 209 | |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 210 | def AliasedListVariable(name, help, default_value, allowed_values, aliasing): |
| 211 | help = '%s (all|auto|comma-separated list) (any combination from [%s])' % \ |
| 212 | (help, ', '.join(allowed_values)) |
| 213 | |
| 214 | def validator(name, value, env): |
| 215 | # Here list has been converted to space separated strings. |
| 216 | if value == '': return # auto |
| 217 | for v in value.split(): |
| 218 | if v not in allowed_values: |
| 219 | raise UserError('Invalid value for %s: %s' % (name, value)) |
| 220 | |
| 221 | def converter(value): |
| 222 | if value == 'auto': return [] |
| 223 | if value == 'all': |
| 224 | translated = [aliasing[v] for v in allowed_values] |
| 225 | return list(set(itertools.chain.from_iterable(translated))) |
| 226 | # The validator is run later hence the get. |
| 227 | translated = [aliasing.get(v, v) for v in value.split(',')] |
| 228 | return list(set(itertools.chain.from_iterable(translated))) |
| 229 | |
| 230 | return (name, help, default_value, validator, converter) |
| 231 | |
| 232 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 233 | vars = Variables() |
| 234 | # Define command line build options. |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 235 | vars.AddVariables( |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 236 | AliasedListVariable('target', 'Target ISA/Architecture', 'auto', |
| 237 | ['aarch32', 'a32', 't32', 'aarch64', 'a64'], |
| 238 | {'aarch32' : ['a32', 't32'], |
| 239 | 'a32' : ['a32'], 't32' : ['t32'], |
| 240 | 'aarch64' : ['a64'], 'a64' : ['a64']}), |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 241 | EnumVariable('mode', 'Build mode', |
| 242 | 'release', allowed_values=config.build_options_modes), |
Vincent Belliard | 4e52d4d | 2018-04-03 13:34:44 -0700 | [diff] [blame] | 243 | EnumVariable('ubsan', 'Enable undefined behavior checks', |
| 244 | 'off', allowed_values=['on', 'off']), |
Jacob Bramley | 1fa6f06 | 2016-12-19 11:40:08 +0000 | [diff] [blame] | 245 | EnumVariable('negative_testing', |
| 246 | 'Enable negative testing (needs exceptions)', |
Georgia Kouveli | 38d5d1b | 2016-11-16 11:58:41 +0000 | [diff] [blame] | 247 | 'off', allowed_values=['on', 'off']), |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 248 | DefaultVariable('symbols', 'Include debugging symbols in the binaries', |
| 249 | ['on', 'off']), |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 250 | DefaultVariable('simulator', 'Simulators to include', ['aarch64', 'none']), |
Jacob Bramley | 1fa6f06 | 2016-12-19 11:40:08 +0000 | [diff] [blame] | 251 | DefaultVariable('code_buffer_allocator', |
| 252 | 'Configure the allocation mechanism in the CodeBuffer', |
| 253 | ['malloc', 'mmap']), |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 254 | ('std', 'C++ standard. The standards tested are: %s.' % \ |
Anthony Barbier | 9c4ba7a | 2019-02-15 15:20:25 +0000 | [diff] [blame] | 255 | ', '.join(config.tested_cpp_standards)), |
| 256 | ('compiler_wrapper', 'Command to prefix to the C and C++ compiler (e.g ccache)', '') |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 257 | ) |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 258 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 259 | # We use 'variant directories' to avoid recompiling multiple times when build |
| 260 | # options are changed, different build paths are used depending on the options |
| 261 | # set. These are the options that should be reflected in the build directory |
| 262 | # path. |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 263 | options_influencing_build_path = [ |
Anthony Barbier | 9c4ba7a | 2019-02-15 15:20:25 +0000 | [diff] [blame] | 264 | 'target', 'mode', 'symbols', 'compiler', 'std', 'simulator', 'negative_testing', |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 265 | 'code_buffer_allocator' |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 266 | ] |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 267 | |
armvixl | ad96eda | 2013-06-14 11:42:37 +0100 | [diff] [blame] | 268 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 269 | |
| 270 | # Build helpers ---------------------------------------------------------------- |
| 271 | |
| 272 | def RetrieveEnvironmentVariables(env): |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 273 | for key in ['CC', 'CXX', 'AR', 'RANLIB', 'LD']: |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 274 | if os.getenv(key): env[key] = os.getenv(key) |
| 275 | if os.getenv('LD_LIBRARY_PATH'): env['LIBPATH'] = os.getenv('LD_LIBRARY_PATH') |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 276 | if os.getenv('CCFLAGS'): |
| 277 | env.Append(CCFLAGS = os.getenv('CCFLAGS').split()) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 278 | if os.getenv('CXXFLAGS'): |
| 279 | env.Append(CXXFLAGS = os.getenv('CXXFLAGS').split()) |
| 280 | if os.getenv('LINKFLAGS'): |
| 281 | env.Append(LINKFLAGS = os.getenv('LINKFLAGS').split()) |
armvixl | 4a102ba | 2014-07-14 09:02:40 +0100 | [diff] [blame] | 282 | |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 283 | # The architecture targeted by default will depend on the compiler being |
| 284 | # used. 'host_arch' is extracted from the compiler while 'target' can be |
| 285 | # set by the user. |
| 286 | # By default, we target both AArch32 and AArch64 unless the compiler targets a |
| 287 | # 32-bit architecture. At the moment, we cannot build VIXL's AArch64 support on |
| 288 | # a 32-bit platform. |
| 289 | # TODO: Port VIXL to build on a 32-bit platform. |
| 290 | def target_handler(env): |
| 291 | # Auto detect |
| 292 | if Is32BitHost(env): |
| 293 | # We use list(set(...)) to keep the same order as if it was specify as |
| 294 | # an option. |
| 295 | env['target'] = list(set(['a32', 't32'])) |
| 296 | else: |
| 297 | env['target'] = list(set(['a64', 'a32', 't32'])) |
| 298 | |
| 299 | |
| 300 | def target_validator(env): |
| 301 | # TODO: Port VIXL64 to work on a 32-bit platform. |
| 302 | if Is32BitHost(env) and CanTargetAArch64(env): |
| 303 | raise UserError('Building VIXL for AArch64 in 32-bit is not supported. Set ' |
| 304 | '`target` to `aarch32`') |
| 305 | |
| 306 | |
| 307 | # The target option is handled differently from the rest. |
| 308 | def ProcessTargetOption(env): |
| 309 | if env['target'] == []: target_handler(env) |
| 310 | |
| 311 | if 'a32' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_A32'] |
| 312 | if 't32' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_T32'] |
| 313 | if 'a64' in env['target']: env['CCFLAGS'] += ['-DVIXL_INCLUDE_TARGET_A64'] |
| 314 | |
| 315 | target_validator(env) |
| 316 | |
| 317 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 318 | def ProcessBuildOptions(env): |
| 319 | # 'all' is unconditionally processed. |
| 320 | if 'all' in options: |
| 321 | for var in options['all']: |
| 322 | if var in env and env[var]: |
| 323 | env[var] += options['all'][var] |
| 324 | else: |
| 325 | env[var] = options['all'][var] |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 326 | |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 327 | # The target option *must* be processed before the options defined in |
| 328 | # vars_default_handlers. |
| 329 | ProcessTargetOption(env) |
| 330 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 331 | # Other build options must match 'option:value' |
| 332 | env_dict = env.Dictionary() |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 333 | |
| 334 | # First apply the default variables handlers in order. |
| 335 | for key, value in vars_default_handlers.items(): |
| 336 | default = value[0] |
| 337 | handler = value[1] |
| 338 | if env_dict.get(key) == default: |
| 339 | handler(env_dict) |
| 340 | |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 341 | # Second, run the series of validators, to check for errors. |
| 342 | for _, value in vars_default_handlers.items(): |
| 343 | validator = value[2] |
| 344 | validator(env) |
| 345 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 346 | for key in env_dict.keys(): |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 347 | # Then update the environment according to the value of the variable. |
| 348 | key_val_couple = key + ':%s' % env_dict[key] |
| 349 | if key_val_couple in options: |
| 350 | for var in options[key_val_couple]: |
| 351 | env[var] += options[key_val_couple][var] |
| 352 | |
| 353 | |
| 354 | def ConfigureEnvironmentForCompiler(env): |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 355 | compiler = util.CompilerInformation(env) |
Pierre Langlois | f737e0a | 2016-11-02 13:08:11 +0000 | [diff] [blame] | 356 | if compiler == 'clang': |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 357 | # These warnings only work for Clang. |
| 358 | # -Wimplicit-fallthrough only works when compiling the code base as C++11 or |
| 359 | # newer. The compiler does not complain if the option is passed when |
| 360 | # compiling earlier C++ standards. |
| 361 | env.Append(CPPFLAGS = ['-Wimplicit-fallthrough', '-Wshorten-64-to-32']) |
| 362 | |
| 363 | # The '-Wunreachable-code' flag breaks builds for clang 3.4. |
Jacob Bramley | 176a379 | 2016-11-09 14:44:39 +0000 | [diff] [blame] | 364 | if compiler != 'clang-3.4': |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 365 | env.Append(CPPFLAGS = ['-Wunreachable-code']) |
| 366 | |
Vincent Belliard | 4e52d4d | 2018-04-03 13:34:44 -0700 | [diff] [blame] | 367 | if env['ubsan'] == 'on': |
| 368 | env.Append(LINKFLAGS = ['-fuse-ld=lld']) |
| 369 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 370 | # GCC 4.8 has a bug which produces a warning saying that an anonymous Operand |
| 371 | # object might be used uninitialized: |
| 372 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57045 |
| 373 | # The bug does not seem to appear in GCC 4.7, or in debug builds with GCC 4.8. |
| 374 | if env['mode'] == 'release': |
Pierre Langlois | f737e0a | 2016-11-02 13:08:11 +0000 | [diff] [blame] | 375 | if compiler == 'gcc-4.8': |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 376 | env.Append(CPPFLAGS = ['-Wno-maybe-uninitialized']) |
Pierre Langlois | f737e0a | 2016-11-02 13:08:11 +0000 | [diff] [blame] | 377 | |
Pierre Langlois | f7bf655 | 2017-05-05 13:14:35 +0100 | [diff] [blame] | 378 | # GCC 6 and higher is able to detect throwing from inside a destructor and |
| 379 | # reports a warning. However, if negative testing is enabled then assertions |
| 380 | # will throw exceptions. |
| 381 | if env['negative_testing'] == 'on' and env['mode'] == 'debug' \ |
| 382 | and compiler >= 'gcc-6': |
| 383 | env.Append(CPPFLAGS = ['-Wno-terminate']) |
| 384 | # The C++11 compatibility warning will also be triggered for this case, as |
| 385 | # the behavior of throwing from desctructors has changed. |
| 386 | if 'std' in env and env['std'] == 'c++98': |
| 387 | env.Append(CPPFLAGS = ['-Wno-c++11-compat']) |
| 388 | |
Pierre Langlois | c125307 | 2016-06-15 14:36:10 +0100 | [diff] [blame] | 389 | # When compiling with c++98 (the default), allow long long constants. |
armvixl | 0f35e36 | 2016-05-10 13:57:58 +0100 | [diff] [blame] | 390 | if 'std' not in env or env['std'] == 'c++98': |
Pierre Langlois | c125307 | 2016-06-15 14:36:10 +0100 | [diff] [blame] | 391 | env.Append(CPPFLAGS = ['-Wno-long-long']) |
Jacob Bramley | 5997b46 | 2018-06-05 14:05:30 +0100 | [diff] [blame] | 392 | env.Append(CPPFLAGS = ['-Wno-variadic-macros']) |
Pierre Langlois | 3fac43c | 2016-10-31 13:38:47 +0000 | [diff] [blame] | 393 | # When compiling with c++11, suggest missing override keywords on methods. |
| 394 | if 'std' in env and env['std'] in ['c++11', 'c++14']: |
Pierre Langlois | f737e0a | 2016-11-02 13:08:11 +0000 | [diff] [blame] | 395 | if compiler >= 'gcc-5': |
Pierre Langlois | 3fac43c | 2016-10-31 13:38:47 +0000 | [diff] [blame] | 396 | env.Append(CPPFLAGS = ['-Wsuggest-override']) |
Pierre Langlois | f737e0a | 2016-11-02 13:08:11 +0000 | [diff] [blame] | 397 | elif compiler >= 'clang-3.6': |
Pierre Langlois | 3fac43c | 2016-10-31 13:38:47 +0000 | [diff] [blame] | 398 | env.Append(CPPFLAGS = ['-Winconsistent-missing-override']) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 399 | |
| 400 | |
| 401 | def ConfigureEnvironment(env): |
| 402 | RetrieveEnvironmentVariables(env) |
Anthony Barbier | 9c4ba7a | 2019-02-15 15:20:25 +0000 | [diff] [blame] | 403 | env['compiler'] = env['CXX'] |
| 404 | if env['compiler_wrapper'] != '': |
| 405 | env['CXX'] = env['compiler_wrapper'] + ' ' + env['CXX'] |
| 406 | env['CC'] = env['compiler_wrapper'] + ' ' + env['CC'] |
Pierre Langlois | 8253a3c | 2016-12-14 18:54:22 +0000 | [diff] [blame] | 407 | env['host_arch'] = util.GetHostArch(env) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 408 | ProcessBuildOptions(env) |
| 409 | if 'std' in env: |
| 410 | env.Append(CPPFLAGS = ['-std=' + env['std']]) |
| 411 | std_path = env['std'] |
| 412 | ConfigureEnvironmentForCompiler(env) |
| 413 | |
| 414 | |
| 415 | def TargetBuildDir(env): |
| 416 | # Build-time option values are embedded in the build path to avoid requiring a |
| 417 | # full build when an option changes. |
| 418 | build_dir = config.dir_build |
| 419 | for option in options_influencing_build_path: |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 420 | option_value = ''.join(env[option]) if option in env else '' |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 421 | build_dir = join(build_dir, option + '_'+ option_value) |
| 422 | return build_dir |
| 423 | |
| 424 | |
| 425 | def PrepareVariantDir(location, build_dir): |
| 426 | location_build_dir = join(build_dir, location) |
| 427 | VariantDir(location_build_dir, location) |
| 428 | return location_build_dir |
| 429 | |
| 430 | |
| 431 | def VIXLLibraryTarget(env): |
| 432 | build_dir = TargetBuildDir(env) |
| 433 | # Create a link to the latest build directory. |
Alexandre Rames | 4e24193 | 2016-06-08 21:32:03 +0100 | [diff] [blame] | 434 | # Use `-r` to avoid failure when `latest` exists and is a directory. |
| 435 | subprocess.check_call(["rm", "-rf", config.dir_build_latest]) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 436 | util.ensure_dir(build_dir) |
| 437 | subprocess.check_call(["ln", "-s", build_dir, config.dir_build_latest]) |
Alexandre Rames | d383296 | 2016-07-04 15:03:43 +0100 | [diff] [blame] | 438 | # Source files are in `src` and in `src/aarch64/`. |
Alexandre Rames | 39c32a6 | 2016-05-23 15:47:22 +0100 | [diff] [blame] | 439 | variant_dir_vixl = PrepareVariantDir(join('src'), build_dir) |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 440 | sources = [Glob(join(variant_dir_vixl, '*.cc'))] |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 441 | if CanTargetAArch32(env): |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 442 | variant_dir_aarch32 = PrepareVariantDir(join('src', 'aarch32'), build_dir) |
| 443 | sources.append(Glob(join(variant_dir_aarch32, '*.cc'))) |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 444 | if CanTargetAArch64(env): |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 445 | variant_dir_aarch64 = PrepareVariantDir(join('src', 'aarch64'), build_dir) |
| 446 | sources.append(Glob(join(variant_dir_aarch64, '*.cc'))) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 447 | return env.Library(join(build_dir, 'vixl'), sources) |
| 448 | |
| 449 | |
| 450 | |
| 451 | # Build ------------------------------------------------------------------------ |
| 452 | |
| 453 | # The VIXL library, built by default. |
Pierre Langlois | 287e6d1 | 2016-11-21 14:56:01 +0000 | [diff] [blame] | 454 | env = Environment(variables = vars, |
| 455 | BUILDERS = { |
| 456 | 'Markdown': Builder(action = 'markdown $SOURCE > $TARGET', |
| 457 | suffix = '.html') |
Anthony Barbier | f2986e1 | 2019-02-28 16:49:23 +0000 | [diff] [blame] | 458 | }, ENV = os.environ) |
Alexandre Rames | f5de33d | 2016-10-25 09:51:11 +0100 | [diff] [blame] | 459 | # Abort the build if any command line option is unknown or invalid. |
| 460 | unknown_build_options = vars.UnknownVariables() |
| 461 | if unknown_build_options: |
| 462 | print 'Unknown build options:', unknown_build_options.keys() |
| 463 | Exit(1) |
| 464 | |
Anthony Barbier | f2986e1 | 2019-02-28 16:49:23 +0000 | [diff] [blame] | 465 | if env['negative_testing'] == 'on' and env['mode'] != 'debug': |
| 466 | print 'negative_testing only works in debug mode' |
| 467 | Exit(1) |
| 468 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 469 | ConfigureEnvironment(env) |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 470 | Help(vars.GenerateHelpText(env)) |
| 471 | libvixl = VIXLLibraryTarget(env) |
| 472 | Default(libvixl) |
| 473 | env.Alias('libvixl', libvixl) |
| 474 | top_level_targets.Add('', 'Build the VIXL library.') |
| 475 | |
armvixl | 4a102ba | 2014-07-14 09:02:40 +0100 | [diff] [blame] | 476 | |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 477 | # Common test code. |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 478 | test_build_dir = PrepareVariantDir('test', TargetBuildDir(env)) |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 479 | test_objects = [env.Object(Glob(join(test_build_dir, '*.cc')))] |
| 480 | |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 481 | # AArch32 support |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 482 | if CanTargetAArch32(env): |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 483 | # The examples. |
| 484 | aarch32_example_names = util.ListCCFilesWithoutExt(config.dir_aarch32_examples) |
| 485 | aarch32_examples_build_dir = PrepareVariantDir('examples/aarch32', TargetBuildDir(env)) |
| 486 | aarch32_example_targets = [] |
| 487 | for example in aarch32_example_names: |
| 488 | prog = env.Program(join(aarch32_examples_build_dir, example), |
| 489 | join(aarch32_examples_build_dir, example + '.cc'), |
| 490 | LIBS=[libvixl]) |
| 491 | aarch32_example_targets.append(prog) |
| 492 | env.Alias('aarch32_examples', aarch32_example_targets) |
| 493 | top_level_targets.Add('aarch32_examples', 'Build the examples for AArch32.') |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 494 | |
Vincent Belliard | 32cf254 | 2016-07-14 10:04:09 -0700 | [diff] [blame] | 495 | # The benchmarks |
| 496 | aarch32_benchmark_names = util.ListCCFilesWithoutExt(config.dir_aarch32_benchmarks) |
| 497 | aarch32_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch32', TargetBuildDir(env)) |
| 498 | aarch32_benchmark_targets = [] |
| 499 | for bench in aarch32_benchmark_names: |
| 500 | prog = env.Program(join(aarch32_benchmarks_build_dir, bench), |
| 501 | join(aarch32_benchmarks_build_dir, bench + '.cc'), |
| 502 | LIBS=[libvixl]) |
| 503 | aarch32_benchmark_targets.append(prog) |
| 504 | env.Alias('aarch32_benchmarks', aarch32_benchmark_targets) |
| 505 | top_level_targets.Add('aarch32_benchmarks', 'Build the benchmarks for AArch32.') |
| 506 | |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 507 | # The tests. |
| 508 | test_aarch32_build_dir = PrepareVariantDir(join('test', 'aarch32'), TargetBuildDir(env)) |
| 509 | test_objects.append(env.Object( |
| 510 | Glob(join(test_aarch32_build_dir, '*.cc')), |
Anthony Barbier | 7b4df2b | 2019-03-12 17:36:15 +0000 | [diff] [blame] | 511 | CPPPATH = env['CPPPATH'] + [config.dir_tests], |
| 512 | CCFLAGS = [flag for flag in env['CCFLAGS'] if flag != '-O3'])) |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 513 | |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 514 | # AArch64 support |
Rodolph Perfetta | 9a9331f | 2016-12-09 22:05:48 +0000 | [diff] [blame] | 515 | if CanTargetAArch64(env): |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 516 | # The benchmarks. |
| 517 | aarch64_benchmark_names = util.ListCCFilesWithoutExt(config.dir_aarch64_benchmarks) |
| 518 | aarch64_benchmarks_build_dir = PrepareVariantDir('benchmarks/aarch64', TargetBuildDir(env)) |
| 519 | aarch64_benchmark_targets = [] |
Jacob Bramley | 1d925c0 | 2019-06-17 16:51:23 +0100 | [diff] [blame] | 520 | bench_utils = env.Object(join(aarch64_benchmarks_build_dir, 'bench-utils.o'), |
| 521 | join(aarch64_benchmarks_build_dir, 'bench-utils.cc')) |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 522 | for bench in aarch64_benchmark_names: |
Jacob Bramley | 1d925c0 | 2019-06-17 16:51:23 +0100 | [diff] [blame] | 523 | if bench != 'bench-utils': |
| 524 | prog = env.Program(join(aarch64_benchmarks_build_dir, bench), |
| 525 | [join(aarch64_benchmarks_build_dir, bench + '.cc'), bench_utils], |
| 526 | LIBS=[libvixl]) |
| 527 | aarch64_benchmark_targets.append(prog) |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 528 | env.Alias('aarch64_benchmarks', aarch64_benchmark_targets) |
| 529 | top_level_targets.Add('aarch64_benchmarks', 'Build the benchmarks for AArch64.') |
| 530 | |
| 531 | # The examples. |
| 532 | aarch64_example_names = util.ListCCFilesWithoutExt(config.dir_aarch64_examples) |
| 533 | aarch64_examples_build_dir = PrepareVariantDir('examples/aarch64', TargetBuildDir(env)) |
| 534 | aarch64_example_targets = [] |
| 535 | for example in aarch64_example_names: |
| 536 | prog = env.Program(join(aarch64_examples_build_dir, example), |
| 537 | join(aarch64_examples_build_dir, example + '.cc'), |
| 538 | LIBS=[libvixl]) |
| 539 | aarch64_example_targets.append(prog) |
| 540 | env.Alias('aarch64_examples', aarch64_example_targets) |
| 541 | top_level_targets.Add('aarch64_examples', 'Build the examples for AArch64.') |
| 542 | |
| 543 | # The tests. |
| 544 | test_aarch64_build_dir = PrepareVariantDir(join('test', 'aarch64'), TargetBuildDir(env)) |
| 545 | test_objects.append(env.Object( |
| 546 | Glob(join(test_aarch64_build_dir, '*.cc')), |
Anthony Barbier | 7b4df2b | 2019-03-12 17:36:15 +0000 | [diff] [blame] | 547 | CPPPATH = env['CPPPATH'] + [config.dir_tests], |
| 548 | CCFLAGS = [flag for flag in env['CCFLAGS'] if flag != '-O3'])) |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 549 | |
| 550 | # The test requires building the example files with specific options, so we |
| 551 | # create a separate variant dir for the example objects built this way. |
| 552 | test_aarch64_examples_vdir = join(TargetBuildDir(env), 'test', 'aarch64', 'test_examples') |
| 553 | VariantDir(test_aarch64_examples_vdir, '.') |
| 554 | test_aarch64_examples_obj = env.Object( |
Jacob Bramley | 0f71a76 | 2018-08-30 12:09:34 +0100 | [diff] [blame] | 555 | [Glob(join(test_aarch64_examples_vdir, join('test', 'aarch64', 'examples', '*.cc'))), |
Pierre Langlois | a3b2146 | 2016-08-04 16:01:51 +0100 | [diff] [blame] | 556 | Glob(join(test_aarch64_examples_vdir, join('examples/aarch64', '*.cc')))], |
| 557 | CCFLAGS = env['CCFLAGS'] + ['-DTEST_EXAMPLES'], |
| 558 | CPPPATH = env['CPPPATH'] + [config.dir_aarch64_examples] + [config.dir_tests]) |
| 559 | test_objects.append(test_aarch64_examples_obj) |
Pierre Langlois | 88c46b8 | 2016-06-02 18:15:32 +0100 | [diff] [blame] | 560 | |
| 561 | test = env.Program(join(test_build_dir, 'test-runner'), test_objects, |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 562 | LIBS=[libvixl]) |
| 563 | env.Alias('tests', test) |
| 564 | top_level_targets.Add('tests', 'Build the tests.') |
armvixl | 4a102ba | 2014-07-14 09:02:40 +0100 | [diff] [blame] | 565 | |
armvixl | 4a102ba | 2014-07-14 09:02:40 +0100 | [diff] [blame] | 566 | |
armvixl | db64434 | 2015-07-21 11:37:10 +0100 | [diff] [blame] | 567 | env.Alias('all', top_level_targets.targets) |
| 568 | top_level_targets.Add('all', 'Build all the targets above.') |
| 569 | |
| 570 | Help('\n\nAvailable top level targets:\n' + top_level_targets.Help()) |
Pierre Langlois | 287e6d1 | 2016-11-21 14:56:01 +0000 | [diff] [blame] | 571 | |
| 572 | extra_targets = VIXLTargets() |
| 573 | |
| 574 | # Build documentation |
| 575 | doc = [ |
| 576 | env.Markdown('README.md'), |
| 577 | env.Markdown('doc/changelog.md'), |
| 578 | env.Markdown('doc/aarch32/getting-started-aarch32.md'), |
| 579 | env.Markdown('doc/aarch32/design/code-generation-aarch32.md'), |
| 580 | env.Markdown('doc/aarch32/design/literal-pool-aarch32.md'), |
| 581 | env.Markdown('doc/aarch64/supported-instructions-aarch64.md'), |
| 582 | env.Markdown('doc/aarch64/getting-started-aarch64.md'), |
| 583 | env.Markdown('doc/aarch64/topics/ycm.md'), |
| 584 | env.Markdown('doc/aarch64/topics/extending-the-disassembler.md'), |
| 585 | env.Markdown('doc/aarch64/topics/index.md'), |
| 586 | ] |
| 587 | env.Alias('doc', doc) |
| 588 | extra_targets.Add('doc', 'Convert documentation to HTML (requires the ' |
| 589 | '`markdown` program).') |
| 590 | |
| 591 | Help('\nAvailable extra targets:\n' + extra_targets.Help()) |