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