Willy Tu | bcae900 | 2021-09-12 13:58:04 -0700 | [diff] [blame] | 1 | firmware_inc = include_directories('.') |
| 2 | |
| 3 | # phosphor-ipmi-flash config |
| 4 | config_data = [] |
| 5 | if get_option('update-type') == 'static-layout' |
| 6 | if get_option('reboot-update') |
| 7 | config_data += 'config-static-bmc-reboot.json' |
| 8 | else |
| 9 | if get_option('update-status') |
| 10 | config_data += 'config-static-bmc-with-update-status.json' |
| 11 | else |
| 12 | config_data += 'config-static-bmc.json' |
| 13 | endif |
| 14 | endif |
| 15 | endif |
| 16 | |
| 17 | if get_option('host-bios') |
| 18 | config_data += 'config-bios.json' |
| 19 | endif |
| 20 | |
| 21 | foreach data : config_data |
| 22 | configure_file( |
| 23 | input: data + '.in', |
| 24 | output: data, |
| 25 | configuration: conf_data, |
| 26 | install: true, |
| 27 | install_dir: get_option('datadir') / 'phosphor-ipmi-flash') |
| 28 | endforeach |
| 29 | |
| 30 | # temp files |
| 31 | install_data( |
| 32 | 'phosphor-ipmi-flash.conf', |
| 33 | install_dir: get_option('libdir') / 'tmpfiles.d') |
| 34 | |
| 35 | # systemd configs |
| 36 | systemd_data = [ |
| 37 | 'phosphor-ipmi-flash-bmc-prepare.target', |
| 38 | 'phosphor-ipmi-flash-bmc-verify.target', |
| 39 | 'phosphor-ipmi-flash-bmc-update.target', |
| 40 | ] |
| 41 | |
| 42 | if get_option('host-bios') |
| 43 | systemd_data += [ |
| 44 | 'phosphor-ipmi-flash-bios-prepare.target', |
| 45 | 'phosphor-ipmi-flash-bios-verify.target', |
| 46 | 'phosphor-ipmi-flash-bios-update.target'] |
| 47 | endif |
| 48 | |
| 49 | systemd = dependency('systemd') |
| 50 | if systemd.found() |
| 51 | foreach data : systemd_data |
| 52 | configure_file( |
| 53 | input: data + '.in', |
| 54 | output: data, |
| 55 | configuration: conf_data, |
| 56 | install: true, |
Patrick Williams | 7fb9abd | 2023-04-12 08:01:24 -0500 | [diff] [blame] | 57 | install_dir: systemd.get_variable('systemdsystemunitdir')) |
Willy Tu | bcae900 | 2021-09-12 13:58:04 -0700 | [diff] [blame] | 58 | endforeach |
| 59 | endif |
| 60 | |
| 61 | firmware_source = [ |
| 62 | 'firmware_handlers_builder.cpp', |
| 63 | 'firmware_handler.cpp', |
| 64 | 'lpc_handler.cpp'] |
| 65 | |
| 66 | if (get_option('lpc-type') == 'aspeed-lpc' or |
| 67 | not get_option('tests').disabled()) |
| 68 | firmware_source += 'lpc_aspeed.cpp' |
| 69 | endif |
| 70 | |
| 71 | if (get_option('lpc-type') == 'nuvoton-lpc' or |
| 72 | not get_option('tests').disabled()) |
| 73 | firmware_source += 'lpc_nuvoton.cpp' |
| 74 | endif |
| 75 | |
| 76 | if (get_option('p2a-type') == 'aspeed-p2a' or |
| 77 | not get_option('tests').disabled()) |
| 78 | firmware_source += 'pci_handler.cpp' |
| 79 | endif |
| 80 | |
| 81 | if get_option('p2a-type') == 'nuvoton-p2a-vga' |
| 82 | firmware_source += 'pci_nuvoton_handler.cpp' |
| 83 | endif |
| 84 | |
| 85 | if get_option('p2a-type') == 'nuvoton-p2a-mbox' |
| 86 | firmware_source += 'pci_nuvoton_handler.cpp' |
| 87 | endif |
| 88 | |
| 89 | if get_option('net-bridge') |
| 90 | firmware_source += 'net_handler.cpp' |
| 91 | endif |
| 92 | |
| 93 | firmware_pre = declare_dependency( |
| 94 | include_directories: [root_inc, bmc_inc, firmware_inc], |
William A. Kennington III | 0df4085 | 2021-11-01 13:56:42 -0700 | [diff] [blame] | 95 | dependencies: [ |
Willy Tu | bcae900 | 2021-09-12 13:58:04 -0700 | [diff] [blame] | 96 | dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), |
| 97 | common_dep, |
| 98 | blobs_dep, |
| 99 | sys_dep, |
William A. Kennington III | 0df4085 | 2021-11-01 13:56:42 -0700 | [diff] [blame] | 100 | ]) |
Willy Tu | bcae900 | 2021-09-12 13:58:04 -0700 | [diff] [blame] | 101 | |
| 102 | firmware_lib = static_library( |
| 103 | 'firmwareblob', |
| 104 | firmware_source, |
| 105 | conf_h, |
| 106 | implicit_include_directories: false, |
| 107 | dependencies: firmware_pre) |
| 108 | |
| 109 | firmware_dep = declare_dependency( |
| 110 | link_with: firmware_lib, |
| 111 | dependencies: firmware_pre) |
| 112 | |
| 113 | shared_module( |
| 114 | 'firmwareblob', |
| 115 | 'main.cpp', |
| 116 | implicit_include_directories: false, |
| 117 | dependencies: [ |
| 118 | firmware_dep, |
| 119 | dependency('libipmid'), |
| 120 | ], |
| 121 | install: true, |
| 122 | install_dir: get_option('libdir') / 'blob-ipmid') |
| 123 | |
| 124 | if not get_option('tests').disabled() |
| 125 | subdir('test') |
William A. Kennington III | 0df4085 | 2021-11-01 13:56:42 -0700 | [diff] [blame] | 126 | endif |