Stefan Reinauer | 179206a | 2012-11-30 12:19:59 -0800 | [diff] [blame] | 1 | # |
| 2 | # This file is part of the coreboot project. |
| 3 | # |
| 4 | # Copyright (C) 2009 coresystems GmbH |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; version 2 of the License. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
Patrick Georgi | b890a12 | 2015-03-26 15:17:45 +0100 | [diff] [blame] | 17 | # Foundation, Inc. |
Stefan Reinauer | 179206a | 2012-11-30 12:19:59 -0800 | [diff] [blame] | 18 | # |
Aaron Durbin | 0f33307 | 2014-01-30 17:19:46 -0600 | [diff] [blame] | 19 | subdirs-y += loaders |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 20 | |
Aaron Durbin | ac12c66c | 2015-05-20 12:08:55 -0500 | [diff] [blame] | 21 | bootblock-y += assets.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 22 | bootblock-y += prog_loaders.c |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 23 | bootblock-y += prog_ops.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 24 | bootblock-y += cbfs.c |
| 25 | bootblock-y += cbfs_boot_props.c |
Vadim Bendebury | adcb095 | 2014-05-01 12:23:09 -0700 | [diff] [blame] | 26 | bootblock-$(CONFIG_COMMON_CBFS_SPI_WRAPPER) += cbfs_spi.c |
David Hendricks | 6fab365 | 2014-11-06 15:22:10 -0800 | [diff] [blame] | 27 | bootblock-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c |
Julius Werner | 7a8a4ab | 2015-05-22 16:26:40 -0700 | [diff] [blame] | 28 | bootblock-y += libgcc.c |
Aaron Durbin | e5e3630 | 2014-09-25 10:05:15 -0500 | [diff] [blame] | 29 | bootblock-$(CONFIG_GENERIC_UDELAY) += timer.c |
| 30 | |
Patrick Georgi | 8b17404 | 2015-04-27 18:03:50 +0200 | [diff] [blame] | 31 | bootblock-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Kyösti Mälkki | 8659e40 | 2014-12-21 08:55:47 +0200 | [diff] [blame] | 32 | bootblock-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c |
Hung-Te Lin | fe18792 | 2013-02-01 01:09:24 +0800 | [diff] [blame] | 33 | bootblock-y += memchr.c |
Hung-Te Lin | fe18792 | 2013-02-01 01:09:24 +0800 | [diff] [blame] | 34 | bootblock-y += memcmp.c |
Aaron Durbin | 127525c | 2015-03-26 12:29:12 -0500 | [diff] [blame] | 35 | bootblock-y += mem_pool.c |
Aaron Durbin | 5d5f4b3 | 2015-03-26 14:39:07 -0500 | [diff] [blame] | 36 | bootblock-y += region.c |
Aaron Durbin | c6588c5 | 2015-05-15 13:15:34 -0500 | [diff] [blame] | 37 | bootblock-y += boot_device.c |
Aaron Durbin | 0424c95 | 2015-03-28 23:56:22 -0500 | [diff] [blame] | 38 | bootblock-y += fmap.c |
Hung-Te Lin | fe18792 | 2013-02-01 01:09:24 +0800 | [diff] [blame] | 39 | |
Aaron Durbin | ac12c66c | 2015-05-20 12:08:55 -0500 | [diff] [blame] | 40 | verstage-y += assets.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 41 | verstage-y += prog_loaders.c |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 42 | verstage-y += prog_ops.c |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 43 | verstage-y += delay.c |
| 44 | verstage-y += cbfs.c |
Aaron Durbin | 17200ad | 2015-05-01 16:48:54 -0500 | [diff] [blame] | 45 | verstage-y += halt.c |
Aaron Durbin | 0424c95 | 2015-03-28 23:56:22 -0500 | [diff] [blame] | 46 | verstage-y += fmap.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 47 | verstage-y += cbfs_boot_props.c |
Julius Werner | 7a8a4ab | 2015-05-22 16:26:40 -0700 | [diff] [blame] | 48 | verstage-y += libgcc.c |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 49 | verstage-y += memcmp.c |
Patrick Georgi | 8b17404 | 2015-04-27 18:03:50 +0200 | [diff] [blame] | 50 | verstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Aaron Durbin | 5d5f4b3 | 2015-03-26 14:39:07 -0500 | [diff] [blame] | 51 | verstage-y += region.c |
Aaron Durbin | c6588c5 | 2015-05-15 13:15:34 -0500 | [diff] [blame] | 52 | verstage-y += boot_device.c |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 53 | verstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c |
Vadim Bendebury | 3486d1f | 2014-10-16 11:24:12 -0700 | [diff] [blame] | 54 | verstage-$(CONFIG_COMMON_CBFS_SPI_WRAPPER) += cbfs_spi.c |
Yen Lin | 5bdbd00 | 2015-04-08 16:55:17 -0700 | [diff] [blame] | 55 | |
| 56 | ifeq ($(MOCK_TPM),1) |
Patrick Georgi | 27ef602 | 2015-04-30 14:25:14 +0200 | [diff] [blame] | 57 | libverstage-y += mocked_tlcl.c |
Yen Lin | 5bdbd00 | 2015-04-08 16:55:17 -0700 | [diff] [blame] | 58 | else |
Patrick Georgi | 27ef602 | 2015-04-30 14:25:14 +0200 | [diff] [blame] | 59 | libverstage-y += tlcl.c |
Yen Lin | 5bdbd00 | 2015-04-08 16:55:17 -0700 | [diff] [blame] | 60 | endif |
| 61 | |
Vadim Bendebury | 3486d1f | 2014-10-16 11:24:12 -0700 | [diff] [blame] | 62 | verstage-$(CONFIG_GENERIC_UDELAY) += timer.c |
David Hendricks | 6fab365 | 2014-11-06 15:22:10 -0800 | [diff] [blame] | 63 | verstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c |
Aaron Durbin | 127525c | 2015-03-26 12:29:12 -0500 | [diff] [blame] | 64 | verstage-y += mem_pool.c |
Daisuke Nojiri | bcc1d42 | 2014-06-19 19:16:24 -0700 | [diff] [blame] | 65 | |
Aaron Durbin | ac12c66c | 2015-05-20 12:08:55 -0500 | [diff] [blame] | 66 | romstage-y += assets.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 67 | romstage-y += prog_loaders.c |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 68 | romstage-y += prog_ops.c |
Gabe Black | 1025f3a | 2011-09-16 02:18:56 -0700 | [diff] [blame] | 69 | romstage-y += memchr.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 70 | romstage-y += memcmp.c |
Furquan Shaikh | 133096b | 2014-07-31 09:28:55 -0700 | [diff] [blame] | 71 | $(foreach arch,$(ARCH_SUPPORTED),\ |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 72 | $(eval rmodules_$(arch)-y += memcmp.c) \ |
| 73 | $(eval rmodules_$(arch)-y += rmodule.ld)) |
Furquan Shaikh | 133096b | 2014-07-31 09:28:55 -0700 | [diff] [blame] | 74 | |
Aaron Durbin | 0424c95 | 2015-03-28 23:56:22 -0500 | [diff] [blame] | 75 | romstage-y += fmap.c |
Stefan Reinauer | 3905e3d | 2013-08-29 16:01:05 -0700 | [diff] [blame] | 76 | romstage-$(CONFIG_I2C_TPM) += delay.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 77 | romstage-y += cbfs.c |
| 78 | romstage-y += cbfs_boot_props.c |
Vadim Bendebury | adcb095 | 2014-05-01 12:23:09 -0700 | [diff] [blame] | 79 | romstage-$(CONFIG_COMMON_CBFS_SPI_WRAPPER) += cbfs_spi.c |
Edward O'Callaghan | cd31afd | 2014-11-11 12:27:06 +1100 | [diff] [blame] | 80 | romstage-$(CONFIG_COMPRESS_RAMSTAGE) += lzma.c lzmadecode.c |
Julius Werner | 7a8a4ab | 2015-05-22 16:26:40 -0700 | [diff] [blame] | 81 | romstage-y += libgcc.c |
David Hendricks | 560c643 | 2014-02-13 13:07:50 -0800 | [diff] [blame] | 82 | romstage-$(CONFIG_PRIMITIVE_MEMTEST) += primitive_memtest.c |
| 83 | ramstage-$(CONFIG_PRIMITIVE_MEMTEST) += primitive_memtest.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 84 | romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c |
David Hendricks | 6fab365 | 2014-11-06 15:22:10 -0800 | [diff] [blame] | 85 | romstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c |
Vladimir Serbinenko | 45988da | 2013-03-30 02:02:13 +0100 | [diff] [blame] | 86 | |
Kyösti Mälkki | f8bf5a1 | 2013-10-11 22:08:02 +0300 | [diff] [blame] | 87 | ifeq ($(CONFIG_EARLY_CBMEM_INIT),y) |
Aaron Durbin | c15551a | 2013-03-23 00:00:54 -0500 | [diff] [blame] | 88 | romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Kyösti Mälkki | a2f6af3 | 2013-09-10 13:50:32 +0300 | [diff] [blame] | 89 | romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c |
Kyösti Mälkki | a2f6af3 | 2013-09-10 13:50:32 +0300 | [diff] [blame] | 90 | endif |
Denis 'GNUtoo' Carikli | 8a0a848 | 2013-06-20 16:24:14 +0200 | [diff] [blame] | 91 | |
Stefan Reinauer | fb89dd0 | 2012-03-30 16:28:20 -0700 | [diff] [blame] | 92 | romstage-y += compute_ip_checksum.c |
Patrick Georgi | 6d0cba7 | 2014-11-29 11:32:12 +0100 | [diff] [blame] | 93 | ifeq ($(CONFIG_COMPILER_GCC),y) |
Furquan Shaikh | 99ac98f | 2014-04-23 10:18:48 -0700 | [diff] [blame] | 94 | romstage-$(CONFIG_ARCH_ROMSTAGE_X86_32) += gcc.c |
Edward O'Callaghan | 4ba8ba4 | 2014-05-23 01:29:00 +1000 | [diff] [blame] | 95 | ramstage-$(CONFIG_ARCH_RAMSTAGE_X86_32) += gcc.c |
| 96 | endif |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 97 | |
Aaron Durbin | e5e3630 | 2014-09-25 10:05:15 -0500 | [diff] [blame] | 98 | romstage-$(CONFIG_GENERIC_UDELAY) += timer.c |
| 99 | |
Aaron Durbin | ac12c66c | 2015-05-20 12:08:55 -0500 | [diff] [blame] | 100 | ramstage-y += assets.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 101 | ramstage-y += prog_loaders.c |
Aaron Durbin | b3847e6 | 2015-03-20 15:55:08 -0500 | [diff] [blame] | 102 | ramstage-y += prog_ops.c |
Stefan Reinauer | 1e75329 | 2012-11-30 12:23:45 -0800 | [diff] [blame] | 103 | ramstage-y += hardwaremain.c |
| 104 | ramstage-y += selfboot.c |
Stefan Reinauer | 3e4e303 | 2013-03-20 14:08:04 -0700 | [diff] [blame] | 105 | ramstage-y += coreboot_table.c |
Aaron Durbin | 4904802 | 2014-02-18 21:55:02 -0600 | [diff] [blame] | 106 | ramstage-y += bootmem.c |
Aaron Durbin | 0424c95 | 2015-03-28 23:56:22 -0500 | [diff] [blame] | 107 | ramstage-y += fmap.c |
Gabe Black | 1025f3a | 2011-09-16 02:18:56 -0700 | [diff] [blame] | 108 | ramstage-y += memchr.c |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 109 | ramstage-y += memcmp.c |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 110 | ramstage-y += malloc.c |
Duncan Laurie | f5e9ac4 | 2012-06-23 13:33:32 -0700 | [diff] [blame] | 111 | smm-$(CONFIG_SMM_TSEG) += malloc.c |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 112 | ramstage-y += delay.c |
| 113 | ramstage-y += fallback_boot.c |
| 114 | ramstage-y += compute_ip_checksum.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 115 | ramstage-y += cbfs.c |
| 116 | ramstage-y += cbfs_boot_props.c |
Vadim Bendebury | adcb095 | 2014-05-01 12:23:09 -0700 | [diff] [blame] | 117 | ramstage-$(CONFIG_COMMON_CBFS_SPI_WRAPPER) += cbfs_spi.c |
Edward O'Callaghan | cd31afd | 2014-11-11 12:27:06 +1100 | [diff] [blame] | 118 | ramstage-y += lzma.c lzmadecode.c |
Ronald G. Minnich | 9764d4c | 2012-06-12 16:29:32 -0700 | [diff] [blame] | 119 | ramstage-y += stack.c |
Vadim Bendebury | 3e31600 | 2011-09-30 12:02:18 -0700 | [diff] [blame] | 120 | ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 121 | ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 122 | ramstage-$(CONFIG_TRACE) += trace.c |
Vadim Bendebury | 6f72d69 | 2011-09-21 16:12:39 -0700 | [diff] [blame] | 123 | ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Stefan Reinauer | d37ab45 | 2012-12-18 16:23:28 -0800 | [diff] [blame] | 124 | ramstage-$(CONFIG_COVERAGE) += libgcov.c |
Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 125 | ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += edid.c |
Aaron Durbin | a05a852 | 2013-03-22 20:44:46 -0500 | [diff] [blame] | 126 | ramstage-y += memrange.c |
Aaron Durbin | 4409a5e | 2013-05-06 12:20:52 -0500 | [diff] [blame] | 127 | ramstage-$(CONFIG_COOP_MULTITASKING) += thread.c |
Aaron Durbin | 340ca91 | 2013-04-30 09:58:12 -0500 | [diff] [blame] | 128 | ramstage-$(CONFIG_TIMER_QUEUE) += timer_queue.c |
David Hendricks | 3b11de8 | 2014-11-05 14:05:56 -0800 | [diff] [blame] | 129 | ramstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c |
Aaron Durbin | e5e3630 | 2014-09-25 10:05:15 -0500 | [diff] [blame] | 130 | ramstage-$(CONFIG_GENERIC_UDELAY) += timer.c |
Vadim Bendebury | 243c614 | 2015-03-27 16:08:04 -0700 | [diff] [blame] | 131 | ramstage-y += b64_decode.c |
Stefan Reinauer | 16ce01b | 2011-01-28 08:05:54 +0000 | [diff] [blame] | 132 | |
Aaron Durbin | 0dff57d | 2015-03-05 21:18:33 -0600 | [diff] [blame] | 133 | romstage-y += cbmem_common.c |
| 134 | romstage-y += imd_cbmem.c |
| 135 | |
| 136 | ramstage-y += cbmem_common.c |
| 137 | ramstage-y += imd_cbmem.c |
Aaron Durbin | df3a109 | 2013-03-13 12:41:44 -0500 | [diff] [blame] | 138 | |
Aaron Durbin | 20686d8 | 2015-03-05 14:11:27 -0600 | [diff] [blame] | 139 | romstage-y += imd.c |
| 140 | ramstage-y += imd.c |
| 141 | |
Stefan Reinauer | 2f38b07 | 2013-07-18 16:24:08 -0700 | [diff] [blame] | 142 | ramstage-y += hexdump.c |
| 143 | romstage-y += hexdump.c |
| 144 | |
Isaac Christensen | 0b4e8df | 2014-10-01 11:50:20 -0600 | [diff] [blame] | 145 | romstage-$(CONFIG_REG_SCRIPT) += reg_script.c |
Duncan Laurie | 7274800 | 2013-10-31 08:26:23 -0700 | [diff] [blame] | 146 | ramstage-$(CONFIG_REG_SCRIPT) += reg_script.c |
| 147 | |
Aaron Durbin | bd74a4b | 2015-03-06 23:17:33 -0600 | [diff] [blame] | 148 | ifeq ($(CONFIG_CACHE_RELOCATED_RAMSTAGE_OUTSIDE_CBMEM),y) |
| 149 | ramstage-y += ext_stage_cache.c |
| 150 | romstage-y += ext_stage_cache.c |
| 151 | else |
| 152 | ramstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += cbmem_stage_cache.c |
| 153 | romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += cbmem_stage_cache.c |
| 154 | endif |
| 155 | |
Aaron Durbin | 127525c | 2015-03-26 12:29:12 -0500 | [diff] [blame] | 156 | romstage-y += mem_pool.c |
| 157 | ramstage-y += mem_pool.c |
| 158 | |
Aaron Durbin | 5d5f4b3 | 2015-03-26 14:39:07 -0500 | [diff] [blame] | 159 | romstage-y += region.c |
| 160 | ramstage-y += region.c |
Aaron Durbin | c6588c5 | 2015-05-15 13:15:34 -0500 | [diff] [blame] | 161 | romstage-y += boot_device.c |
| 162 | ramstage-y += boot_device.c |
Aaron Durbin | 75e2974 | 2013-10-10 20:37:04 -0500 | [diff] [blame] | 163 | |
Aaron Durbin | c6588c5 | 2015-05-15 13:15:34 -0500 | [diff] [blame] | 164 | smm-y += region.c |
| 165 | smm-y += boot_device.c |
Aaron Durbin | 0424c95 | 2015-03-28 23:56:22 -0500 | [diff] [blame] | 166 | smm-y += fmap.c |
Aaron Durbin | 899d13d | 2015-05-15 23:39:23 -0500 | [diff] [blame] | 167 | smm-y += cbfs.c memcmp.c |
Edward O'Callaghan | 9b22985 | 2014-06-26 18:12:11 +1000 | [diff] [blame] | 168 | smm-$(CONFIG_COMPILER_GCC) += gcc.c |
Stefan Reinauer | e9f3258 | 2010-03-29 13:04:13 +0000 | [diff] [blame] | 169 | |
Kyösti Mälkki | c36af7b | 2014-11-18 12:41:16 +0200 | [diff] [blame] | 170 | bootblock-y += version.c |
| 171 | romstage-y += version.c |
| 172 | ramstage-y += version.c |
| 173 | smm-y += version.c |
Patrick Georgi | 9bb90cd | 2015-05-07 12:30:06 +0200 | [diff] [blame] | 174 | secmon-y += version.c |
Aaron Durbin | fd6fb26 | 2015-05-13 13:37:43 -0500 | [diff] [blame] | 175 | verstage-y += version.c |
Kyösti Mälkki | c36af7b | 2014-11-18 12:41:16 +0200 | [diff] [blame] | 176 | |
| 177 | $(obj)/lib/version.bootblock.o : $(obj)/build.h |
| 178 | $(obj)/lib/version.romstage.o : $(obj)/build.h |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 179 | $(obj)/lib/version.ramstage.o : $(obj)/build.h |
Kyösti Mälkki | c36af7b | 2014-11-18 12:41:16 +0200 | [diff] [blame] | 180 | $(obj)/lib/version.smm.o : $(obj)/build.h |
Aaron Durbin | 2591e93 | 2015-05-13 13:38:59 -0500 | [diff] [blame] | 181 | $(obj)/lib/version.secmon.o : $(obj)/build.h |
Aaron Durbin | fd6fb26 | 2015-05-13 13:37:43 -0500 | [diff] [blame] | 182 | $(obj)/lib/version.verstage.o : $(obj)/build.h |
Stefan Reinauer | ba9dae2 | 2011-07-29 15:34:14 -0700 | [diff] [blame] | 183 | |
Kyösti Mälkki | 5687fc9 | 2013-11-28 18:11:49 +0200 | [diff] [blame] | 184 | romstage-y += bootmode.c |
| 185 | ramstage-y += bootmode.c |
| 186 | |
Patrick Georgi | 1b2f2a0 | 2014-11-28 22:00:22 +0100 | [diff] [blame] | 187 | bootblock-y += halt.c |
| 188 | romstage-y += halt.c |
| 189 | ramstage-y += halt.c |
| 190 | smm-y += halt.c |
Furquan Shaikh | abde3b5 | 2014-08-26 15:39:51 -0700 | [diff] [blame] | 191 | secmon-y += halt.c |
Patrick Georgi | 1b2f2a0 | 2014-11-28 22:00:22 +0100 | [diff] [blame] | 192 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 193 | ifneq ($(CONFIG_ARCH_X86),y) |
| 194 | # X86 bootblock and romstage use custom ldscripts that are all glued together, |
| 195 | # so we need to exclude it here or it would pick these up as well |
| 196 | bootblock-y += bootblock.ld |
| 197 | romstage-y += romstage.ld |
| 198 | endif |
| 199 | ramstage-y += ramstage.ld |
| 200 | |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 201 | ifeq ($(CONFIG_RELOCATABLE_MODULES),y) |
| 202 | ramstage-y += rmodule.c |
Aaron Durbin | 8e4a355 | 2013-02-08 17:28:04 -0600 | [diff] [blame] | 203 | romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += rmodule.c |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 204 | |
Aaron Durbin | 04de971 | 2015-04-07 15:44:52 -0500 | [diff] [blame] | 205 | RMODULE_LDFLAGS := -nostartfiles --gc-sections --emit-relocs -z defs -Bsymbolic |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 206 | |
| 207 | # rmodule_link_rules is a function that should be called with: |
| 208 | # (1) the object name to link |
| 209 | # (2) the dependencies |
| 210 | # (3) heap size of the relocatable module |
Furquan Shaikh | 133096b | 2014-07-31 09:28:55 -0700 | [diff] [blame] | 211 | # (4) arch for which the rmodules are to be linked |
Aaron Durbin | 3eb8eb7 | 2014-03-10 16:13:58 -0500 | [diff] [blame] | 212 | # It will create the necessary Make rules to create a rmodule. The resulting |
| 213 | # rmdoule is named $(1).rmod |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 214 | define rmodule_link |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 215 | $(strip $(1)): $(strip $(2)) $$(COMPILER_RT_rmodules_$(4)) $(obj)/lib/rmodule.rmodules_$(4).ld | $$(RMODTOOL) |
Patrick Georgi | eec8dfb | 2015-05-07 22:24:41 +0200 | [diff] [blame] | 216 | $$(LD_rmodules_$(4)) $(RMODULE_LDFLAGS) -T $(obj)/lib/rmodule.rmodules_$(4).ld --defsym=__heap_size=$(strip $(3)) -o $$@ --whole-archive --start-group $(filter-out %.ld,$(2)) --end-group |
Furquan Shaikh | 133096b | 2014-07-31 09:28:55 -0700 | [diff] [blame] | 217 | $$(NM_rmodules_$(4)) -n $$@ > $$(basename $$@).map |
Aaron Durbin | 3eb8eb7 | 2014-03-10 16:13:58 -0500 | [diff] [blame] | 218 | |
| 219 | $(strip $(1)).rmod: $(strip $(1)) |
| 220 | $$(RMODTOOL) -i $$^ -o $$@ |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 221 | endef |
| 222 | |
| 223 | endif |