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 |
Paul Menzel | a46a712 | 2013-02-23 18:37:27 +0100 | [diff] [blame] | 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Stefan Reinauer | 179206a | 2012-11-30 12:19:59 -0800 | [diff] [blame] | 18 | # |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 19 | |
Hung-Te Lin | fe18792 | 2013-02-01 01:09:24 +0800 | [diff] [blame] | 20 | bootblock-y += cbfs.c |
| 21 | ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y) |
| 22 | bootblock-y += memset.c |
| 23 | endif |
| 24 | bootblock-y += memchr.c |
| 25 | ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y) |
| 26 | bootblock-y += memcpy.c |
| 27 | endif |
| 28 | bootblock-y += memcmp.c |
| 29 | |
Stefan Reinauer | 1afe51a | 2011-10-26 22:11:52 +0000 | [diff] [blame] | 30 | ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y) |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 31 | romstage-y += memset.c |
Aaron Durbin | 2b7c88f | 2013-03-01 16:56:34 -0600 | [diff] [blame] | 32 | rmodules-y += memset.c |
Stefan Reinauer | 1afe51a | 2011-10-26 22:11:52 +0000 | [diff] [blame] | 33 | endif |
Gabe Black | 1025f3a | 2011-09-16 02:18:56 -0700 | [diff] [blame] | 34 | romstage-y += memchr.c |
Stefan Reinauer | 0054afa | 2011-10-25 23:43:34 +0000 | [diff] [blame] | 35 | ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y) |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 36 | romstage-y += memcpy.c |
Aaron Durbin | 2b7c88f | 2013-03-01 16:56:34 -0600 | [diff] [blame] | 37 | rmodules-y += memcpy.c |
Stefan Reinauer | 0054afa | 2011-10-25 23:43:34 +0000 | [diff] [blame] | 38 | endif |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 39 | romstage-y += memcmp.c |
Aaron Durbin | 2b7c88f | 2013-03-01 16:56:34 -0600 | [diff] [blame] | 40 | rmodules-y += memcmp.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 41 | romstage-y += cbfs.c |
| 42 | romstage-y += lzma.c |
| 43 | #romstage-y += lzmadecode.c |
| 44 | romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 45 | romstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c |
Stefan Reinauer | 4885daa | 2011-04-26 23:47:04 +0000 | [diff] [blame] | 46 | romstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c |
Vadim Bendebury | 3e31600 | 2011-09-30 12:02:18 -0700 | [diff] [blame] | 47 | romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 48 | romstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 49 | romstage-$(CONFIG_USBDEBUG) += usbdebug.c |
Vladimir Serbinenko | 45988da | 2013-03-30 02:02:13 +0100 | [diff] [blame] | 50 | romstage-$(CONFIG_SPKMODEM) += spkmodem.c |
| 51 | |
Aaron Durbin | c15551a | 2013-03-23 00:00:54 -0500 | [diff] [blame] | 52 | romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
| 53 | romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c |
Stefan Reinauer | fb89dd0 | 2012-03-30 16:28:20 -0700 | [diff] [blame] | 54 | romstage-y += compute_ip_checksum.c |
| 55 | romstage-y += memmove.c |
David Hendricks | ae0e8d3 | 2013-03-06 20:43:55 -0800 | [diff] [blame] | 56 | romstage-$(CONFIG_ARCH_X86) += gcc.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 57 | |
Stefan Reinauer | 1e75329 | 2012-11-30 12:23:45 -0800 | [diff] [blame] | 58 | ramstage-y += hardwaremain.c |
| 59 | ramstage-y += selfboot.c |
Stefan Reinauer | 3e4e303 | 2013-03-20 14:08:04 -0700 | [diff] [blame] | 60 | ramstage-y += coreboot_table.c |
Stefan Reinauer | 1afe51a | 2011-10-26 22:11:52 +0000 | [diff] [blame] | 61 | ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 62 | ramstage-y += memset.c |
Stefan Reinauer | 1afe51a | 2011-10-26 22:11:52 +0000 | [diff] [blame] | 63 | endif |
Gabe Black | 1025f3a | 2011-09-16 02:18:56 -0700 | [diff] [blame] | 64 | ramstage-y += memchr.c |
Stefan Reinauer | 0054afa | 2011-10-25 23:43:34 +0000 | [diff] [blame] | 65 | ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 66 | ramstage-y += memcpy.c |
Stefan Reinauer | 0054afa | 2011-10-25 23:43:34 +0000 | [diff] [blame] | 67 | endif |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 68 | ramstage-y += memcmp.c |
| 69 | ramstage-y += memmove.c |
| 70 | ramstage-y += malloc.c |
Duncan Laurie | f5e9ac4 | 2012-06-23 13:33:32 -0700 | [diff] [blame] | 71 | smm-$(CONFIG_SMM_TSEG) += malloc.c |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 72 | ramstage-y += delay.c |
| 73 | ramstage-y += fallback_boot.c |
| 74 | ramstage-y += compute_ip_checksum.c |
| 75 | ramstage-y += version.c |
| 76 | ramstage-y += cbfs.c |
| 77 | ramstage-y += lzma.c |
| 78 | #ramstage-y += lzmadecode.c |
Ronald G. Minnich | 9764d4c | 2012-06-12 16:29:32 -0700 | [diff] [blame] | 79 | ramstage-y += stack.c |
Stefan Reinauer | 4c4dd93 | 2012-12-07 17:28:02 -0800 | [diff] [blame] | 80 | ramstage-$(CONFIG_ARCH_X86) += gcc.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 81 | ramstage-y += clog2.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 82 | ramstage-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c |
Stefan Reinauer | 4885daa | 2011-04-26 23:47:04 +0000 | [diff] [blame] | 83 | ramstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c |
Vadim Bendebury | 3e31600 | 2011-09-30 12:02:18 -0700 | [diff] [blame] | 84 | ramstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 85 | ramstage-$(CONFIG_USBDEBUG) += usbdebug.c |
Vladimir Serbinenko | 45988da | 2013-03-30 02:02:13 +0100 | [diff] [blame] | 86 | ramstage-$(CONFIG_SPKMODEM) += spkmodem.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 87 | ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 88 | ramstage-$(CONFIG_TRACE) += trace.c |
Vadim Bendebury | 6f72d69 | 2011-09-21 16:12:39 -0700 | [diff] [blame] | 89 | ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c |
Stefan Reinauer | d37ab45 | 2012-12-18 16:23:28 -0800 | [diff] [blame] | 90 | ramstage-$(CONFIG_COVERAGE) += libgcov.c |
Ronald G. Minnich | b3b72f3 | 2013-03-13 14:35:01 -0700 | [diff] [blame] | 91 | ramstage-$(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) += edid.c |
Aaron Durbin | a05a852 | 2013-03-22 20:44:46 -0500 | [diff] [blame] | 92 | ramstage-y += memrange.c |
Aaron Durbin | 340ca91 | 2013-04-30 09:58:12 -0500 | [diff] [blame^] | 93 | ramstage-$(CONFIG_TIMER_QUEUE) += timer_queue.c |
Stefan Reinauer | 16ce01b | 2011-01-28 08:05:54 +0000 | [diff] [blame] | 94 | |
Aaron Durbin | df3a109 | 2013-03-13 12:41:44 -0500 | [diff] [blame] | 95 | # The CBMEM implementations are chosen based on CONFIG_DYNAMIC_CBMEM. |
| 96 | ifeq ($(CONFIG_DYNAMIC_CBMEM),y) |
| 97 | ramstage-y += dynamic_cbmem.c |
| 98 | romstage-y += dynamic_cbmem.c |
| 99 | else |
| 100 | ramstage-y += cbmem.c |
| 101 | romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c |
| 102 | endif # CONFIG_DYNAMIC_CBMEM |
| 103 | ramstage-y += cbmem_info.c |
| 104 | |
Patrick Georgi | 23f38cd | 2012-11-16 14:50:32 +0100 | [diff] [blame] | 105 | ramstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 106 | |
Stefan Reinauer | fb89dd0 | 2012-03-30 16:28:20 -0700 | [diff] [blame] | 107 | ifneq ($(CONFIG_HAVE_ARCH_MEMSET),y) |
| 108 | smm-y += memset.c |
| 109 | endif |
Stefan Reinauer | 0054afa | 2011-10-25 23:43:34 +0000 | [diff] [blame] | 110 | ifneq ($(CONFIG_HAVE_ARCH_MEMCPY),y) |
| 111 | smm-y += memcpy.c |
| 112 | endif |
Stefan Reinauer | fb89dd0 | 2012-03-30 16:28:20 -0700 | [diff] [blame] | 113 | smm-y += cbfs.c memcmp.c |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 114 | smm-$(CONFIG_CONSOLE_SERIAL8250) += uart8250.c |
Stefan Reinauer | 4885daa | 2011-04-26 23:47:04 +0000 | [diff] [blame] | 115 | smm-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c |
Sven Schnelle | 20fc631 | 2011-10-30 09:57:35 +0100 | [diff] [blame] | 116 | smm-$(CONFIG_USBDEBUG) += usbdebug.c |
David Hendricks | ae0e8d3 | 2013-03-06 20:43:55 -0800 | [diff] [blame] | 117 | smm-y += gcc.c |
Stefan Reinauer | e9f3258 | 2010-03-29 13:04:13 +0000 | [diff] [blame] | 118 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 119 | $(obj)/lib/version.ramstage.o : $(obj)/build.h |
Stefan Reinauer | ba9dae2 | 2011-07-29 15:34:14 -0700 | [diff] [blame] | 120 | |
| 121 | OPTION_TABLE_H:= |
| 122 | ifeq ($(CONFIG_HAVE_OPTION_TABLE),y) |
| 123 | OPTION_TABLE_H:=$(obj)/option_table.h |
| 124 | endif |
| 125 | |
| 126 | $(obj)/lib/uart8250mem.smm.o : $(OPTION_TABLE_H) |
Stefan Reinauer | 5260871 | 2011-08-11 14:51:31 -0700 | [diff] [blame] | 127 | $(obj)/lib/uart8250.smm.o : $(OPTION_TABLE_H) |
Stefan Reinauer | ba9dae2 | 2011-07-29 15:34:14 -0700 | [diff] [blame] | 128 | |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 129 | ifeq ($(CONFIG_RELOCATABLE_MODULES),y) |
| 130 | ramstage-y += rmodule.c |
Aaron Durbin | 8e4a355 | 2013-02-08 17:28:04 -0600 | [diff] [blame] | 131 | romstage-$(CONFIG_RELOCATABLE_RAMSTAGE) += rmodule.c |
Aaron Durbin | ad93552 | 2012-12-24 14:28:37 -0600 | [diff] [blame] | 132 | |
| 133 | RMODULE_LDSCRIPT := $(src)/lib/rmodule.ld |
| 134 | RMODULE_LDFLAGS := -nostartfiles -shared -z defs -nostdlib -Bsymbolic -T $(RMODULE_LDSCRIPT) |
| 135 | |
| 136 | # rmodule_link_rules is a function that should be called with: |
| 137 | # (1) the object name to link |
| 138 | # (2) the dependencies |
| 139 | # (3) heap size of the relocatable module |
| 140 | # It will create the necessary Make rules. |
| 141 | define rmodule_link |
| 142 | $(strip $(1)): $(strip $(2)) $$(RMODULE_LDSCRIPT) $$(obj)/ldoptions |
| 143 | $$(LD) $$(RMODULE_LDFLAGS) --defsym=__heap_size=$(strip $(3)) -o $$@ $(strip $(2)) |
| 144 | $$(NM) -n $$@ > $$(basename $$@).map |
| 145 | endef |
| 146 | |
| 147 | endif |
Aaron Durbin | 2b7c88f | 2013-03-01 16:56:34 -0600 | [diff] [blame] | 148 | |