Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 1 | project('flashromutils', 'c', |
Nico Huber | 2f6936b | 2019-09-24 18:31:38 +0200 | [diff] [blame] | 2 | version : run_command('util/getversion.sh', '-v').stdout().strip(), |
Nico Huber | b417c0c | 2019-09-24 22:12:40 +0200 | [diff] [blame] | 3 | license : 'GPL-2.0', |
Angel Pons | 3064943 | 2021-01-26 10:21:46 +0100 | [diff] [blame] | 4 | meson_version : '>=0.50.0', |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 5 | default_options : ['warning_level=2', 'c_std=c99'], |
| 6 | ) |
| 7 | |
| 8 | # libtool versioning |
| 9 | lt_current = '1' |
| 10 | lt_revision = '0' |
| 11 | lt_age = '0' |
| 12 | lt_version = '@0@.@1@.@2@'.format(lt_current, lt_age, lt_revision) |
| 13 | |
Jacob Garber | 4a84ec2 | 2019-07-25 19:12:31 -0600 | [diff] [blame] | 14 | # hide/enable some warnings |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 15 | warning_flags = [ |
Jacob Garber | 4a84ec2 | 2019-07-25 19:12:31 -0600 | [diff] [blame] | 16 | '-Wwrite-strings', |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 17 | '-Wno-unused-parameter', |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 18 | '-Wno-address-of-packed-member', |
| 19 | '-Wno-enum-conversion', |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 20 | '-Wno-missing-braces', |
| 21 | ] |
| 22 | |
| 23 | conf = configuration_data() |
| 24 | |
| 25 | cc = meson.get_compiler('c') |
| 26 | add_project_arguments(cc.get_supported_arguments(warning_flags), language : 'c') |
| 27 | add_project_arguments('-D_DEFAULT_SOURCE', language : 'c') |
Rosen Penev | 566193f | 2020-07-18 12:50:16 -0700 | [diff] [blame] | 28 | add_project_arguments('-D_POSIX_C_SOURCE=200809L', language : 'c') # required for fileno, nanosleep, and strndup |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 29 | add_project_arguments('-D_BSD_SOURCE', language : 'c') # required for glibc < v2.19 |
| 30 | add_project_arguments('-DFLASHROM_VERSION="' + meson.project_version() + '"', language : 'c') |
| 31 | |
| 32 | # get defaults from configure |
| 33 | config_atahpt = get_option('config_atahpt') |
| 34 | config_atapromise = get_option('config_atapromise') |
| 35 | config_atavia = get_option('config_atavia') |
| 36 | config_buspirate_spi = get_option('config_buspirate_spi') |
| 37 | config_ch341a_spi = get_option('config_ch341a_spi') |
| 38 | config_dediprog = get_option('config_dediprog') |
| 39 | config_developerbox_spi = get_option('config_developerbox_spi') |
| 40 | config_digilent_spi = get_option('config_digilent_spi') |
Jean THOMAS | e28d8e4 | 2022-10-11 17:54:30 +0200 | [diff] [blame] | 41 | config_dirtyjtag_spi = get_option('config_dirtyjtag_spi') |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 42 | config_drkaiser = get_option('config_drkaiser') |
| 43 | config_dummy = get_option('config_dummy') |
| 44 | config_ft2232_spi = get_option('config_ft2232_spi') |
| 45 | config_gfxnvidia = get_option('config_gfxnvidia') |
| 46 | config_internal = get_option('config_internal') |
| 47 | config_it8212 = get_option('config_it8212') |
Marc Schink | 7ec2d63 | 2020-12-08 22:20:50 +0100 | [diff] [blame] | 48 | config_jlink_spi = get_option('config_jlink_spi') |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 49 | config_linux_mtd = get_option('config_linux_mtd') |
| 50 | config_linux_spi = get_option('config_linux_spi') |
| 51 | config_mstarddc_spi = get_option('config_mstarddc_spi') |
| 52 | config_nic3com = get_option('config_nic3com') |
| 53 | config_nicintel_eeprom = get_option('config_nicintel_eeprom') |
| 54 | config_nicintel = get_option('config_nicintel') |
| 55 | config_nicintel_spi = get_option('config_nicintel_spi') |
| 56 | config_nicnatsemi = get_option('config_nicnatsemi') |
| 57 | config_nicrealtek = get_option('config_nicrealtek') |
| 58 | config_ogp_spi = get_option('config_ogp_spi') |
| 59 | config_pickit2_spi = get_option('config_pickit2_spi') |
| 60 | config_pony_spi = get_option('config_pony_spi') |
| 61 | config_rayer_spi = get_option('config_rayer_spi') |
| 62 | config_satamv = get_option('config_satamv') |
| 63 | config_satasii = get_option('config_satasii') |
| 64 | config_serprog = get_option('config_serprog') |
| 65 | config_usbblaster_spi = get_option('config_usbblaster_spi') |
Miklós Márton | 324929c | 2019-08-01 19:14:10 +0200 | [diff] [blame] | 66 | config_stlinkv3_spi = get_option('config_stlinkv3_spi') |
Thomas Heijligen | 84e9c91 | 2021-06-01 16:22:14 +0200 | [diff] [blame] | 67 | config_default_programmer_name = get_option('default_programmer_name') |
| 68 | config_default_programmer_args = get_option('default_programmer_args') |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 69 | |
| 70 | cargs = [] |
| 71 | deps = [] |
| 72 | srcs = [] |
| 73 | |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 74 | need_raw_access = false |
| 75 | need_serial = false |
| 76 | |
| 77 | # check for required symbols |
| 78 | if cc.has_function('clock_gettime') |
| 79 | add_project_arguments('-DHAVE_CLOCK_GETTIME=1', language : 'c') |
| 80 | endif |
| 81 | if cc.has_function('strnlen') |
| 82 | add_project_arguments('-DHAVE_STRNLEN=1', language : 'c') |
| 83 | endif |
| 84 | if cc.check_header('sys/utsname.h') |
| 85 | add_project_arguments('-DHAVE_UTSNAME=1', language : 'c') |
| 86 | endif |
| 87 | |
| 88 | # some programmers require libusb |
| 89 | if get_option('usb') |
| 90 | srcs += 'usbdev.c' |
| 91 | deps += dependency('libusb-1.0') |
| 92 | else |
| 93 | config_ch341a_spi = false |
| 94 | config_dediprog = false |
| 95 | config_digilent_spi = false |
Jean THOMAS | e28d8e4 | 2022-10-11 17:54:30 +0200 | [diff] [blame] | 96 | config_dirtyjtag_spi = false |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 97 | config_developerbox_spi = false |
Thomas Heijligen | b221cd7 | 2019-04-05 15:08:35 +0200 | [diff] [blame] | 98 | config_pickit2_spi = false |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 99 | endif |
| 100 | |
| 101 | # some programmers require libpci |
| 102 | if get_option('pciutils') |
| 103 | srcs += 'pcidev.c' |
| 104 | deps += dependency('libpci') |
Daniel Campello | 924e631 | 2021-03-17 09:14:11 -0600 | [diff] [blame^] | 105 | need_raw_access = true |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 106 | cargs += '-DNEED_PCI=1' |
| 107 | else |
| 108 | config_atahpt = false |
| 109 | config_atapromise = false |
| 110 | config_atavia = false |
| 111 | config_drkaiser = false |
| 112 | config_gfxnvidia = false |
| 113 | config_internal = false |
| 114 | config_it8212 = false |
| 115 | config_nic3com = false |
| 116 | config_nicintel_eeprom = false |
| 117 | config_nicintel = false |
| 118 | config_nicintel_spi = false |
| 119 | config_nicnatsemi = false |
| 120 | config_nicrealtek = false |
| 121 | config_ogp_spi = false |
| 122 | config_rayer_spi = false |
| 123 | config_satamv = false |
| 124 | config_satasii = false |
| 125 | endif |
| 126 | |
| 127 | # set defines for configured programmers |
| 128 | if config_atahpt |
| 129 | srcs += 'atahpt.c' |
| 130 | cargs += '-DCONFIG_ATAHPT=1' |
| 131 | endif |
| 132 | if config_atapromise |
| 133 | srcs += 'atapromise.c' |
| 134 | cargs += '-DCONFIG_ATAPROMISE=1' |
| 135 | endif |
| 136 | if config_atavia |
| 137 | srcs += 'atavia.c' |
| 138 | cargs += '-DCONFIG_ATAVIA=1' |
| 139 | endif |
| 140 | if config_buspirate_spi |
| 141 | srcs += 'buspirate_spi.c' |
| 142 | cargs += '-DCONFIG_BUSPIRATE_SPI=1' |
| 143 | need_serial = true |
| 144 | endif |
| 145 | if config_ch341a_spi |
| 146 | srcs += 'ch341a_spi.c' |
| 147 | cargs += '-DCONFIG_CH341A_SPI=1' |
| 148 | endif |
| 149 | if config_dediprog |
| 150 | srcs += 'dediprog.c' |
| 151 | cargs += '-DCONFIG_DEDIPROG=1' |
| 152 | endif |
| 153 | if config_developerbox_spi |
| 154 | srcs += 'developerbox_spi.c' |
| 155 | cargs += '-DCONFIG_DEVELOPERBOX_SPI=1' |
| 156 | endif |
| 157 | if config_digilent_spi |
| 158 | srcs += 'digilent_spi.c' |
| 159 | cargs += '-DCONFIG_DIGILENT_SPI=1' |
| 160 | endif |
Jean THOMAS | e28d8e4 | 2022-10-11 17:54:30 +0200 | [diff] [blame] | 161 | if config_dirtyjtag_spi |
| 162 | srcs += 'dirtyjtag_spi.c' |
| 163 | cargs += '-DCONFIG_DIRTYJTAG_SPI=1' |
| 164 | endif |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 165 | if config_drkaiser |
| 166 | srcs += 'drkaiser.c' |
| 167 | cargs += '-DCONFIG_DRKAISER=1' |
| 168 | endif |
| 169 | if config_dummy |
| 170 | srcs += 'dummyflasher.c' |
| 171 | cargs += '-DCONFIG_DUMMY=1' |
| 172 | endif |
| 173 | if config_ft2232_spi |
| 174 | srcs += 'ft2232_spi.c' |
| 175 | cargs += '-DCONFIG_FT2232_SPI=1' |
| 176 | deps += dependency('libftdi1') |
| 177 | cargs += '-DHAVE_FT232H=1' |
| 178 | endif |
| 179 | if config_gfxnvidia |
| 180 | srcs += 'gfxnvidia.c' |
| 181 | cargs += '-DCONFIG_GFXNVIDIA=1' |
| 182 | endif |
| 183 | if config_internal |
| 184 | srcs += 'board_enable.c' |
| 185 | srcs += 'cbtable.c' |
| 186 | srcs += 'chipset_enable.c' |
| 187 | srcs += 'internal.c' |
| 188 | srcs += 'processor_enable.c' |
| 189 | if target_machine.cpu_family() == 'x86' or target_machine.cpu_family() == 'x86_64' |
| 190 | srcs += 'amd_imc.c' |
| 191 | srcs += 'dmi.c' |
| 192 | srcs += 'ichspi.c' |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 193 | srcs += 'it87spi.c' |
| 194 | srcs += 'mcp6x_spi.c' |
| 195 | srcs += 'sb600spi.c' |
| 196 | srcs += 'wbsio_spi.c' |
| 197 | endif |
| 198 | config_bitbang_spi = true |
| 199 | cargs += '-DCONFIG_INTERNAL=1' |
| 200 | if get_option('config_internal_dmi') |
| 201 | # Use internal DMI/SMBIOS decoder by default instead of relying on dmidecode. |
| 202 | cargs += '-DCONFIG_INTERNAL_DMI=1' |
| 203 | endif |
| 204 | endif |
| 205 | if config_it8212 |
| 206 | srcs += 'it8212.c' |
| 207 | cargs += '-DCONFIG_IT8212=1' |
| 208 | endif |
Marc Schink | 7ec2d63 | 2020-12-08 22:20:50 +0100 | [diff] [blame] | 209 | if config_jlink_spi |
| 210 | srcs += 'jlink_spi.c' |
| 211 | cargs += '-DCONFIG_JLINK_SPI=1' |
| 212 | deps += dependency('libjaylink') |
| 213 | endif |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 214 | if config_linux_mtd |
| 215 | srcs += 'linux_mtd.c' |
| 216 | cargs += '-DCONFIG_LINUX_MTD=1' |
| 217 | endif |
| 218 | if config_linux_spi |
| 219 | srcs += 'linux_spi.c' |
| 220 | cargs += '-DCONFIG_LINUX_SPI=1' |
| 221 | endif |
| 222 | if config_mstarddc_spi |
| 223 | srcs += 'mstarddc_spi.c' |
| 224 | cargs += '-DCONFIG_MSTARDDC_SPI=1' |
| 225 | endif |
| 226 | if config_nic3com |
| 227 | srcs += 'nic3com.c' |
| 228 | cargs += '-DCONFIG_NIC3COM=1' |
| 229 | endif |
| 230 | if config_nicintel |
| 231 | srcs += 'nicintel.c' |
| 232 | cargs += '-DCONFIG_NICINTEL=1' |
| 233 | endif |
| 234 | if config_nicintel_eeprom |
| 235 | srcs += 'nicintel_eeprom.c' |
| 236 | cargs += '-DCONFIG_NICINTEL_EEPROM=1' |
| 237 | endif |
| 238 | if config_nicintel_spi |
| 239 | srcs += 'nicintel_spi.c' |
| 240 | config_bitbang_spi = true |
| 241 | cargs += '-DCONFIG_NICINTEL_SPI=1' |
| 242 | endif |
| 243 | if config_nicnatsemi |
| 244 | srcs += 'nicnatsemi.c' |
| 245 | cargs += '-DCONFIG_NICNATSEMI=1' |
| 246 | endif |
| 247 | if config_nicrealtek |
| 248 | srcs += 'nicrealtek.c' |
| 249 | cargs += '-DCONFIG_NICREALTEK=1' |
| 250 | endif |
| 251 | if config_ogp_spi |
| 252 | config_bitbang_spi = true |
| 253 | srcs += 'ogp_spi.c' |
| 254 | cargs += '-DCONFIG_OGP_SPI=1' |
| 255 | endif |
| 256 | if config_pickit2_spi |
| 257 | srcs += 'pickit2_spi.c' |
| 258 | cargs += '-DCONFIG_PICKIT2_SPI=1' |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 259 | endif |
| 260 | if config_pony_spi |
| 261 | srcs += 'pony_spi.c' |
| 262 | need_serial = true |
| 263 | config_bitbang_spi = true |
| 264 | cargs += '-DCONFIG_PONY_SPI=1' |
| 265 | endif |
| 266 | if config_rayer_spi |
| 267 | srcs += 'rayer_spi.c' |
| 268 | config_bitbang_spi = true |
| 269 | need_raw_access = true |
| 270 | cargs += '-DCONFIG_RAYER_SPI=1' |
| 271 | endif |
| 272 | if config_satamv |
| 273 | srcs += 'satamv.c' |
| 274 | cargs += '-DCONFIG_SATAMV=1' |
| 275 | endif |
| 276 | if config_satasii |
| 277 | srcs += 'satasii.c' |
| 278 | cargs += '-DCONFIG_SATASII=1' |
| 279 | endif |
| 280 | if config_serprog |
| 281 | srcs += 'serprog.c' |
| 282 | cargs += '-DCONFIG_SERPROG=1' |
| 283 | need_serial = true |
| 284 | endif |
| 285 | if config_usbblaster_spi |
| 286 | srcs += 'usbblaster_spi.c' |
| 287 | cargs += '-DCONFIG_USBBLASTER_SPI=1' |
| 288 | endif |
Miklós Márton | 324929c | 2019-08-01 19:14:10 +0200 | [diff] [blame] | 289 | if config_stlinkv3_spi |
| 290 | srcs += 'stlinkv3_spi.c' |
| 291 | cargs += '-DCONFIG_STLINKV3_SPI=1' |
| 292 | endif |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 293 | |
| 294 | # bitbanging SPI infrastructure |
| 295 | if config_bitbang_spi |
| 296 | srcs += 'bitbang_spi.c' |
| 297 | cargs += '-DCONFIG_BITBANG_SPI=1' |
| 298 | endif |
| 299 | |
| 300 | # raw memory, MSR or PCI port I/O access |
| 301 | if need_raw_access |
| 302 | srcs += 'hwaccess.c' |
| 303 | srcs += 'physmap.c' |
| 304 | cargs += '-DNEED_RAW_ACCESS=1' |
| 305 | endif |
| 306 | |
| 307 | # raw serial IO |
| 308 | if need_serial |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 309 | srcs += 'serial.c' |
Thomas Heijligen | 140c126 | 2021-09-27 15:12:26 +0200 | [diff] [blame] | 310 | if host_machine.system() == 'linux' |
| 311 | srcs += 'custom_baud_linux.c' |
| 312 | else |
| 313 | srcs += 'custom_baud.c' |
| 314 | endif |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 315 | endif |
| 316 | |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 317 | prefix = get_option('prefix') |
| 318 | sbindir = join_paths(prefix, get_option('sbindir')) |
| 319 | libdir = join_paths(prefix, get_option('libdir')) |
Richard Hughes | dad3a16 | 2020-02-17 09:57:01 +0000 | [diff] [blame] | 320 | mandir = join_paths(prefix, get_option('mandir')) |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 321 | |
| 322 | install_headers([ |
| 323 | 'libflashrom.h', |
| 324 | ], |
| 325 | ) |
| 326 | |
| 327 | # core modules needed by both the library and the CLI |
| 328 | srcs += '82802ab.c' |
| 329 | srcs += 'at45db.c' |
| 330 | srcs += 'edi.c' |
| 331 | srcs += 'en29lv640b.c' |
| 332 | srcs += 'flashchips.c' |
| 333 | srcs += 'flashrom.c' |
| 334 | srcs += 'fmap.c' |
| 335 | srcs += 'helpers.c' |
| 336 | srcs += 'ich_descriptors.c' |
| 337 | srcs += 'jedec.c' |
| 338 | srcs += 'layout.c' |
| 339 | srcs += 'libflashrom.c' |
| 340 | srcs += 'opaque.c' |
| 341 | srcs += 'print.c' |
| 342 | srcs += 'programmer.c' |
Thomas Heijligen | bbfacff | 2021-03-31 20:40:01 +0200 | [diff] [blame] | 343 | srcs += 'programmer_table.c' |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 344 | srcs += 'sfdp.c' |
| 345 | srcs += 'spi25.c' |
| 346 | srcs += 'spi25_statusreg.c' |
David Hendricks | 349b5d2 | 2019-10-05 12:44:27 -0700 | [diff] [blame] | 347 | srcs += 'spi95.c' |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 348 | srcs += 'spi.c' |
| 349 | srcs += 'sst28sf040.c' |
| 350 | srcs += 'sst49lfxxxc.c' |
| 351 | srcs += 'sst_fwhub.c' |
| 352 | srcs += 'stm50.c' |
| 353 | srcs += 'udelay.c' |
| 354 | srcs += 'w29ee011.c' |
| 355 | srcs += 'w39.c' |
Nikolai Artemiev | da1c834 | 2021-10-21 00:58:12 +1100 | [diff] [blame] | 356 | srcs += 'writeprotect.c' |
Nikolai Artemiev | c9feb1b | 2021-10-21 01:35:13 +1100 | [diff] [blame] | 357 | srcs += 'writeprotect_ranges.c' |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 358 | |
| 359 | mapfile = 'libflashrom.map' |
| 360 | vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile) |
| 361 | flashrom = shared_library( |
| 362 | 'flashrom', |
| 363 | sources : [ |
| 364 | srcs, |
| 365 | ], |
| 366 | soversion : lt_current, |
| 367 | version : lt_version, |
| 368 | dependencies : [ |
| 369 | deps, |
| 370 | ], |
| 371 | c_args : [ |
| 372 | cargs, |
| 373 | ], |
| 374 | install : true, |
| 375 | link_args : vflag, |
| 376 | link_depends : mapfile, |
| 377 | ) |
| 378 | |
Mario Limonciello | d954d5d | 2019-09-24 16:06:57 -0500 | [diff] [blame] | 379 | version = meson.project_version() |
| 380 | #strip leading characters |
| 381 | if version.startswith('v') |
| 382 | version = version.split('v')[1] |
| 383 | endif |
| 384 | if version.startswith('p') |
| 385 | version = version.split('p')[1] |
| 386 | endif |
| 387 | |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 388 | pkgg = import('pkgconfig') |
| 389 | pkgg.generate( |
| 390 | libraries : flashrom, |
Mario Limonciello | d954d5d | 2019-09-24 16:06:57 -0500 | [diff] [blame] | 391 | version : version, |
Mario Limonciello | 2a8d439 | 2019-10-15 13:32:19 -0500 | [diff] [blame] | 392 | name : 'flashrom', |
| 393 | filebase : 'flashrom', |
| 394 | description : 'library to interact with flashrom', |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 395 | ) |
| 396 | |
Richard Hughes | dad3a16 | 2020-02-17 09:57:01 +0000 | [diff] [blame] | 397 | conf.set('VERSION', version) |
| 398 | conf.set('MAN_DATE', run_command('util/getrevision.sh', '--date', 'flashrom.8.tmpl').stdout().strip()) |
| 399 | configure_file( |
| 400 | input : 'flashrom.8.tmpl', |
| 401 | output : 'flashrom.8', |
| 402 | configuration : conf, |
| 403 | install: true, |
| 404 | install_dir: join_paths(mandir, 'man8'), |
| 405 | ) |
| 406 | |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 407 | flashrom_dep = declare_dependency( |
| 408 | link_with : flashrom, |
| 409 | include_directories : include_directories('.'), |
| 410 | dependencies : deps |
| 411 | ) |
| 412 | |
Thomas Heijligen | 84e9c91 | 2021-06-01 16:22:14 +0200 | [diff] [blame] | 413 | if config_default_programmer_name != '' |
| 414 | cargs += '-DCONFIG_DEFAULT_PROGRAMMER_NAME=&programmer_' + config_default_programmer_name |
| 415 | else |
| 416 | cargs += '-DCONFIG_DEFAULT_PROGRAMMER_NAME=NULL' |
| 417 | endif |
| 418 | |
| 419 | cargs += '-DCONFIG_DEFAULT_PROGRAMMER_ARGS="' + config_default_programmer_args + '"' |
| 420 | |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 421 | # we can't just link_with libflashrom as we require all the internal symbols... |
| 422 | executable( |
| 423 | 'flashrom', |
| 424 | sources : [ |
| 425 | srcs, |
| 426 | 'cli_classic.c', |
| 427 | 'cli_common.c', |
| 428 | 'cli_output.c', |
| 429 | 'flashrom.c', |
| 430 | ], |
| 431 | dependencies : [ |
| 432 | deps, |
| 433 | ], |
| 434 | c_args : [ |
| 435 | cargs, |
Richard Hughes | cb97368 | 2018-12-19 11:44:22 +0000 | [diff] [blame] | 436 | ], |
| 437 | install : true, |
| 438 | install_dir : sbindir, |
| 439 | ) |
| 440 | |
| 441 | subdir('util') |