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> |
| 6 | ## |
| 7 | ## Redistribution and use in source and binary forms, with or without |
| 8 | ## modification, are permitted provided that the following conditions |
| 9 | ## are met: |
| 10 | ## 1. Redistributions of source code must retain the above copyright |
| 11 | ## notice, this list of conditions and the following disclaimer. |
| 12 | ## 2. Redistributions in binary form must reproduce the above copyright |
| 13 | ## notice, this list of conditions and the following disclaimer in the |
| 14 | ## documentation and/or other materials provided with the distribution. |
| 15 | ## 3. The name of the author may not be used to endorse or promote products |
| 16 | ## derived from this software without specific prior written permission. |
| 17 | ## |
| 18 | ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
| 19 | ## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | ## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
| 22 | ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | ## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 24 | ## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 25 | ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 26 | ## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 27 | ## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 28 | ## SUCH DAMAGE. |
| 29 | ## |
| 30 | |
| 31 | $(if $(wildcard .xcompile),,$(eval $(shell bash util/xcompile/xcompile > .xcompile))) |
| 32 | include .xcompile |
| 33 | |
| 34 | export top := $(shell pwd) |
| 35 | export src := $(top)/src |
| 36 | export srck := $(top)/util/kconfig |
| 37 | export obj := $(top)/build |
| 38 | export objk := $(top)/build/util/kconfig |
| 39 | export sconfig := $(top)/util/sconfig |
| 40 | export yapps2_py := $(sconfig)/yapps2.py |
| 41 | export config_g := $(sconfig)/config.g |
| 42 | |
| 43 | |
| 44 | export KERNELVERSION := 2.3 |
| 45 | export KCONFIG_AUTOHEADER := $(obj)/config.h |
| 46 | export KCONFIG_AUTOCONFIG := $(obj)/auto.conf |
| 47 | export COREBOOT_V2 := 1 |
| 48 | |
| 49 | CONFIG_SHELL := sh |
| 50 | KBUILD_DEFCONFIG := configs/defconfig |
| 51 | UNAME_RELEASE := $(shell uname -r) |
| 52 | HAVE_DOTCONFIG := $(wildcard .config) |
| 53 | MAKEFLAGS += -rR --no-print-directory |
| 54 | |
| 55 | # 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] | 56 | Q:=@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 57 | ifneq ($(V),1) |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 58 | ifneq ($(Q),) |
| 59 | .SILENT: |
| 60 | endif |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 61 | endif |
| 62 | |
| 63 | CPP:= $(CC) -x assembler-with-cpp -DASSEMBLY -E |
| 64 | HOSTCC = gcc |
| 65 | HOSTCXX = g++ |
| 66 | HOSTCFLAGS := -I$(srck) -I$(objk) -g |
| 67 | HOSTCXXFLAGS := -I$(srck) -I$(objk) |
Harald Gutmann | dc4bb0d | 2009-08-26 15:35:36 +0000 | [diff] [blame] | 68 | LIBGCC_FILE_NAME := $(shell $(CC) -print-libgcc-file-name) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 69 | |
| 70 | DESTDIR = /opt |
| 71 | |
| 72 | DOXYGEN := doxygen |
| 73 | DOXYGEN_OUTPUT_DIR := doxygen |
| 74 | |
| 75 | ifeq ($(strip $(HAVE_DOTCONFIG)),) |
| 76 | |
| 77 | all: config |
| 78 | |
| 79 | else |
| 80 | |
| 81 | include $(top)/.config |
| 82 | |
| 83 | ARCHDIR-$(CONFIG_ARCH_X86) := i386 |
| 84 | ARCHDIR-$(CONFIG_ARCH_POWERPC) := ppc |
| 85 | |
| 86 | MAINBOARDDIR=$(shell echo $(CONFIG_MAINBOARD_DIR)) |
| 87 | export MAINBOARDDIR |
| 88 | |
| 89 | PLATFORM-y += src/arch/$(ARCHDIR-y) src/cpu src/mainboard/$(MAINBOARDDIR) |
| 90 | TARGETS-y := |
| 91 | |
| 92 | BUILD-y := src/lib src/boot src/console src/devices src/southbridge src/northbridge src/superio src/drivers util/x86emu |
| 93 | BUILD-y += util/cbfstool |
| 94 | BUILD-$(CONFIG_ARCH_X86) += src/pc80 |
| 95 | |
| 96 | # The primary target needs to be here before we include the |
| 97 | # other files |
| 98 | |
| 99 | all: coreboot |
| 100 | |
| 101 | |
| 102 | ####################################################################### |
| 103 | # Build the tools |
| 104 | |
| 105 | CBFSTOOL:=$(obj)/util/cbfstool/cbfstool |
| 106 | |
| 107 | $(obj)/mainboard/$(MAINBOARDDIR)/config.py: $(yapps2_py) $(config_g) |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 108 | mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) |
| 109 | python $(yapps2_py) $(config_g) $(obj)/mainboard/$(MAINBOARDDIR)/config.py |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 110 | |
| 111 | |
| 112 | # needed objects that every mainboard uses |
| 113 | # Creation of these is architecture and mainboard independent |
| 114 | $(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/Config.lb $(obj)/mainboard/$(MAINBOARDDIR)/config.py |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 115 | mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 116 | (cd $(obj)/mainboard/$(MAINBOARDDIR) ; PYTHONPATH=$(top)/util/sconfig export PYTHONPATH; python config.py $(MAINBOARDDIR) $(top) $(obj)/mainboard/$(MAINBOARDDIR)) |
| 117 | |
| 118 | $(obj)/mainboard/$(MAINBOARDDIR)/static.o: $(obj)/mainboard/$(MAINBOARDDIR)/static.c |
| 119 | # |
| 120 | |
| 121 | objs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.o |
| 122 | initobjs:= |
| 123 | drivers:= |
| 124 | smmobjs:= |
| 125 | crt0s:= |
| 126 | ldscripts:= |
| 127 | types:=obj initobj driver smmobj |
| 128 | src_types:=crt0 ldscript |
| 129 | includemakefiles=$(foreach type,$(2), $(eval $(type)-y:=)) $(eval subdirs-y:=) $(eval include $(1)) $(if $(strip $(3)),$(foreach type,$(2),$(eval $(type)s+=$$(patsubst src/%,$(obj)/%,$$(addprefix $(dir $(1)),$$($(type)-y)))))) $(eval subdirs+=$$(subst $(PWD)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))) |
| 130 | evaluate_subdirs=$(eval cursubdirs:=$(subdirs)) $(eval subdirs:=) $(foreach dir,$(cursubdirs),$(eval $(call includemakefiles,$(dir)/Makefile.inc,$(types) $(src_types),$(1)))) $(if $(subdirs),$(eval $(call evaluate_subdirs, $(1)))) |
| 131 | |
| 132 | # collect all object files eligible for building |
| 133 | subdirs:=$(PLATFORM-y) $(BUILD-y) |
| 134 | $(eval $(call evaluate_subdirs, modify)) |
| 135 | |
| 136 | allobjs:=$(foreach var, $(addsuffix s,$(types)), $($(var))) |
| 137 | alldirs:=$(sort $(abspath $(dir $(allobjs)))) |
| 138 | source_with_ext=$(patsubst $(obj)/%.o,src/%.$(1),$(allobjs)) |
| 139 | allsrc=$(wildcard $(call source_with_ext,c) $(call source_with_ext,S)) |
| 140 | |
| 141 | POST_EVALUATION:=y |
| 142 | |
| 143 | # fetch rules (protected in POST_EVALUATION) that rely on the variables filled above |
| 144 | subdirs:=$(PLATFORM-y) $(BUILD-y) |
| 145 | $(eval $(call evaluate_subdirs)) |
| 146 | |
| 147 | |
| 148 | define objs_c_template |
| 149 | $(obj)/$(1)%.o: src/$(1)%.c |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 150 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 151 | $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 152 | endef |
| 153 | |
| 154 | define objs_S_template |
| 155 | $(obj)/$(1)%.o: src/$(1)%.S |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 156 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 157 | $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 158 | endef |
| 159 | |
| 160 | define initobjs_c_template |
| 161 | $(obj)/$(1)%.o: src/$(1)%.c |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 162 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 163 | $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 164 | endef |
| 165 | |
| 166 | define initobjs_S_template |
| 167 | $(obj)/$(1)%.o: src/$(1)%.S |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 168 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 169 | $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 170 | endef |
| 171 | |
| 172 | define drivers_c_template |
| 173 | $(obj)/$(1)%.o: src/$(1)%.c |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 174 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 175 | $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 176 | endef |
| 177 | |
| 178 | define drivers_S_template |
| 179 | $(obj)/$(1)%.o: src/$(1)%.S |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 180 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 181 | $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 182 | endef |
| 183 | |
| 184 | define smmobjs_c_template |
| 185 | $(obj)/$(1)%.o: src/$(1)%.c |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 186 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 187 | $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 188 | endef |
| 189 | |
| 190 | define smmobjs_S_template |
| 191 | $(obj)/$(1)%.o: src/$(1)%.S |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 192 | @printf " CC $$(subst $$(shell pwd)/,,$$(@))\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 193 | $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 194 | endef |
| 195 | |
| 196 | usetemplate=$(foreach d,$(sort $(dir $($(1)))),$(eval $(call $(1)_$(2)_template,$(subst $(obj)/,,$(d))))) |
| 197 | usetemplate=$(foreach d,$(sort $(dir $($(1)))),$(eval $(call $(1)_$(2)_template,$(subst $(obj)/,,$(d))))) |
| 198 | $(eval $(call usetemplate,objs,c)) |
| 199 | $(eval $(call usetemplate,objs,S)) |
| 200 | $(eval $(call usetemplate,initobjs,c)) |
| 201 | $(eval $(call usetemplate,initobjs,S)) |
| 202 | $(eval $(call usetemplate,drivers,c)) |
| 203 | $(eval $(call usetemplate,drivers,S)) |
| 204 | $(eval $(call usetemplate,smmobjs,c)) |
| 205 | $(eval $(call usetemplate,smmobjs,S)) |
| 206 | |
| 207 | printall: |
| 208 | @echo objs:=$(objs) |
| 209 | @echo initobjs:=$(initobjs) |
| 210 | @echo drivers:=$(drivers) |
| 211 | @echo smmobjs:=$(smmobjs) |
| 212 | @echo alldirs:=$(alldirs) |
| 213 | @echo allsrc=$(allsrc) |
| 214 | |
| 215 | OBJS := $(patsubst %,$(obj)/%,$(TARGETS-y)) |
| 216 | INCLUDES := -I$(top)/src -I$(top)/src/include -I$(obj) -I$(top)/src/arch/$(ARCHDIR-y)/include |
| 217 | INCLUDES += -I$(shell $(CC) -print-search-dirs | head -n 1 | cut -d' ' -f2)include |
Myles Watson | e680495 | 2009-08-28 14:36:12 +0000 | [diff] [blame] | 218 | INCLUDES += -I$(top)/util/x86emu/include |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 219 | INCLUDES += -include $(obj)/build.h |
| 220 | |
| 221 | try-run= $(shell set -e; \ |
| 222 | TMP=".$$$$.tmp"; \ |
| 223 | if ($(1)) > /dev/null 2>&1; \ |
| 224 | then echo "$(2)"; \ |
| 225 | else echo "$(3)"; \ |
| 226 | fi; rm -rf "$$TMP") |
| 227 | |
| 228 | cc-option= $(call try-run,\ |
| 229 | $(CC) $(1) -S -xc /dev/null -o "$$TMP", $(1), $(2)) |
| 230 | |
| 231 | STACKPROTECT += $(call cc-option, -fno-stack-protector,) |
| 232 | |
| 233 | CFLAGS = $(STACKPROTECT) $(INCLUDES) $(MAINBOARD_OPTIONS) -Os -nostdinc |
| 234 | CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes |
| 235 | CFLAGS +=-Wwrite-strings -Wredundant-decls -Wno-trigraphs |
| 236 | CFLAGS += -Werror-implicit-function-declaration -Wstrict-aliasing -Wshadow |
| 237 | CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer |
| 238 | |
| 239 | CBFS_COMPRESS_FLAG:= |
Patrick Georgi | ca5d9fb | 2009-08-25 13:53:14 +0000 | [diff] [blame] | 240 | ifeq ($(CONFIG_COMPRESSED_PAYLOAD_LZMA),y) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 241 | CBFS_COMPRESS_FLAG:=l |
| 242 | endif |
| 243 | |
| 244 | coreboot: prepare prepare2 $(obj)/coreboot.rom |
| 245 | |
| 246 | endif |
| 247 | |
| 248 | prepare: |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 249 | mkdir -p $(obj) |
| 250 | mkdir -p $(obj)/util/kconfig/lxdialog |
| 251 | test -n "$(alldirs)" && mkdir -p $(alldirs) || true |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 252 | |
| 253 | prepare2: |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 254 | @printf " GEN $(subst $(shell pwd)/,,$(obj)/build.h)\n" |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 255 | printf "#define COREBOOT_VERSION \"$(KERNELVERSION)\"\n" > $(obj)/build.h |
| 256 | printf "#define COREBOOT_EXTRA_VERSION \"$(COREBOOT_EXTRA_VERSION)\"\n" >> $(obj)/build.h |
| 257 | printf "#define COREBOOT_V2 \"$(COREBOOT_V2)\"\n" >> $(obj)/build.h |
| 258 | printf "#define COREBOOT_BUILD \"`LANG= date`\"\n" >> $(obj)/build.h |
| 259 | printf "\n" >> $(obj)/build.h |
| 260 | printf "#define COREBOOT_COMPILER \"$(shell LANG= $(CC) --version | head -n1)\"\n" >> $(obj)/build.h |
| 261 | printf "#define COREBOOT_ASSEMBLER \"$(shell LANG= $(AS) --version | head -n1)\"\n" >> $(obj)/build.h |
| 262 | printf "#define COREBOOT_LINKER \"$(shell LANG= $(LD) --version | head -n1)\"\n" >> $(obj)/build.h |
| 263 | printf "#define COREBOOT_COMPILE_TIME \"`LANG= date +%T`\"\n" >> $(obj)/build.h |
| 264 | printf "#define COREBOOT_COMPILE_BY \"$(shell PATH=$$PATH:/usr/ucb whoami)\"\n" >> $(obj)/build.h |
| 265 | printf "#define COREBOOT_COMPILE_HOST \"$(shell hostname)\"\n" >> $(obj)/build.h |
| 266 | printf "#define COREBOOT_COMPILE_DOMAIN \"$(shell test `uname -s` = "Linux" && dnsdomainname || domainname)\"\n" >> $(obj)/build.h |
| 267 | printf "#include \"config.h\"\n" >> $(obj)/build.h |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 268 | |
| 269 | doxy: doxygen |
| 270 | doxygen: |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 271 | $(DOXYGEN) Doxyfile |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 272 | |
| 273 | doxyclean: doxygen-clean |
| 274 | doxygen-clean: |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 275 | rm -rf $(DOXYGEN_OUTPUT_DIR) |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 276 | |
| 277 | clean: doxygen-clean |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 278 | rm -f $(allobjs) build/coreboot* .xcompile |
| 279 | rm -f build/option_table.* build/crt0_includes.h build/ldscript |
| 280 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/static.c $(obj)/mainboard/$(MAINBOARDDIR)/config.py $(obj)/mainboard/$(MAINBOARDDIR)/static.dot |
| 281 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/auto.inc $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s $(obj)/mainboard/$(MAINBOARDDIR)/crt0.disasm |
| 282 | rmdir -p $(alldirs) 2>/dev/null >/dev/null || true |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 283 | |
| 284 | distclean: clean |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 285 | rm -rf build |
| 286 | rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 287 | |
| 288 | update: |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 289 | dongle.py -c /dev/term/1 build/coreboot.rom EOF |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 290 | |
| 291 | # This include must come _before_ the pattern rules below! |
| 292 | # Order _does_ matter for pattern rules. |
| 293 | include util/kconfig/Makefile |
| 294 | |
| 295 | $(obj)/ldoptions: $(obj)/config.h |
| 296 | # cat $(obj)/config.h | grep -v \" |grep -v AUTOCONF_INCLUDED | grep \#define | sed s/\#define\ // | sed s/\ /\ =\ / | sed 's/$$/;/' > $(obj)/ldoptions |
Patrick Georgi | 2b7418e | 2009-08-25 19:38:46 +0000 | [diff] [blame] | 297 | awk '/^#define ([^"])* ([^"])*$$/ {print $$2 " = " $$3 ";";}' $< > $@ |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 298 | |
| 299 | $(obj)/romcc: $(top)/util/romcc/romcc.c |
Uwe Hermann | fe2664a | 2009-08-25 15:03:20 +0000 | [diff] [blame] | 300 | @printf " HOSTCC romcc" |
Patrick Georgi | 0588d19 | 2009-08-12 15:00:51 +0000 | [diff] [blame] | 301 | $(HOSTCC) -g -O2 -Wall -o $@ $< |
| 302 | |
| 303 | .PHONY: $(PHONY) prepare prepare2 clean distclean doxygen doxy coreboot |
| 304 | |