Stefan Reinauer | 3058491 | 2010-08-14 20:38:17 +0000 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the coreboot project. |
| 3 | ## |
| 4 | ## Copyright (C) 2009-2010 coresystems GmbH |
| 5 | ## Copyright (C) 2009 Ronald G. Minnich |
| 6 | ## |
| 7 | ## This program is free software; you can redistribute it and/or modify |
| 8 | ## it under the terms of the GNU General Public License as published by |
| 9 | ## the Free Software Foundation; version 2 of the License. |
| 10 | ## |
| 11 | ## This program is distributed in the hope that it will be useful, |
| 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ## GNU General Public License for more details. |
| 15 | ## |
| 16 | ## You should have received a copy of the GNU General Public License |
| 17 | ## along with this program; if not, write to the Free Software |
| 18 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | ## |
| 20 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 21 | ####################################################################### |
| 22 | # Take care of subdirectories |
| 23 | subdirs-y += boot |
Stefan Reinauer | e377857 | 2010-01-30 09:47:18 +0000 | [diff] [blame] | 24 | # subdirs-y += init |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 25 | subdirs-y += lib |
| 26 | subdirs-y += smp |
| 27 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 28 | OPTION_TABLE_H:= |
| 29 | ifeq ($(CONFIG_HAVE_OPTION_TABLE),y) |
Patrick Georgi | 5c0bca2 | 2011-01-30 16:31:15 +0000 | [diff] [blame] | 30 | cbfs-files-y += cmos_layout.bin |
| 31 | cmos_layout.bin-file = $(obj)/cmos_layout.bin |
| 32 | cmos_layout.bin-type = 0x01aa |
Patrick Georgi | 2447937 | 2011-01-18 13:56:36 +0000 | [diff] [blame] | 33 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 34 | OPTION_TABLE_H:=$(obj)/option_table.h |
| 35 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 36 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 37 | ####################################################################### |
| 38 | # Build the final rom image |
Patrick Georgi | 182b09e | 2010-03-16 16:59:03 +0000 | [diff] [blame] | 39 | COREBOOT_ROM_DEPENDENCIES:= |
Stefan Reinauer | f1939bb | 2010-12-30 17:39:50 +0000 | [diff] [blame] | 40 | ifeq ($(CONFIG_PAYLOAD_ELF),y) |
Stefan Reinauer | bccbbe6 | 2010-12-19 21:20:14 +0000 | [diff] [blame] | 41 | COREBOOT_ROM_DEPENDENCIES+=$(CONFIG_PAYLOAD_FILE) |
Peter Stuge | 87f9514 | 2009-10-23 12:14:15 +0000 | [diff] [blame] | 42 | endif |
Stefan Reinauer | f1939bb | 2010-12-30 17:39:50 +0000 | [diff] [blame] | 43 | ifeq ($(CONFIG_PAYLOAD_SEABIOS),y) |
| 44 | COREBOOT_ROM_DEPENDENCIES+=seabios |
| 45 | endif |
Stefan Reinauer | e50952f | 2011-04-15 03:34:05 +0000 | [diff] [blame] | 46 | ifeq ($(CONFIG_PAYLOAD_FILO),y) |
| 47 | COREBOOT_ROM_DEPENDENCIES+=filo |
| 48 | endif |
Stefan Reinauer | cca6268 | 2010-03-30 21:52:05 +0000 | [diff] [blame] | 49 | ifeq ($(CONFIG_AP_CODE_IN_CAR),y) |
| 50 | COREBOOT_ROM_DEPENDENCIES+=$(obj)/coreboot_ap |
| 51 | endif |
Stefan Reinauer | f94a97b | 2010-04-21 20:55:38 +0000 | [diff] [blame] | 52 | ifeq ($(CONFIG_GEODE_VSA_FILE),y) |
| 53 | COREBOOT_ROM_DEPENDENCIES+=$(CONFIG_VSA_FILENAME) |
Stefan Reinauer | bda2931 | 2010-04-20 18:35:33 +0000 | [diff] [blame] | 54 | endif |
Stefan Reinauer | cca6268 | 2010-03-30 21:52:05 +0000 | [diff] [blame] | 55 | |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 56 | extract_nth=$(word $(1), $(subst |, ,$(2))) |
| 57 | |
| 58 | ifneq ($(CONFIG_UPDATE_IMAGE),y) |
| 59 | prebuild-files = \ |
| 60 | $(foreach file,$(cbfs-files), \ |
Vadim Bendebury | 10fea92 | 2011-11-05 02:07:01 +0000 | [diff] [blame] | 61 | $(CBFSTOOL) $@.tmp add $(call extract_nth,1,$(file)) \ |
| 62 | $(call extract_nth,2,$(file)) $(call extract_nth,3,$(file)) \ |
| 63 | $(call extract_nth,4,$(file)) &&) |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 64 | prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file))) |
| 65 | |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 66 | $(obj)/coreboot.pre1: $(objcbfs)/bootblock.bin $$(prebuilt-files) $(CBFSTOOL) |
| 67 | $(CBFSTOOL) $@.tmp create $(CONFIG_COREBOOT_ROMSIZE_KB)K $(objcbfs)/bootblock.bin |
Vadim Bendebury | 10fea92 | 2011-11-05 02:07:01 +0000 | [diff] [blame] | 68 | $(prebuild-files) true |
| 69 | mv $@.tmp $@ |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 70 | else |
Patrick Georgi | 3954b0a | 2011-10-28 22:52:11 +0200 | [diff] [blame] | 71 | .PHONY: $(obj)/coreboot.pre1 |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 72 | $(obj)/coreboot.pre1: $(CBFSTOOL) |
| 73 | mv $(obj)/coreboot.rom $@ |
| 74 | endif |
| 75 | |
Patrick Georgi | a84e98b | 2010-03-16 19:01:32 +0000 | [diff] [blame] | 76 | $(obj)/coreboot.rom: $(obj)/coreboot.pre $(obj)/coreboot_ram $(CBFSTOOL) $(call strip_quotes,$(COREBOOT_ROM_DEPENDENCIES)) |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 77 | @printf " CBFS $(subst $(obj)/,,$(@))\n" |
Patrick Georgi | 182b09e | 2010-03-16 16:59:03 +0000 | [diff] [blame] | 78 | cp $(obj)/coreboot.pre $@.tmp |
Stefan Reinauer | cca6268 | 2010-03-30 21:52:05 +0000 | [diff] [blame] | 79 | if [ -f $(obj)/coreboot_ap ]; \ |
Patrick Georgi | 182b09e | 2010-03-16 16:59:03 +0000 | [diff] [blame] | 80 | then \ |
Stefan Reinauer | cca6268 | 2010-03-30 21:52:05 +0000 | [diff] [blame] | 81 | $(CBFSTOOL) $@.tmp add-stage $(obj)/coreboot_ap $(CONFIG_CBFS_PREFIX)/coreboot_ap $(CBFS_COMPRESS_FLAG); \ |
Patrick Georgi | 182b09e | 2010-03-16 16:59:03 +0000 | [diff] [blame] | 82 | fi |
| 83 | $(CBFSTOOL) $@.tmp add-stage $(obj)/coreboot_ram $(CONFIG_CBFS_PREFIX)/coreboot_ram $(CBFS_COMPRESS_FLAG) |
| 84 | ifeq ($(CONFIG_PAYLOAD_NONE),y) |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 85 | @printf " PAYLOAD \e[1;31mnone (as specified by user)\e[0m\n" |
Stefan Reinauer | f1939bb | 2010-12-30 17:39:50 +0000 | [diff] [blame] | 86 | endif |
| 87 | ifeq ($(CONFIG_PAYLOAD_ELF),y) |
Stefan Reinauer | bccbbe6 | 2010-12-19 21:20:14 +0000 | [diff] [blame] | 88 | @printf " PAYLOAD $(CONFIG_PAYLOAD_FILE) (compression: $(CBFS_PAYLOAD_COMPRESS_NAME))\n" |
| 89 | $(CBFSTOOL) $@.tmp add-payload $(CONFIG_PAYLOAD_FILE) $(CONFIG_CBFS_PREFIX)/payload $(CBFS_PAYLOAD_COMPRESS_FLAG) |
Patrick Georgi | 182b09e | 2010-03-16 16:59:03 +0000 | [diff] [blame] | 90 | endif |
Stefan Reinauer | f1939bb | 2010-12-30 17:39:50 +0000 | [diff] [blame] | 91 | ifeq ($(CONFIG_PAYLOAD_SEABIOS),y) |
| 92 | @printf " PAYLOAD SeaBIOS (internal, compression: $(CBFS_PAYLOAD_COMPRESS_NAME))\n" |
| 93 | $(CBFSTOOL) $@.tmp add-payload $(CONFIG_PAYLOAD_FILE) $(CONFIG_CBFS_PREFIX)/payload $(CBFS_PAYLOAD_COMPRESS_FLAG) |
| 94 | endif |
Stefan Reinauer | e50952f | 2011-04-15 03:34:05 +0000 | [diff] [blame] | 95 | ifeq ($(CONFIG_PAYLOAD_FILO),y) |
| 96 | @printf " PAYLOAD FILO (internal, compression: $(CBFS_PAYLOAD_COMPRESS_NAME))\n" |
| 97 | $(CBFSTOOL) $@.tmp add-payload $(CONFIG_PAYLOAD_FILE) $(CONFIG_CBFS_PREFIX)/payload $(CBFS_PAYLOAD_COMPRESS_FLAG) |
| 98 | endif |
Stefan Reinauer | f94a97b | 2010-04-21 20:55:38 +0000 | [diff] [blame] | 99 | ifeq ($(CONFIG_GEODE_VSA_FILE),y) |
| 100 | @printf " VSA $(CONFIG_VSA_FILENAME)\n" |
| 101 | $(OBJCOPY) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(CONFIG_VSA_FILENAME) $(obj)/vsa.o |
Patrick Georgi | 7923c49 | 2010-06-07 14:09:41 +0000 | [diff] [blame] | 102 | $(LD) -m elf_i386 -e 0x60020 --section-start .data=0x60000 $(obj)/vsa.o -o $(obj)/vsa.elf |
Stefan Reinauer | bda2931 | 2010-04-20 18:35:33 +0000 | [diff] [blame] | 103 | $(CBFSTOOL) $@.tmp add-stage $(obj)/vsa.elf vsa |
| 104 | endif |
Cristian Măgherușan-Stanciu | d367b00 | 2011-06-19 03:03:28 +0200 | [diff] [blame] | 105 | ifeq ($(CONFIG_INCLUDE_CONFIG_FILE),y) |
| 106 | @printf " CONFIG $(DOTCONFIG)\n" |
| 107 | if [ -f $(DOTCONFIG) ]; then \ |
| 108 | echo "# This image was built using git revision" `git rev-parse HEAD` > $(obj)/config.tmp ; \ |
| 109 | sed -e '/^#/d' -e '/^ *$$/d' $(DOTCONFIG) >> $(obj)/config.tmp ; \ |
| 110 | $(CBFSTOOL) $@.tmp add $(obj)/config.tmp config raw; rm -f $(obj)/config.tmp ; fi |
| 111 | endif |
Patrick Georgi | 182b09e | 2010-03-16 16:59:03 +0000 | [diff] [blame] | 112 | mv $@.tmp $@ |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 113 | @printf " CBFSPRINT $(subst $(obj)/,,$(@))\n\n" |
Patrick Georgi | 182b09e | 2010-03-16 16:59:03 +0000 | [diff] [blame] | 114 | $(CBFSTOOL) $@ print |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 115 | |
Patrick Georgi | ff9d78c | 2011-01-30 16:37:39 +0000 | [diff] [blame] | 116 | stripped_vgabios_id = $(call strip_quotes,$(CONFIG_VGA_BIOS_ID)) |
| 117 | cbfs-files-$(CONFIG_VGA_BIOS) += pci$(stripped_vgabios_id).rom |
| 118 | pci$(stripped_vgabios_id).rom-file := $(call strip_quotes,$(CONFIG_VGA_BIOS_FILE)) |
| 119 | pci$(stripped_vgabios_id).rom-type := optionrom |
| 120 | |
| 121 | cbfs-files-$(CONFIG_INTEL_MBI) += mbi.bin |
| 122 | mbi.bin-file := $(call strip_quotes,$(CONFIG_MBI_FILE)) |
| 123 | mbi.bin-type := mbi |
| 124 | |
| 125 | cbfs-files-$(CONFIG_BOOTSPLASH) += bootsplash.jpg |
| 126 | bootsplash.jpg-file := $(call strip_quotes,$(CONFIG_BOOTSPLASH_FILE)) |
| 127 | bootsplash.jpg-type := bootsplash |
| 128 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 129 | ####################################################################### |
| 130 | # i386 specific tools |
Vikram Narayanan | a8111cf | 2012-04-14 15:25:13 +0530 | [diff] [blame] | 131 | NVRAMTOOL:=$(objutil)/nvramtool/nvramtool |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 132 | |
Vikram Narayanan | a8111cf | 2012-04-14 15:25:13 +0530 | [diff] [blame] | 133 | $(OPTION_TABLE_H): $(NVRAMTOOL) $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout |
Uwe Hermann | 6c73b441 | 2009-10-28 17:10:51 +0000 | [diff] [blame] | 134 | @printf " OPTION $(subst $(obj)/,,$(@))\n" |
Vikram Narayanan | a8111cf | 2012-04-14 15:25:13 +0530 | [diff] [blame] | 135 | $(NVRAMTOOL) -y $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout -H $@ |
Patrick Georgi | 1c797a1 | 2010-04-15 14:32:17 +0000 | [diff] [blame] | 136 | |
Vikram Narayanan | a8111cf | 2012-04-14 15:25:13 +0530 | [diff] [blame] | 137 | $(obj)/cmos_layout.bin: $(NVRAMTOOL) $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout |
Patrick Georgi | 1c797a1 | 2010-04-15 14:32:17 +0000 | [diff] [blame] | 138 | @printf " OPTION $(subst $(obj)/,,$(@))\n" |
Vikram Narayanan | a8111cf | 2012-04-14 15:25:13 +0530 | [diff] [blame] | 139 | $(NVRAMTOOL) -y $(top)/src/mainboard/$(MAINBOARDDIR)/cmos.layout -L $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 140 | |
| 141 | ####################################################################### |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 142 | # Common recipes for all stages |
| 143 | |
| 144 | $(objcbfs)/%.bin: $(objcbfs)/%.elf |
| 145 | @printf " OBJCOPY $(subst $(obj)/,,$(@))\n" |
| 146 | $(OBJCOPY) -O binary $< $@ |
| 147 | |
| 148 | $(objcbfs)/%.elf: $(objcbfs)/%.debug |
| 149 | @printf " OBJCOPY $(subst $(obj)/,,$(@))\n" |
| 150 | cp $< $@.tmp |
| 151 | $(NM) -n $@.tmp | sort > $(basename $@).map |
| 152 | $(OBJCOPY) --strip-debug $@.tmp |
| 153 | $(OBJCOPY) --add-gnu-debuglink=$< $@.tmp |
| 154 | mv $@.tmp $@ |
| 155 | |
| 156 | ####################################################################### |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 157 | # Build the coreboot_ram (stage 2) |
| 158 | |
Stefan Reinauer | 8677a23 | 2010-12-11 20:33:41 +0000 | [diff] [blame] | 159 | $(obj)/coreboot_ram: $(obj)/coreboot_ram.o $(src)/arch/x86/coreboot_ram.ld #ldoptions |
Uwe Hermann | 6c73b441 | 2009-10-28 17:10:51 +0000 | [diff] [blame] | 160 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | 608d15b | 2012-03-31 09:48:11 +0300 | [diff] [blame] | 161 | $(CC) -nostdlib -nostartfiles -static -o $@.tmp -L$(obj) -T $(src)/arch/x86/coreboot_ram.ld $(obj)/coreboot_ram.o |
| 162 | $(NM) -n $@.tmp | sort > $@.map |
| 163 | $(OBJCOPY) --only-keep-debug $@.tmp $@.debug |
| 164 | $(OBJCOPY) --strip-debug $@.tmp |
| 165 | $(OBJCOPY) --add-gnu-debuglink=$@.debug $@.tmp |
| 166 | mv $@.tmp $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 167 | |
Stefan Reinauer | 8677a23 | 2010-12-11 20:33:41 +0000 | [diff] [blame] | 168 | $(obj)/coreboot_ram.o: $(obj)/arch/x86/lib/c_start.ramstage.o $$(driver-objs) $(obj)/coreboot.a $(LIBGCC_FILE_NAME) |
Uwe Hermann | 6c73b441 | 2009-10-28 17:10:51 +0000 | [diff] [blame] | 169 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Stefan Reinauer | 8677a23 | 2010-12-11 20:33:41 +0000 | [diff] [blame] | 170 | $(CC) -nostdlib -r -o $@ $(obj)/arch/x86/lib/c_start.ramstage.o $(driver-objs) -Wl,--wrap,__divdi3 -Wl,--wrap,__udivdi3 -Wl,--wrap,__moddi3 -Wl,--wrap,__umoddi3 -Wl,--start-group $(obj)/coreboot.a $(LIBGCC_FILE_NAME) -Wl,--end-group |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 171 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 172 | $(obj)/coreboot.a: $$(ramstage-objs) |
Uwe Hermann | 6c73b441 | 2009-10-28 17:10:51 +0000 | [diff] [blame] | 173 | @printf " AR $(subst $(obj)/,,$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 174 | rm -f $(obj)/coreboot.a |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 175 | $(AR) cr $(obj)/coreboot.a $^ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 176 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 177 | ####################################################################### |
Stefan Reinauer | cca6268 | 2010-03-30 21:52:05 +0000 | [diff] [blame] | 178 | # coreboot_ap.rom |
| 179 | |
| 180 | ifeq ($(CONFIG_AP_CODE_IN_CAR),y) |
| 181 | |
| 182 | $(obj)/coreboot_ap: $(obj)/mainboard/$(MAINBOARDDIR)/ap_romstage.o |
| 183 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | 608d15b | 2012-03-31 09:48:11 +0300 | [diff] [blame] | 184 | $(CC) -nostdlib -nostartfiles -static -o $@.tmp -L$(obj) -T $(src)/arch/x86/init/ldscript_apc.lb $^ |
| 185 | $(OBJCOPY) --only-keep-debug $@.tmp $@.debug |
| 186 | $(OBJCOPY) --strip-debug $@.tmp |
| 187 | $(OBJCOPY) --add-gnu-debuglink=$@.debug $@.tmp |
| 188 | $(NM) -n $@.tmp | sort > $@.map |
| 189 | mv $@.tmp $@ |
Stefan Reinauer | cca6268 | 2010-03-30 21:52:05 +0000 | [diff] [blame] | 190 | |
| 191 | endif |
| 192 | |
| 193 | ####################################################################### |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 194 | # done |
| 195 | |
Stefan Reinauer | 8677a23 | 2010-12-11 20:33:41 +0000 | [diff] [blame] | 196 | crt0s = $(src)/arch/x86/init/prologue.inc |
Stefan Reinauer | acdd52f | 2010-03-30 20:32:01 +0000 | [diff] [blame] | 197 | ldscripts = |
Stefan Reinauer | 31853d8 | 2011-04-14 20:30:21 +0000 | [diff] [blame] | 198 | ldscripts += $(src)/arch/x86/init/bootblock.ld |
Patrick Georgi | eb49f9d | 2010-02-25 17:03:17 +0000 | [diff] [blame] | 199 | crt0s += $(src)/cpu/x86/32bit/entry32.inc |
Patrick Georgi | 31b0bea | 2010-02-25 21:50:26 +0000 | [diff] [blame] | 200 | ldscripts += $(src)/cpu/x86/32bit/entry32.lds |
Patrick Georgi | eb49f9d | 2010-02-25 17:03:17 +0000 | [diff] [blame] | 201 | |
| 202 | crt0s += $(src)/cpu/x86/fpu_enable.inc |
Patrick Georgi | eb49f9d | 2010-02-25 17:03:17 +0000 | [diff] [blame] | 203 | ifeq ($(CONFIG_SSE),y) |
| 204 | crt0s += $(src)/cpu/x86/sse_enable.inc |
| 205 | endif |
| 206 | |
Patrick Georgi | 5934b50 | 2010-04-12 15:28:34 +0000 | [diff] [blame] | 207 | crt0s += $(cpu_incs) |
Kyösti Mälkki | abdf15f | 2012-02-28 14:01:34 +0200 | [diff] [blame] | 208 | crt0s += $(cpu_incs-y) |
Patrick Georgi | eb49f9d | 2010-02-25 17:03:17 +0000 | [diff] [blame] | 209 | |
Stefan Reinauer | 5c50392 | 2010-03-13 22:07:15 +0000 | [diff] [blame] | 210 | ifeq ($(CONFIG_LLSHELL),y) |
Stefan Reinauer | 8677a23 | 2010-12-11 20:33:41 +0000 | [diff] [blame] | 211 | crt0s += $(src)/arch/x86/llshell/llshell.inc |
Stefan Reinauer | 5c50392 | 2010-03-13 22:07:15 +0000 | [diff] [blame] | 212 | endif |
| 213 | |
Patrick Georgi | eb49f9d | 2010-02-25 17:03:17 +0000 | [diff] [blame] | 214 | crt0s += $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc |
| 215 | |
Patrick Georgi | e64b637 | 2010-04-08 21:04:45 +0000 | [diff] [blame] | 216 | ifeq ($(CONFIG_ROMCC),y) |
Stefan Reinauer | 8677a23 | 2010-12-11 20:33:41 +0000 | [diff] [blame] | 217 | crt0s += $(src)/arch/x86/init/crt0_romcc_epilogue.inc |
Patrick Georgi | e64b637 | 2010-04-08 21:04:45 +0000 | [diff] [blame] | 218 | endif |
| 219 | |
Patrick Georgi | 2063197a | 2010-02-09 12:21:10 +0000 | [diff] [blame] | 220 | ifeq ($(CONFIG_ROMCC),y) |
| 221 | ROMCCFLAGS ?= -mcpu=p2 -O2 |
| 222 | |
Patrick Georgi | b111ba4 | 2010-04-16 23:01:34 +0000 | [diff] [blame] | 223 | $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(objutil)/romcc/romcc $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h |
Patrick Georgi patrick.georgi | c5f773d | 2010-03-16 12:01:13 +0000 | [diff] [blame] | 224 | printf " ROMCC romstage.inc\n" |
Stefan Reinauer | e9f3258 | 2010-03-29 13:04:13 +0000 | [diff] [blame] | 225 | $(ROMCC) -c -S $(ROMCCFLAGS) -D__PRE_RAM__ -I. $(INCLUDES) $< -o $@ |
Patrick Georgi | 2063197a | 2010-02-09 12:21:10 +0000 | [diff] [blame] | 226 | else |
Stefan Reinauer | 1847618 | 2010-02-11 08:44:20 +0000 | [diff] [blame] | 227 | |
Stefan Reinauer | 8655412 | 2010-03-29 21:50:53 +0000 | [diff] [blame] | 228 | $(obj)/mainboard/$(MAINBOARDDIR)/ap_romstage.o: $(src)/mainboard/$(MAINBOARDDIR)/ap_romstage.c $(OPTION_TABLE_H) |
Stefan Reinauer | 6bee951 | 2010-03-24 15:51:48 +0000 | [diff] [blame] | 229 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Stefan Reinauer | 61aee5f | 2011-04-10 04:15:23 +0000 | [diff] [blame] | 230 | $(CC) -MMD $(CFLAGS) -I$(src) -D__PRE_RAM__ -I. -I$(obj) -c $< -o $@ |
Stefan Reinauer | 1847618 | 2010-02-11 08:44:20 +0000 | [diff] [blame] | 231 | |
Sven Schnelle | d69438e | 2011-03-29 09:01:10 +0000 | [diff] [blame] | 232 | $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 233 | @printf " CC romstage.inc\n" |
Stefan Reinauer | 10ec0fe | 2010-09-25 10:40:47 +0000 | [diff] [blame] | 234 | $(CC) -MMD $(CFLAGS) -D__PRE_RAM__ -I$(src) -I. -I$(obj) -c -S $< -o $@ |
Stefan Reinauer | 6bee951 | 2010-03-24 15:51:48 +0000 | [diff] [blame] | 235 | |
| 236 | $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 237 | @printf " POST romstage.inc\n" |
Stefan Reinauer | 8d427ec | 2011-10-12 12:54:08 -0700 | [diff] [blame] | 238 | sed -e 's/\.rodata/.rom.data/g' -e 's/\^\.text/.section .rom.text/g' \ |
| 239 | -e 's/\^\.section \.text/.section .rom.text/g' $^ > $@.tmp |
Patrick Georgi | 68882a3 | 2010-02-10 18:08:22 +0000 | [diff] [blame] | 240 | mv $@.tmp $@ |
Patrick Georgi | 2063197a | 2010-02-09 12:21:10 +0000 | [diff] [blame] | 241 | endif |
Patrick Georgi | 37bdb87 | 2010-02-27 08:39:04 +0000 | [diff] [blame] | 242 | |
Patrick Georgi | 37bdb87 | 2010-02-27 08:39:04 +0000 | [diff] [blame] | 243 | # Things that appear in every board |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 244 | romstage-srcs += $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s |
| 245 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mainboard.c |
Patrick Georgi | 37bdb87 | 2010-02-27 08:39:04 +0000 | [diff] [blame] | 246 | ifeq ($(CONFIG_GENERATE_MP_TABLE),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 247 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/mptable.c |
Patrick Georgi | 37bdb87 | 2010-02-27 08:39:04 +0000 | [diff] [blame] | 248 | endif |
| 249 | ifeq ($(CONFIG_GENERATE_PIRQ_TABLE),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 250 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/irq_tables.c |
Patrick Georgi | 37bdb87 | 2010-02-27 08:39:04 +0000 | [diff] [blame] | 251 | endif |
| 252 | ifeq ($(CONFIG_BOARD_HAS_HARD_RESET),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 253 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/reset.c |
Patrick Georgi | 37bdb87 | 2010-02-27 08:39:04 +0000 | [diff] [blame] | 254 | endif |
Patrick Georgi | 9ea7bff | 2010-02-28 18:23:00 +0000 | [diff] [blame] | 255 | ifeq ($(CONFIG_GENERATE_ACPI_TABLES),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 256 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/acpi_tables.c |
| 257 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/dsdt.asl |
Patrick Georgi | 75bf053 | 2010-03-01 07:42:02 +0000 | [diff] [blame] | 258 | # make doesn't have arithmetic operators or greater-than comparisons |
| 259 | ifeq ($(subst 5,4,$(CONFIG_ACPI_SSDTX_NUM)),4) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 260 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/ssdt2.asl |
| 261 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/ssdt3.asl |
| 262 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/ssdt4.asl |
Patrick Georgi | 75bf053 | 2010-03-01 07:42:02 +0000 | [diff] [blame] | 263 | endif |
| 264 | ifeq ($(CONFIG_ACPI_SSDTX_NUM),5) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 265 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/ssdt5.asl |
Patrick Georgi | 75bf053 | 2010-03-01 07:42:02 +0000 | [diff] [blame] | 266 | endif |
Patrick Georgi | 9ea7bff | 2010-02-28 18:23:00 +0000 | [diff] [blame] | 267 | ifeq ($(CONFIG_BOARD_HAS_FADT),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 268 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/fadt.c |
Patrick Georgi | 9ea7bff | 2010-02-28 18:23:00 +0000 | [diff] [blame] | 269 | endif |
| 270 | endif |
| 271 | |
| 272 | ifeq ($(CONFIG_HAVE_BUS_CONFIG),y) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 273 | ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/get_bus_conf.c |
Patrick Georgi | 9ea7bff | 2010-02-28 18:23:00 +0000 | [diff] [blame] | 274 | endif |
Patrick Georgi | 37bdb87 | 2010-02-27 08:39:04 +0000 | [diff] [blame] | 275 | |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 276 | ####################################################################### |
| 277 | # Build the final rom image |
| 278 | |
| 279 | $(obj)/coreboot.pre: $(obj)/coreboot.romstage $(obj)/coreboot.pre1 $(CBFSTOOL) |
| 280 | @printf " CBFS $(subst $(obj)/,,$(@))\n" |
Vadim Bendebury | 10fea92 | 2011-11-05 02:07:01 +0000 | [diff] [blame] | 281 | cp $(obj)/coreboot.pre1 $@.tmp |
| 282 | $(CBFSTOOL) $@.tmp add-stage $(obj)/romstage.elf \ |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 283 | $(CONFIG_CBFS_PREFIX)/romstage x $(shell cat $(obj)/romstage/base_xip.txt) |
Vadim Bendebury | 10fea92 | 2011-11-05 02:07:01 +0000 | [diff] [blame] | 284 | mv $@.tmp $@ |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 285 | |
| 286 | ####################################################################### |
| 287 | # Build the bootblock |
| 288 | |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 289 | bootblock_lds = $(src)/arch/x86/init/ldscript_failover.lb |
| 290 | bootblock_lds += $(src)/cpu/x86/16bit/entry16.lds |
| 291 | bootblock_lds += $(src)/cpu/x86/16bit/reset16.lds |
| 292 | bootblock_lds += $(src)/arch/x86/lib/id.lds |
| 293 | bootblock_lds += $(chipset_bootblock_lds) |
| 294 | |
| 295 | bootblock_inc = $(src)/arch/x86/init/prologue.inc |
| 296 | bootblock_inc += $(src)/cpu/x86/16bit/entry16.inc |
| 297 | bootblock_inc += $(src)/cpu/x86/16bit/reset16.inc |
| 298 | bootblock_inc += $(src)/cpu/x86/32bit/entry32.inc |
| 299 | bootblock_inc += $(src)/arch/x86/lib/id.inc |
| 300 | bootblock_inc += $(chipset_bootblock_inc) |
| 301 | |
| 302 | ifeq ($(CONFIG_SSE),y) |
| 303 | bootblock_inc += $(src)/cpu/x86/sse_enable.inc |
| 304 | endif |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 305 | bootblock_inc += $(objgenerated)/bootblock.inc |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 306 | bootblock_inc += $(src)/arch/x86/lib/walkcbfs.S |
| 307 | |
| 308 | bootblock_romccflags := -mcpu=i386 -O2 -D__PRE_RAM__ |
| 309 | ifeq ($(CONFIG_SSE),y) |
| 310 | bootblock_romccflags := -mcpu=k7 -msse -O2 -D__PRE_RAM__ |
| 311 | endif |
| 312 | |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 313 | $(objgenerated)/bootblock.ld: $$(bootblock_lds) $(obj)/ldoptions |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 314 | @printf " GEN $(subst $(obj)/,,$(@))\n" |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 315 | printf '$(foreach ldscript,ldoptions $(bootblock_lds),INCLUDE "$(ldscript)"\n)' > $@ |
| 316 | |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 317 | $(objgenerated)/bootblock.S: $$(bootblock_inc) |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 318 | @printf " GEN $(subst $(obj)/,,$(@))\n" |
Patrick Georgi | 950f20a | 2012-01-17 13:13:59 +0100 | [diff] [blame] | 319 | printf '$(foreach crt0,$(bootblock_inc),#include "$(crt0)"\n)' > $@ |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 320 | |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 321 | $(objgenerated)/bootblock.o: $(objgenerated)/bootblock.s |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 322 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 323 | $(CC) -Wa,-acdlns -c -o $@ $< > $(basename $@).disasm |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 324 | |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 325 | $(objgenerated)/bootblock.s: $(objgenerated)/bootblock.S $(obj)/config.h $(obj)/build.h |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 326 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 327 | $(CC) -MMD -x assembler-with-cpp -E -I$(src)/include -I$(src)/arch/x86/include -I$(obj) -include $(obj)/build.h -include $(obj)/config.h -I. -I$(src) $< -o $@ |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 328 | |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 329 | $(objgenerated)/bootblock.inc: $(src)/arch/x86/init/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(objutil)/romcc/romcc $(OPTION_TABLE_H) |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 330 | @printf " ROMCC $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 331 | $(CC) $(INCLUDES) -MM -MT$(objgenerated)/bootblock.inc \ |
| 332 | $< > $(objgenerated)/bootblock.inc.d |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 333 | $(ROMCC) -c -S $(bootblock_romccflags) $(ROMCCFLAGS) -I. $(INCLUDES) $< -o $@ |
| 334 | |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 335 | $(objcbfs)/bootblock.debug: $(objgenerated)/bootblock.o $(objgenerated)/bootblock.ld |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 336 | @printf " LINK $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | f775b8c | 2012-04-19 12:14:53 +0300 | [diff] [blame^] | 337 | $(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(objgenerated)/bootblock.ld $< |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 338 | |
| 339 | ####################################################################### |
| 340 | # Build the romstage |
Kyösti Mälkki | a01ec14 | 2012-03-31 10:21:29 +0300 | [diff] [blame] | 341 | |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 342 | $(obj)/romstage.bin: $$(romstage-objs) $(obj)/romstage/link_null.ld |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 343 | @printf " LINK $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 344 | $(CC) -nostdlib -nostartfiles -static -o $(obj)/romstage.elf -L$(obj) -T $(obj)/romstage/link_null.ld $(romstage-objs) |
Kyösti Mälkki | a01ec14 | 2012-03-31 10:21:29 +0300 | [diff] [blame] | 345 | $(OBJCOPY) -O binary $(obj)/romstage.elf $@ |
| 346 | |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 347 | $(obj)/coreboot.romstage: $$(romstage-objs) $(obj)/romstage/link_xip.ld |
Kyösti Mälkki | a01ec14 | 2012-03-31 10:21:29 +0300 | [diff] [blame] | 348 | @printf " LINK $(subst $(obj)/,,$(@))\n" |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 349 | $(CC) -nostdlib -nostartfiles -static -o $(obj)/romstage.elf -L$(obj) -T $(obj)/romstage/link_xip.ld $(romstage-objs) |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 350 | $(NM) -n $(obj)/romstage.elf | sort > $(obj)/romstage.map |
| 351 | $(OBJCOPY) --only-keep-debug $(obj)/romstage.elf $(obj)/romstage.debug |
| 352 | $(OBJCOPY) --strip-debug $(obj)/romstage.elf |
| 353 | $(OBJCOPY) --add-gnu-debuglink=$(obj)/romstage.debug $(obj)/romstage.elf |
| 354 | $(OBJCOPY) -O binary $(obj)/romstage.elf $@ |
| 355 | |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 356 | $(obj)/romstage/link_null.ld: $$(ldscripts) $(obj)/ldoptions |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 357 | @printf " GEN $(subst $(obj)/,,$(@))\n" |
| 358 | mkdir -p $(obj)/romstage |
Kyösti Mälkki | a01ec14 | 2012-03-31 10:21:29 +0300 | [diff] [blame] | 359 | rm -f $@ |
| 360 | printf "ROMSTAGE_BASE = 0x0;\n" > $@.tmp |
| 361 | printf '$(foreach ldscript,ldoptions $(ldscripts),INCLUDE "$(ldscript:$(obj)/%=%)"\n)' >> $@.tmp |
| 362 | mv $@.tmp $@ |
| 363 | |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 364 | $(obj)/romstage/link_xip.ld: $(obj)/romstage/link_null.ld $(obj)/romstage/base_xip.txt |
Kyösti Mälkki | a01ec14 | 2012-03-31 10:21:29 +0300 | [diff] [blame] | 365 | @printf " GEN $(subst $(obj)/,,$(@))\n" |
| 366 | rm -f $@ |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 367 | sed -e 's/^/ROMSTAGE_BASE = /g' -e 's/$$/;/g' $(obj)/romstage/base_xip.txt > $@.tmp |
| 368 | sed -e '/ROMSTAGE_BASE/d' $(obj)/romstage/link_null.ld >> $@.tmp |
Kyösti Mälkki | a01ec14 | 2012-03-31 10:21:29 +0300 | [diff] [blame] | 369 | mv $@.tmp $@ |
| 370 | |
Kyösti Mälkki | d842f1f | 2012-03-26 19:03:44 +0300 | [diff] [blame] | 371 | $(obj)/romstage/base_xip.txt: $(obj)/coreboot.pre1 $(obj)/romstage.bin |
Kyösti Mälkki | a01ec14 | 2012-03-31 10:21:29 +0300 | [diff] [blame] | 372 | rm -f $@ |
| 373 | $(CBFSTOOL) $(obj)/coreboot.pre1 locate $(obj)/romstage.bin $(CONFIG_CBFS_PREFIX)/romstage $(CONFIG_XIP_ROM_SIZE) > $@.tmp \ |
| 374 | || { echo "The romstage is larger than XIP size. Please expand the CONFIG_XIP_ROM_SIZE" ; exit 1; } |
| 375 | sed -i -e 's/^/0x/g' $@.tmp |
| 376 | mv $@.tmp $@ |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 377 | |
| 378 | $(obj)/romstage/crt0.S: $$(crt0s) |
| 379 | @printf " GEN $(subst $(obj)/,,$(@))\n" |
| 380 | mkdir -p $(obj)/romstage |
Patrick Georgi | 950f20a | 2012-01-17 13:13:59 +0100 | [diff] [blame] | 381 | printf '$(foreach crt0,$(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@ |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 382 | |
| 383 | $(obj)/mainboard/$(MAINBOARDDIR)/crt0.romstage.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s |
| 384 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Patrick Georgi | 30cc480 | 2012-03-11 19:34:12 +0100 | [diff] [blame] | 385 | $(CC) -Wa,-acdlns -c -o $@ $< > $(dir $@)/crt0.disasm |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 386 | |
Patrick Georgi | 950f20a | 2012-01-17 13:13:59 +0100 | [diff] [blame] | 387 | $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s: $(obj)/romstage/crt0.S $(obj)/config.h $(obj)/build.h |
Patrick Georgi | 641dd71 | 2011-11-01 18:55:59 +0100 | [diff] [blame] | 388 | @printf " CC $(subst $(obj)/,,$(@))\n" |
Patrick Georgi | 950f20a | 2012-01-17 13:13:59 +0100 | [diff] [blame] | 389 | $(CC) -MMD -x assembler-with-cpp -E -I$(src)/include -I$(src)/arch/x86/include -I$(obj) -I$(obj)/romstage -include $(obj)/config.h -include $(obj)/build.h -I. -I$(src) $< -o $@ |
Stefan Reinauer | f1939bb | 2010-12-30 17:39:50 +0000 | [diff] [blame] | 390 | |
| 391 | seabios: |
| 392 | $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc \ |
Peter Stuge | b1d1c4d | 2011-02-07 20:16:40 +0000 | [diff] [blame] | 393 | HOSTCC="$(HOSTCC)" \ |
Stefan Reinauer | e3509fd | 2011-01-29 05:51:54 +0000 | [diff] [blame] | 394 | CC="$(CC)" LD="$(LD)" OBJDUMP="$(OBJDUMP)" \ |
| 395 | OBJCOPY="$(OBJCOPY)" STRIP="$(STRIP)" \ |
Stefan Reinauer | f1939bb | 2010-12-30 17:39:50 +0000 | [diff] [blame] | 396 | CONFIG_SEABIOS_MASTER=$(CONFIG_SEABIOS_MASTER) \ |
Stefan Reinauer | aff6dc2 | 2012-01-21 10:34:22 -0800 | [diff] [blame] | 397 | CONFIG_SEABIOS_STABLE=$(CONFIG_SEABIOS_STABLE) \ |
| 398 | OUT=$(abspath $(obj)) |
| 399 | |
Stefan Reinauer | e50952f | 2011-04-15 03:34:05 +0000 | [diff] [blame] | 400 | filo: |
| 401 | $(MAKE) -C payloads/external/FILO -f Makefile.inc \ |
| 402 | HOSTCC="$(HOSTCC)" \ |
| 403 | CC="$(CC)" LD="$(LD)" OBJDUMP="$(OBJDUMP)" \ |
| 404 | OBJCOPY="$(OBJCOPY)" STRIP="$(STRIP)" \ |
| 405 | CONFIG_FILO_MASTER=$(CONFIG_FILO_MASTER) \ |
| 406 | CONFIG_FILO_STABLE=$(CONFIG_FILO_STABLE) |
Stefan Reinauer | f1939bb | 2010-12-30 17:39:50 +0000 | [diff] [blame] | 407 | |