Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the coreboot project. |
| 3 | ## |
| 4 | ## Copyright (C) 2008 Advanced Micro Devices, Inc. |
| 5 | ## Copyright (C) 2008 Uwe Hermann <uwe@hermann-uwe.de> |
Stefan Reinauer | 8ed1b6d | 2010-01-19 21:13:44 +0000 | [diff] [blame] | 6 | ## Copyright (C) 2009-2010 coresystems GmbH |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 7 | ## |
Stefan Reinauer | 16f515a | 2010-01-20 18:44:30 +0000 | [diff] [blame] | 8 | ## This program is free software; you can redistribute it and/or modify |
| 9 | ## it under the terms of the GNU General Public License as published by |
| 10 | ## the Free Software Foundation; version 2 of the License. |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 11 | ## |
Stefan Reinauer | 16f515a | 2010-01-20 18:44:30 +0000 | [diff] [blame] | 12 | ## This program is distributed in the hope that it will be useful, |
| 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | ## GNU General Public License for more details. |
| 16 | ## |
| 17 | ## You should have received a copy of the GNU General Public License |
| 18 | ## along with this program; if not, write to the Free Software |
| 19 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 20 | ## |
| 21 | |
Patrick Georgi | 020f51f | 2010-03-14 21:25:03 +0000 | [diff] [blame] | 22 | ifeq ($(INNER_SCANBUILD),y) |
| 23 | CC_real:=$(CC) |
| 24 | endif |
Patrick Georgi | 23d89cc | 2010-03-16 01:17:19 +0000 | [diff] [blame] | 25 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 26 | $(if $(wildcard .xcompile),,$(eval $(shell bash util/xcompile/xcompile > .xcompile))) |
| 27 | include .xcompile |
Patrick Georgi | 23d89cc | 2010-03-16 01:17:19 +0000 | [diff] [blame] | 28 | |
Patrick Georgi | 020f51f | 2010-03-14 21:25:03 +0000 | [diff] [blame] | 29 | ifeq ($(INNER_SCANBUILD),y) |
| 30 | CC:=$(CC_real) |
| 31 | HOSTCC:=$(CC_real) --hostcc |
| 32 | HOSTCXX:=$(CC_real) --hostcxx |
| 33 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 34 | |
Jonathan Kollasch | 7ff5b44 | 2010-09-28 21:11:48 +0000 | [diff] [blame] | 35 | export top := $(CURDIR) |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 36 | export src := src |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 37 | export srck := $(top)/util/kconfig |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 38 | export obj ?= build |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 39 | export objutil ?= $(obj)/util |
| 40 | export objk := $(objutil)/kconfig |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 41 | |
| 42 | |
Stefan Reinauer | 37d8c21 | 2010-02-08 18:30:41 +0000 | [diff] [blame] | 43 | export KERNELVERSION := 4.0 |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 44 | export KCONFIG_AUTOHEADER := $(obj)/config.h |
| 45 | export KCONFIG_AUTOCONFIG := $(obj)/auto.conf |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 46 | |
| 47 | CONFIG_SHELL := sh |
| 48 | KBUILD_DEFCONFIG := configs/defconfig |
| 49 | UNAME_RELEASE := $(shell uname -r) |
Patrick Georgi | 89ec376 | 2010-12-08 19:58:30 +0000 | [diff] [blame] | 50 | DOTCONFIG ?= .config |
| 51 | KCONFIG_CONFIG = $(DOTCONFIG) |
| 52 | export KCONFIG_CONFIG |
| 53 | HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG)) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 54 | MAKEFLAGS += -rR --no-print-directory |
| 55 | |
| 56 | # Make is silent per default, but 'make V=1' will show all compiler calls. |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 57 | Q:=@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 58 | ifneq ($(V),1) |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 59 | ifneq ($(Q),) |
| 60 | .SILENT: |
| 61 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 62 | endif |
| 63 | |
| 64 | CPP:= $(CC) -x assembler-with-cpp -DASSEMBLY -E |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 65 | ROMCC:= $(objutil)/romcc/romcc |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 66 | HOSTCC = gcc |
| 67 | HOSTCXX = g++ |
| 68 | HOSTCFLAGS := -I$(srck) -I$(objk) -g |
| 69 | HOSTCXXFLAGS := -I$(srck) -I$(objk) |
Stefan Reinauer | 68a564f | 2010-03-16 01:02:18 +0000 | [diff] [blame] | 70 | LIBGCC_FILE_NAME := $(shell test -r `$(CC) -print-libgcc-file-name` && $(CC) -print-libgcc-file-name) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 71 | |
| 72 | DOXYGEN := doxygen |
| 73 | DOXYGEN_OUTPUT_DIR := doxygen |
| 74 | |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 75 | # Three cases where we don't need fully populated $(obj) lists: |
| 76 | # 1. when no .config exists |
| 77 | # 2. when make config (in any flavour) is run |
| 78 | # 3. when make distclean is run |
| 79 | # Don't waste time on reading all Makefile.incs in these cases |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 80 | ifeq ($(strip $(HAVE_DOTCONFIG)),) |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 81 | NOCOMPILE:=1 |
| 82 | endif |
| 83 | ifneq ($(MAKECMDGOALS),) |
| 84 | ifneq ($(filter %config distclean,$(MAKECMDGOALS)),) |
| 85 | NOCOMPILE:=1 |
| 86 | endif |
| 87 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 88 | |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 89 | ifeq ($(NOCOMPILE),1) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 90 | all: config |
| 91 | |
| 92 | else |
| 93 | |
Patrick Georgi | 977b985 | 2010-09-24 22:15:54 +0000 | [diff] [blame] | 94 | include $(HAVE_DOTCONFIG) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 95 | |
Patrick Georgi | 23d89cc | 2010-03-16 01:17:19 +0000 | [diff] [blame] | 96 | ifneq ($(INNER_SCANBUILD),y) |
| 97 | ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y) |
| 98 | CC:=clang -m32 |
| 99 | HOSTCC:=clang |
| 100 | endif |
| 101 | endif |
| 102 | |
Patrick Georgi | 516a2a7 | 2010-03-25 21:45:25 +0000 | [diff] [blame] | 103 | ifeq ($(CONFIG_CCACHE),y) |
Patrick Georgi | 977b985 | 2010-09-24 22:15:54 +0000 | [diff] [blame] | 104 | CCACHE:=$(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH)))) |
Patrick Georgi | 516a2a7 | 2010-03-25 21:45:25 +0000 | [diff] [blame] | 105 | ifeq ($(CCACHE),) |
| 106 | $(error ccache selected, but not found in PATH) |
| 107 | endif |
Patrick Georgi | 977b985 | 2010-09-24 22:15:54 +0000 | [diff] [blame] | 108 | CCACHE:=CCACHE_COMPILERCHECK=content CCACHE_BASEDIR=$(top) $(CCACHE) |
Patrick Georgi | 516a2a7 | 2010-03-25 21:45:25 +0000 | [diff] [blame] | 109 | CC := $(CCACHE) $(CC) |
| 110 | HOSTCC := $(CCACHE) $(HOSTCC) |
| 111 | HOSTCXX := $(CCACHE) $(HOSTCXX) |
| 112 | ROMCC := $(CCACHE) $(ROMCC) |
| 113 | endif |
| 114 | |
Patrick Georgi | a84e98b | 2010-03-16 19:01:32 +0000 | [diff] [blame] | 115 | strip_quotes = $(subst ",,$(subst \",,$(1))) |
| 116 | |
Stefan Reinauer | 8677a23 | 2010-12-11 20:33:41 +0000 | [diff] [blame] | 117 | ARCHDIR-$(CONFIG_ARCH_X86) := x86 |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 118 | ARCHDIR-$(CONFIG_ARCH_POWERPC) := ppc |
| 119 | |
Patrick Georgi | a84e98b | 2010-03-16 19:01:32 +0000 | [diff] [blame] | 120 | MAINBOARDDIR=$(call strip_quotes,$(CONFIG_MAINBOARD_DIR)) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 121 | export MAINBOARDDIR |
| 122 | |
| 123 | PLATFORM-y += src/arch/$(ARCHDIR-y) src/cpu src/mainboard/$(MAINBOARDDIR) |
| 124 | TARGETS-y := |
| 125 | |
Sven Schnelle | 7592e8b | 2011-01-27 11:43:03 +0000 | [diff] [blame] | 126 | BUILD-y := src/lib src/boot src/console src/devices src/ec src/southbridge src/northbridge src/superio src/drivers |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 127 | BUILD-y += util/cbfstool util/sconfig |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 128 | BUILD-$(CONFIG_ARCH_X86) += src/pc80 |
| 129 | |
Uwe Hermann | c04be93 | 2009-10-05 13:55:28 +0000 | [diff] [blame] | 130 | ifneq ($(CONFIG_LOCALVERSION),"") |
Patrick Georgi | a84e98b | 2010-03-16 19:01:32 +0000 | [diff] [blame] | 131 | COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION)) |
Uwe Hermann | c04be93 | 2009-10-05 13:55:28 +0000 | [diff] [blame] | 132 | endif |
| 133 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 134 | # The primary target needs to be here before we include the |
| 135 | # other files |
| 136 | |
Patrick Georgi | 020f51f | 2010-03-14 21:25:03 +0000 | [diff] [blame] | 137 | ifeq ($(INNER_SCANBUILD),y) |
| 138 | CONFIG_SCANBUILD_ENABLE:= |
| 139 | endif |
| 140 | |
| 141 | ifeq ($(CONFIG_SCANBUILD_ENABLE),y) |
| 142 | ifneq ($(CONFIG_SCANBUILD_REPORT_LOCATION),) |
| 143 | CONFIG_SCANBUILD_REPORT_LOCATION:=-o $(CONFIG_SCANBUILD_REPORT_LOCATION) |
| 144 | endif |
| 145 | all: |
| 146 | echo '#!/bin/sh' > .ccwrap |
| 147 | echo 'CC="$(CC)"' >> .ccwrap |
| 148 | echo 'if [ "$$1" = "--hostcc" ]; then shift; CC="$(HOSTCC)"; fi' >> .ccwrap |
| 149 | echo 'if [ "$$1" = "--hostcxx" ]; then shift; CC="$(HOSTCXX)"; fi' >> .ccwrap |
| 150 | echo 'eval $$CC $$*' >> .ccwrap |
| 151 | chmod +x .ccwrap |
| 152 | scan-build $(CONFIG_SCANBUILD_REPORT_LOCATION) -analyze-headers --use-cc=$(top)/.ccwrap --use-c++=$(top)/.ccwrap $(MAKE) INNER_SCANBUILD=y |
| 153 | else |
Stefan Reinauer | e9f3258 | 2010-03-29 13:04:13 +0000 | [diff] [blame] | 154 | all: $(obj)/config.h coreboot |
Patrick Georgi | 020f51f | 2010-03-14 21:25:03 +0000 | [diff] [blame] | 155 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 156 | |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 157 | # must come rather early |
| 158 | .SECONDEXPANSION: |
| 159 | |
Stefan Reinauer | 1425add | 2010-03-21 22:35:58 +0000 | [diff] [blame] | 160 | $(obj)/config.h: |
| 161 | $(MAKE) oldconfig |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 162 | |
| 163 | ####################################################################### |
| 164 | # Build the tools |
| 165 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 166 | CBFSTOOL:=$(objutil)/cbfstool/cbfstool |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 167 | |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 168 | # needed objects that every mainboard uses |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 169 | # Creation of these is architecture and mainboard independent |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 170 | $(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devicetree.cb $(objutil)/sconfig/sconfig |
Stefan Reinauer | e705f9c | 2010-04-08 13:16:32 +0000 | [diff] [blame] | 171 | @printf " SCONFIG $(subst $(src)/,,$(<))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 172 | mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 173 | $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 174 | |
Stefan Reinauer | 961a7b0 | 2010-04-19 20:47:29 +0000 | [diff] [blame] | 175 | $(objutil)/%.o: $(objutil)/%.c |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 176 | @printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 177 | $(HOSTCC) -MMD -I$(subst $(objutil)/,util/,$(dir $<)) -I$(dir $<) $(HOSTCFLAGS) -c -o $@ $< |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 178 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 179 | $(obj)/%.ramstage.o: $(obj)/%.c $(obj)/config.h |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 180 | @printf " CC $(subst $(obj)/,,$(@))\n" |
| 181 | $(CC) -MMD $(CFLAGS) -c -o $@ $< |
| 182 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 183 | ramstage-srcs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.c |
| 184 | romstage-srcs:= |
| 185 | driver-srcs:= |
| 186 | smm-srcs:= |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 187 | cbfs-files:= |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 188 | |
| 189 | ramstage-objs:= |
| 190 | romstage-objs:= |
| 191 | driver-objs:= |
| 192 | smm-objs:= |
| 193 | types:=ramstage romstage driver smm |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 194 | |
| 195 | # Clean -y variables, include Makefile.inc |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 196 | # Add paths to files in X-y to X-srcs |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 197 | # Add subdirs-y to subdirs |
| 198 | includemakefiles= \ |
| 199 | $(foreach type,$(2), $(eval $(type)-y:=)) \ |
| 200 | $(eval subdirs-y:=) \ |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 201 | $(eval cbfs-files-y:=) \ |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 202 | $(eval -include $(1)) \ |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 203 | $(foreach type,$(2), \ |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 204 | $(eval $(type)-srcs+= \ |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 205 | $$(subst $(top)/,, \ |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 206 | $$(abspath $$(addprefix $(dir $(1)),$$($(type)-y)))))) \ |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 207 | $(foreach file,$(cbfs-files-y), \ |
| 208 | $(if $(wildcard $(dir $(1))$(file)), \ |
| 209 | $(eval tmp-cbfs-file:= $(wildcard $(dir $(1))$(file))), \ |
| 210 | $(eval tmp-cbfs-file:= $(file))) \ |
| 211 | $(eval cbfs-files += $(tmp-cbfs-file)|$$($(file)-name)|$$($(file)-type)|$$($(file)-position)) \ |
| 212 | $(eval $(file)-name:=) \ |
| 213 | $(eval $(file)-type:=) \ |
| 214 | $(eval $(file)-position:=)) \ |
Jonathan Kollasch | 7ff5b44 | 2010-09-28 21:11:48 +0000 | [diff] [blame] | 215 | $(eval subdirs+=$$(subst $(CURDIR)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))) |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 216 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 217 | # For each path in $(subdirs) call includemakefiles |
Patrick Georgi | 47d68d8 | 2010-03-06 21:18:43 +0000 | [diff] [blame] | 218 | # Repeat until subdirs is empty |
| 219 | evaluate_subdirs= \ |
| 220 | $(eval cursubdirs:=$(subdirs)) \ |
| 221 | $(eval subdirs:=) \ |
| 222 | $(foreach dir,$(cursubdirs), \ |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 223 | $(eval $(call includemakefiles,$(dir)/Makefile.inc,$(types)))) \ |
| 224 | $(if $(subdirs),$(eval $(call evaluate_subdirs))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 225 | |
| 226 | # collect all object files eligible for building |
| 227 | subdirs:=$(PLATFORM-y) $(BUILD-y) |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 228 | $(eval $(call evaluate_subdirs)) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 229 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 230 | src-to-obj=$(addsuffix .$(1).o, $(basename $(patsubst src/%, $(obj)/%, $($(1)-srcs)))) |
Patrick Georgi | d3428b0 | 2010-02-24 13:18:01 +0000 | [diff] [blame] | 231 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 232 | ramstage-objs:=$(call src-to-obj,ramstage) |
| 233 | romstage-objs:=$(call src-to-obj,romstage) |
| 234 | driver-objs:=$(call src-to-obj,driver) |
| 235 | smm-objs:=$(call src-to-obj,smm) |
| 236 | |
| 237 | allsrcs:=$(foreach var, $(addsuffix -srcs,$(types)), $($(var))) |
| 238 | allobjs:=$(foreach var, $(addsuffix -objs,$(types)), $($(var))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 239 | alldirs:=$(sort $(abspath $(dir $(allobjs)))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 240 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 241 | define ramstage-objs_asl_template |
| 242 | $(obj)/$(1).ramstage.o: src/$(1).asl |
Patrick Georgi | 1a47b5e | 2010-02-10 18:53:40 +0000 | [diff] [blame] | 243 | @printf " IASL $$(subst $(top)/,,$$(@))\n" |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 244 | $(CPP) -D__ACPI__ -P -include $(abspath $(obj)/config.h) -I$(src) -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl |
Stefan Reinauer | 20c3d77 | 2010-11-15 21:09:57 +0000 | [diff] [blame] | 245 | iasl -p $$(obj)/$(1) -tc $$(basename $$@).asl |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 246 | mv $$(obj)/$(1).hex $$(basename $$@).c |
| 247 | $(CC) $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$@).c |
Zheng Bao | 12fa159 | 2010-04-26 12:27:18 +0000 | [diff] [blame] | 248 | # keep %.o: %.c rule from catching the temporary .c file after a make clean |
| 249 | mv $$(basename $$@).c $$(basename $$@).hex |
Patrick Georgi | 88f55b2 | 2009-09-25 18:43:02 +0000 | [diff] [blame] | 250 | endef |
| 251 | |
Patrick Georgi patrick.georgi | c5f773d | 2010-03-16 12:01:13 +0000 | [diff] [blame] | 252 | # macro to define template macros that are used by use_template macro |
| 253 | define create_cc_template |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 254 | # $1 obj class (ramstage, romstage, driver, smm) |
Patrick Georgi patrick.georgi | c5f773d | 2010-03-16 12:01:13 +0000 | [diff] [blame] | 255 | # $2 source suffix (c, S) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 256 | # $3 additional compiler flags |
| 257 | de$(EMPTY)fine $(1)-objs_$(2)_template |
| 258 | $(obj)/$$(1).$(1).o: src/$$(1).$(2) $(obj)/config.h |
Patrick Georgi | 1cd76e7 | 2010-04-19 20:39:22 +0000 | [diff] [blame] | 259 | @printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n" |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 260 | $(CC) $(3) -MMD $$$$(CFLAGS) -c -o $$$$@ $$$$< |
Patrick Georgi patrick.georgi | c5f773d | 2010-03-16 12:01:13 +0000 | [diff] [blame] | 261 | en$(EMPTY)def |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 262 | endef |
| 263 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 264 | $(eval $(call create_cc_template,ramstage,c)) |
| 265 | $(eval $(call create_cc_template,ramstage,S,-DASSEMBLY)) |
| 266 | $(eval $(call create_cc_template,romstage,c,-D__PRE_RAM__)) |
| 267 | $(eval $(call create_cc_template,romstage,S,-DASSEMBLY -D__PRE_RAM__)) |
| 268 | $(eval $(call create_cc_template,driver,c)) |
| 269 | $(eval $(call create_cc_template,driver,S,-DASSEMBLY)) |
| 270 | $(eval $(call create_cc_template,smm,c)) |
| 271 | $(eval $(call create_cc_template,smm,S)) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 272 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 273 | foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(subst src/,,$(basename $(file)))))) |
| 274 | $(eval $(foreach type,$(types),$(call foreach-src,$(type)))) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 275 | |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 276 | DEPENDENCIES = $(ramstage-objs:.o=.d) $(romstage-objs:.o=.d) $(driver-objs:.o=.d) $(smm-objs:.o=.d) |
Stefan Reinauer | 6bee951 | 2010-03-24 15:51:48 +0000 | [diff] [blame] | 277 | -include $(DEPENDENCIES) |
| 278 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 279 | printall: |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 280 | @echo ramstage-objs:=$(ramstage-objs) |
| 281 | @echo romstage-objs:=$(romstage-objs) |
| 282 | @echo driver-objs:=$(driver-objs) |
| 283 | @echo smm-objs:=$(smm-objs) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 284 | @echo alldirs:=$(alldirs) |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 285 | @echo allsrcs=$(allsrcs) |
Stefan Reinauer | 6bee951 | 2010-03-24 15:51:48 +0000 | [diff] [blame] | 286 | @echo DEPENDENCIES=$(DEPENDENCIES) |
Stefan Reinauer | 68a564f | 2010-03-16 01:02:18 +0000 | [diff] [blame] | 287 | @echo LIBGCC_FILE_NAME=$(LIBGCC_FILE_NAME) |
Patrick Georgi | c2c23dc | 2010-12-16 07:36:28 +0000 | [diff] [blame] | 288 | @echo cbfs-files:='$(cbfs-files)' |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 289 | |
Patrick Georgi | eb49f9d | 2010-02-25 17:03:17 +0000 | [diff] [blame] | 290 | printcrt0s: |
Stefan Reinauer | acdd52f | 2010-03-30 20:32:01 +0000 | [diff] [blame] | 291 | @echo crt0s=$(crt0s) |
| 292 | @echo ldscripts=$(ldscripts) |
Patrick Georgi | eb49f9d | 2010-02-25 17:03:17 +0000 | [diff] [blame] | 293 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 294 | OBJS := $(patsubst %,$(obj)/%,$(TARGETS-y)) |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 295 | INCLUDES := -Isrc -Isrc/include -I$(obj) -Isrc/arch/$(ARCHDIR-y)/include |
Patrick Georgi | 51e142f | 2010-03-27 17:18:39 +0000 | [diff] [blame] | 296 | INCLUDES += -Isrc/devices/oprom/include |
| 297 | # abspath is a workaround for romcc |
Stefan Reinauer | e9f3258 | 2010-03-29 13:04:13 +0000 | [diff] [blame] | 298 | INCLUDES += -include $(abspath $(obj)/config.h) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 299 | |
Marc Jones | 5c31269 | 2010-09-23 15:38:55 +0000 | [diff] [blame] | 300 | CFLAGS = $(INCLUDES) -Os -nostdinc -pipe -g |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 301 | CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes |
Stefan Reinauer | 14e2277 | 2010-04-27 06:56:47 +0000 | [diff] [blame] | 302 | CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs |
Stefan Reinauer | 68a564f | 2010-03-16 01:02:18 +0000 | [diff] [blame] | 303 | CFLAGS += -Wstrict-aliasing -Wshadow |
Myles Watson | 2e67273 | 2009-11-12 16:38:03 +0000 | [diff] [blame] | 304 | ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y) |
| 305 | CFLAGS += -Werror |
| 306 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 307 | CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer |
| 308 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 309 | CBFS_COMPRESS_FLAG:=l |
Myles Watson | 422d0cb | 2009-09-23 17:48:28 +0000 | [diff] [blame] | 310 | CBFS_PAYLOAD_COMPRESS_FLAG:= |
Stefan Reinauer | 314e551 | 2010-04-09 20:36:29 +0000 | [diff] [blame] | 311 | CBFS_PAYLOAD_COMPRESS_NAME:=none |
Myles Watson | 422d0cb | 2009-09-23 17:48:28 +0000 | [diff] [blame] | 312 | ifeq ($(CONFIG_COMPRESSED_PAYLOAD_LZMA),y) |
| 313 | CBFS_PAYLOAD_COMPRESS_FLAG:=l |
Stefan Reinauer | 314e551 | 2010-04-09 20:36:29 +0000 | [diff] [blame] | 314 | CBFS_PAYLOAD_COMPRESS_NAME:=LZMA |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 315 | endif |
| 316 | |
Patrick Georgi | 25fc5ff | 2010-04-27 09:19:47 +0000 | [diff] [blame] | 317 | coreboot: $(obj)/coreboot.rom |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 318 | |
| 319 | endif |
| 320 | |
Patrick Georgi | 25fc5ff | 2010-04-27 09:19:47 +0000 | [diff] [blame] | 321 | $(shell mkdir -p $(obj) $(objutil)/kconfig/lxdialog $(objutil)/cbfstool $(objutil)/romcc $(objutil)/options $(alldirs)) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 322 | |
Stefan Reinauer | e9f3258 | 2010-03-29 13:04:13 +0000 | [diff] [blame] | 323 | $(obj)/build.h: .xcompile |
Uwe Hermann | 6c73b441 | 2009-10-28 17:10:51 +0000 | [diff] [blame] | 324 | @printf " GEN build.h\n" |
Patrick Georgi | cccbb89 | 2010-01-29 17:38:57 +0000 | [diff] [blame] | 325 | rm -f $(obj)/build.h |
Stefan Reinauer | b4d3af8 | 2010-02-11 03:21:29 +0000 | [diff] [blame] | 326 | printf "/* build system definitions (autogenerated) */\n" > $(obj)/build.ht |
| 327 | printf "#ifndef __BUILD_H\n" >> $(obj)/build.ht |
| 328 | printf "#define __BUILD_H\n\n" >> $(obj)/build.ht |
Patrick Georgi | 6630ce1 | 2010-04-14 20:47:45 +0000 | [diff] [blame] | 329 | printf "#define COREBOOT_VERSION \"$(KERNELVERSION)-r$(shell if [ -d $(top)/.svn -a -f "`which svnversion`" ]; then svnversion $(top); else if [ -d $(top)/.git -a -f "`which git`" ]; then git --git-dir=/$(top)/.git log|grep git-svn-id|cut -f 2 -d@|cut -f 1 -d' '|sort -g|tail -1; fi; fi)\"\n" >> $(obj)/build.ht |
Patrick Georgi | cccbb89 | 2010-01-29 17:38:57 +0000 | [diff] [blame] | 330 | printf "#define COREBOOT_EXTRA_VERSION \"$(COREBOOT_EXTRA_VERSION)\"\n" >> $(obj)/build.ht |
| 331 | printf "#define COREBOOT_BUILD \"`LANG= date`\"\n" >> $(obj)/build.ht |
| 332 | printf "\n" >> $(obj)/build.ht |
| 333 | printf "#define COREBOOT_COMPILER \"$(shell LANG= $(CC) --version | head -n1)\"\n" >> $(obj)/build.ht |
| 334 | printf "#define COREBOOT_ASSEMBLER \"$(shell LANG= $(AS) --version | head -n1)\"\n" >> $(obj)/build.ht |
| 335 | printf "#define COREBOOT_LINKER \"$(shell LANG= $(LD) --version | head -n1)\"\n" >> $(obj)/build.ht |
| 336 | printf "#define COREBOOT_COMPILE_TIME \"`LANG= date +%T`\"\n" >> $(obj)/build.ht |
| 337 | printf "#define COREBOOT_COMPILE_BY \"$(subst \,@,$(shell PATH=$$PATH:/usr/ucb whoami))\"\n" >> $(obj)/build.ht |
Patrick Georgi patrick.georgi | c5f773d | 2010-03-16 12:01:13 +0000 | [diff] [blame] | 338 | printf "#define COREBOOT_COMPILE_HOST \"$(shell hostname -s 2>/dev/null)\"\n" >> $(obj)/build.ht |
| 339 | printf "#define COREBOOT_COMPILE_DOMAIN \"$(shell test `uname -s` = "Linux" && dnsdomainname || domainname 2>/dev/null)\"\n" >> $(obj)/build.ht |
Stefan Reinauer | b4d3af8 | 2010-02-11 03:21:29 +0000 | [diff] [blame] | 340 | printf "#endif\n" >> $(obj)/build.ht |
Patrick Georgi | cccbb89 | 2010-01-29 17:38:57 +0000 | [diff] [blame] | 341 | mv $(obj)/build.ht $(obj)/build.h |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 342 | |
Warren Turkal | a9fc330 | 2010-09-03 08:57:32 +0000 | [diff] [blame] | 343 | cscope: |
| 344 | cscope -bR |
| 345 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 346 | doxy: doxygen |
| 347 | doxygen: |
Stefan Reinauer | 1bbad5c | 2010-02-10 15:36:53 +0000 | [diff] [blame] | 348 | $(DOXYGEN) documentation/Doxyfile.coreboot |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 349 | |
| 350 | doxyclean: doxygen-clean |
| 351 | doxygen-clean: |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 352 | rm -rf $(DOXYGEN_OUTPUT_DIR) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 353 | |
Patrick Georgi | 967952a | 2010-02-09 19:41:11 +0000 | [diff] [blame] | 354 | clean-for-update: doxygen-clean |
Patrick Georgi | 8463dd9 | 2010-09-30 16:55:02 +0000 | [diff] [blame] | 355 | rm -f $(ramstage-objs) $(romstage-objs) $(driver-objs) $(smm-objs) .xcompile |
Stefan Reinauer | 6bee951 | 2010-03-24 15:51:48 +0000 | [diff] [blame] | 356 | rm -f $(DEPENDENCIES) |
Patrick Georgi | 967952a | 2010-02-09 19:41:11 +0000 | [diff] [blame] | 357 | rm -f $(obj)/coreboot_ram* $(obj)/coreboot.romstage $(obj)/coreboot.pre* $(obj)/coreboot.bootblock $(obj)/coreboot.a |
Patrick Georgi | 9341acd | 2009-12-23 12:52:56 +0000 | [diff] [blame] | 358 | rm -rf $(obj)/bootblock* $(obj)/romstage* $(obj)/location.* |
Patrick Georgi | e64b637 | 2010-04-08 21:04:45 +0000 | [diff] [blame] | 359 | rm -f $(obj)/option_table.* $(obj)/crt0.S $(obj)/ldscript |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 360 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/static.c $(obj)/mainboard/$(MAINBOARDDIR)/config.py $(obj)/mainboard/$(MAINBOARDDIR)/static.dot |
Stefan Reinauer | f9035dd | 2010-03-17 01:18:14 +0000 | [diff] [blame] | 361 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s $(obj)/mainboard/$(MAINBOARDDIR)/crt0.disasm |
Stefan Reinauer | 6bee951 | 2010-03-24 15:51:48 +0000 | [diff] [blame] | 362 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc |
Stefan Reinauer | 37e7817 | 2010-03-17 01:50:15 +0000 | [diff] [blame] | 363 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.* $(obj)/mainboard/$(MAINBOARDDIR)/dsdt.* |
| 364 | rm -f $(obj)/cpu/x86/smm/smm_bin.c $(obj)/cpu/x86/smm/smm.* $(obj)/cpu/x86/smm/smm |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 365 | rmdir -p $(alldirs) 2>/dev/null >/dev/null || true |
Stefan Reinauer | 6c28522 | 2011-01-05 01:37:48 +0000 | [diff] [blame] | 366 | $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 367 | |
Patrick Georgi | 967952a | 2010-02-09 19:41:11 +0000 | [diff] [blame] | 368 | clean: clean-for-update |
Patrick Georgi | 020f51f | 2010-03-14 21:25:03 +0000 | [diff] [blame] | 369 | rm -f $(obj)/coreboot* .ccwrap |
Patrick Georgi | 967952a | 2010-02-09 19:41:11 +0000 | [diff] [blame] | 370 | |
Warren Turkal | 0e8f204 | 2010-09-27 21:14:19 +0000 | [diff] [blame] | 371 | clean-abuild: |
Warren Turkal | 1f98ee7 | 2010-09-28 21:02:03 +0000 | [diff] [blame] | 372 | rm -rf coreboot-builds |
Warren Turkal | 0e8f204 | 2010-09-27 21:14:19 +0000 | [diff] [blame] | 373 | |
Warren Turkal | a9fc330 | 2010-09-03 08:57:32 +0000 | [diff] [blame] | 374 | clean-cscope: |
| 375 | rm -f cscope.out |
| 376 | |
Patrick Georgi | afbf072 | 2010-09-29 20:28:59 +0000 | [diff] [blame] | 377 | distclean: clean-cscope |
Myles Watson | 1af297c | 2010-01-06 16:59:18 +0000 | [diff] [blame] | 378 | rm -rf $(obj) |
Patrick Georgi | cf036d1 | 2010-04-21 06:36:20 +0000 | [diff] [blame] | 379 | rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap .xcompile |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 380 | |
| 381 | update: |
Myles Watson | d4e5c0a | 2009-10-28 15:30:11 +0000 | [diff] [blame] | 382 | dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 383 | |
Patrick Georgi | c6ef20f | 2010-11-18 15:05:06 +0000 | [diff] [blame] | 384 | lint: |
Patrick Georgi | e882630 | 2010-11-19 10:16:43 +0000 | [diff] [blame] | 385 | FAILED=0; LINTLOG=`mktemp`; \ |
Patrick Georgi | c6ef20f | 2010-11-18 15:05:06 +0000 | [diff] [blame] | 386 | for script in util/lint/lint-*; do \ |
Patrick Georgi | e882630 | 2010-11-19 10:16:43 +0000 | [diff] [blame] | 387 | echo; echo `basename $$script`; \ |
Patrick Georgi | c6ef20f | 2010-11-18 15:05:06 +0000 | [diff] [blame] | 388 | grep "^# DESCR:" $$script | sed "s,.*DESCR: *,," ; \ |
| 389 | echo ========; \ |
| 390 | $$script > $$LINTLOG; \ |
| 391 | if [ `wc -l $$LINTLOG | cut -d' ' -f1` -eq 0 ]; then \ |
| 392 | printf "success\n\n"; \ |
| 393 | else \ |
| 394 | echo test failed: ; \ |
| 395 | cat $$LINTLOG; \ |
| 396 | rm -f $$LINTLOG; \ |
Patrick Georgi | e882630 | 2010-11-19 10:16:43 +0000 | [diff] [blame] | 397 | FAILED=$$(( $$FAILED + 1 )); \ |
| 398 | fi; \ |
| 399 | echo ========; \ |
Patrick Georgi | c6ef20f | 2010-11-18 15:05:06 +0000 | [diff] [blame] | 400 | done; \ |
Patrick Georgi | e882630 | 2010-11-19 10:16:43 +0000 | [diff] [blame] | 401 | test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." && exit 1; }; \ |
Patrick Georgi | c6ef20f | 2010-11-18 15:05:06 +0000 | [diff] [blame] | 402 | rm -f $$LINTLOG |
| 403 | |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 404 | # This include must come _before_ the pattern rules below! |
| 405 | # Order _does_ matter for pattern rules. |
| 406 | include util/kconfig/Makefile |
| 407 | |
| 408 | $(obj)/ldoptions: $(obj)/config.h |
Patrick Georgi | 26774f2 | 2009-11-21 19:54:02 +0000 | [diff] [blame] | 409 | awk '/^#define ([^"])* ([^"])*$$/ {gsub("\\r","",$$3); print $$2 " = " $$3 ";";}' $< > $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 410 | |
Stefan Reinauer | c53d1f3 | 2010-05-08 17:15:36 +0000 | [diff] [blame] | 411 | _WINCHECK=$(shell uname -o 2> /dev/null) |
Patrick Georgi | 26774f2 | 2009-11-21 19:54:02 +0000 | [diff] [blame] | 412 | STACK= |
Stefan Reinauer | c53d1f3 | 2010-05-08 17:15:36 +0000 | [diff] [blame] | 413 | ifeq ($(_WINCHECK),Msys) |
Patrick Georgi | 26774f2 | 2009-11-21 19:54:02 +0000 | [diff] [blame] | 414 | STACK=-Wl,--stack,16384000 |
| 415 | endif |
Stefan Reinauer | c53d1f3 | 2010-05-08 17:15:36 +0000 | [diff] [blame] | 416 | ifeq ($(_WINCHECK),Cygwin) |
Patrick Georgi | 26774f2 | 2009-11-21 19:54:02 +0000 | [diff] [blame] | 417 | STACK=-Wl,--stack,16384000 |
| 418 | endif |
Stefan Reinauer | c53d1f3 | 2010-05-08 17:15:36 +0000 | [diff] [blame] | 419 | |
Patrick Georgi | a2acbc7 | 2010-04-16 22:48:57 +0000 | [diff] [blame] | 420 | $(objutil)/romcc/romcc: $(top)/util/romcc/romcc.c |
Uwe Hermann | 6c73b441 | 2009-10-28 17:10:51 +0000 | [diff] [blame] | 421 | @printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n" |
Uwe Hermann | 0dd63a2 | 2010-02-15 23:24:51 +0000 | [diff] [blame] | 422 | @# Note: Adding -O2 here might cause problems. For details see: |
| 423 | @# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html |
Marc Jones | 516255e | 2010-02-13 18:06:29 +0000 | [diff] [blame] | 424 | $(HOSTCC) -g $(STACK) -Wall -o $@ $< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 425 | |
Warren Turkal | 0e8f204 | 2010-09-27 21:14:19 +0000 | [diff] [blame] | 426 | .PHONY: $(PHONY) clean clean-abuild clean-cscope cscope distclean doxygen doxy coreboot .xcompile |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 427 | |