Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 1 | ## |
| 2 | ## This file is part of the coreboot project. |
| 3 | ## |
| 4 | ## Copyright (C) 2011 secunet Security Networks AG |
| 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 |
| 17 | ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | ## |
| 19 | |
| 20 | ####################################################################### |
| 21 | # misleadingly named, this is the coreboot version |
Sven Schnelle | 054849d | 2011-08-26 21:57:53 +0200 | [diff] [blame] | 22 | export KERNELVERSION := $(shell if [ -d "$(top)/.git" -a -f "`which git`" ]; then git describe --dirty; else echo unknown; fi) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 23 | |
| 24 | ####################################################################### |
| 25 | # Basic component discovery |
| 26 | ARCHDIR-$(CONFIG_ARCH_X86) := x86 |
| 27 | MAINBOARDDIR=$(call strip_quotes,$(CONFIG_MAINBOARD_DIR)) |
| 28 | export MAINBOARDDIR |
| 29 | |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 30 | ## Final build results, which CBFSTOOL uses to create the final |
| 31 | ## rom image file, are placed under $(objcbfs). |
| 32 | ## These typically have suffixes .debug .elf .bin and .map |
| 33 | export objcbfs := $(obj)/cbfs/$(CONFIG_CBFS_PREFIX) |
| 34 | |
| 35 | ## Based on the active configuration, Makefile conditionally collects |
| 36 | ## the required assembly includes and saves them in a file. |
| 37 | ## Such files that do not have a clear one-to-one relation to a source |
| 38 | ## file under src/ are placed and built under $(objgenerated) |
| 39 | export objgenerated := $(obj)/generated |
| 40 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 41 | ####################################################################### |
| 42 | # root rule to resolve if in build mode (ie. configuration exists) |
| 43 | real-target: $(obj)/config.h coreboot |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 44 | coreboot: build-dirs $(obj)/coreboot.rom |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 45 | |
| 46 | ####################################################################### |
| 47 | # our phony targets |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 48 | PHONY+= clean-abuild coreboot lint lint-stable build-dirs |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 49 | |
| 50 | ####################################################################### |
| 51 | # root source directories of coreboot |
Kyösti Mälkki | 2a830d0 | 2011-12-01 17:49:43 +0200 | [diff] [blame] | 52 | subdirs-y := src/lib src/boot src/console src/devices src/ec src/southbridge |
| 53 | subdirs-y += src/northbridge src/superio src/drivers src/cpu src/vendorcode |
Patrick Georgi | 499fc92 | 2012-03-09 10:53:52 +0100 | [diff] [blame] | 54 | subdirs-y += util/cbfstool util/sconfig util/nvramtool |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 55 | subdirs-y += src/arch/$(ARCHDIR-y) |
| 56 | subdirs-y += src/mainboard/$(MAINBOARDDIR) |
| 57 | |
Patrick Georgi | a25828d | 2011-09-02 09:57:01 +0200 | [diff] [blame] | 58 | subdirs-y += site-local |
| 59 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 60 | ####################################################################### |
| 61 | # Add source classes and their build options |
| 62 | classes-y := ramstage romstage driver smm |
| 63 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 64 | romstage-c-ccopts:=-D__PRE_RAM__ |
Stefan Reinauer | 61aee5f | 2011-04-10 04:15:23 +0000 | [diff] [blame] | 65 | romstage-S-ccopts:=-D__PRE_RAM__ |
Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 66 | ifeq ($(CONFIG_TRACE),y) |
| 67 | ramstage-c-ccopts:= -finstrument-functions |
| 68 | endif |
| 69 | |
Patrick Georgi | 7e9b9d8 | 2012-04-30 21:06:10 +0200 | [diff] [blame] | 70 | ifeq ($(CONFIG_USE_BLOBS),y) |
| 71 | forgetthis:=$(shell git submodule update --init --checkout 3rdparty) |
| 72 | else |
| 73 | ifeq ($(CONFIG_REQUIRES_BLOB),y) |
| 74 | $(error Your current configuration requires binary-only components, but you did not choose to use them) |
| 75 | endif |
| 76 | endif |
| 77 | |
Stefan Reinauer | 24ef134 | 2011-04-14 22:28:00 +0000 | [diff] [blame] | 78 | smm-c-ccopts:=-D__SMM__ |
| 79 | smm-S-ccopts:=-D__SMM__ |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 80 | |
Stefan Reinauer | 3aa067f | 2012-04-02 13:24:04 -0700 | [diff] [blame] | 81 | # SMM TSEG base is dynamic |
| 82 | ifeq ($(CONFIG_SMM_TSEG),y) |
| 83 | smm-c-ccopts += -fpic |
| 84 | endif |
| 85 | |
Patrick Georgi | 57205c7 | 2011-03-08 20:49:18 +0000 | [diff] [blame] | 86 | ramstage-c-deps:=$$(OPTION_TABLE_H) |
| 87 | romstage-c-deps:=$$(OPTION_TABLE_H) |
| 88 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 89 | ####################################################################### |
| 90 | # Add handler to compile ACPI's ASL |
| 91 | define ramstage-objs_asl_template |
Sven Schnelle | d69438e | 2011-03-29 09:01:10 +0000 | [diff] [blame] | 92 | $(obj)/$(1).ramstage.o: src/$(1).asl $(obj)/config.h |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 93 | @printf " IASL $$(subst $(top)/,,$$(@))\n" |
Patrick Georgi | c0e16e7 | 2012-05-05 15:11:22 +0200 | [diff] [blame] | 94 | $(CC) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-y)/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl |
Marc Jones | 2aac3f6 | 2011-08-08 16:07:50 -0600 | [diff] [blame] | 95 | cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$(basename $$@)).asl |
Patrick Georgi | b2a4264 | 2011-06-01 19:54:16 +0000 | [diff] [blame] | 96 | mv $$(basename $$@).hex $$(basename $$@).c |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 97 | $(CC) $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$@).c |
| 98 | # keep %.o: %.c rule from catching the temporary .c file after a make clean |
| 99 | mv $$(basename $$@).c $$(basename $$@).hex |
| 100 | endef |
| 101 | |
| 102 | ####################################################################### |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 103 | # Parse plaintext cmos defaults into binary format |
| 104 | # arg1: source file |
| 105 | # arg2: binary file name |
| 106 | cbfs-files-processor-nvramtool= \ |
| 107 | $(eval $(2): $(1) $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout | $(objutil)/nvramtool/nvramtool ; \ |
| 108 | printf " CREATE $(2) (from $(1))\n"; $(objutil)/nvramtool/nvramtool -y $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout -D $(2).tmp -p $(1) && mv $(2).tmp $(2)) |
| 109 | |
| 110 | ####################################################################### |
Patrick Georgi | 843005c | 2012-04-30 23:15:17 +0200 | [diff] [blame] | 111 | # Link VSA binary to ELF-ish stage |
| 112 | # arg1: source file |
| 113 | # arg2: binary file name |
| 114 | cbfs-files-processor-vsa= \ |
| 115 | $(eval $(2): $(1) ; \ |
| 116 | printf " CREATE $(2) (from $(1))\n"; $(OBJCOPY) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(1) $(2).tmp && $(LD) -m elf_i386 -e 0x60020 --section-start .data=0x60000 $(2).tmp -o $(2)) |
| 117 | |
| 118 | ####################################################################### |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 119 | # Add handler for arbitrary files in CBFS |
| 120 | $(call add-special-class,cbfs-files) |
| 121 | cbfs-files-handler= \ |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 122 | $(eval tmp-cbfs-method:=$(word 2, $(subst :, ,$($(2)-file)))) \ |
| 123 | $(eval $(2)-file:=$(word 1, $(subst :, ,$($(2)-file)))) \ |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 124 | $(if $(wildcard $(1)$($(2)-file)), \ |
| 125 | $(eval tmp-cbfs-file:= $(wildcard $(1)$($(2)-file))), \ |
| 126 | $(eval tmp-cbfs-file:= $($(2)-file))) \ |
Patrick Georgi | 3bbd2bf | 2012-03-09 12:30:07 +0100 | [diff] [blame] | 127 | $(if $(tmp-cbfs-method), \ |
| 128 | $(eval tmp-old-cbfs-file:=$(tmp-cbfs-file)) \ |
| 129 | $(eval tmp-cbfs-file:=$(shell mktemp $(obj)/mainboard/$(MAINBOARDDIR)/cbfs-file.XXXXXX).out) \ |
| 130 | $(call cbfs-files-processor-$(tmp-cbfs-method),$(tmp-old-cbfs-file),$(tmp-cbfs-file))) \ |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 131 | $(eval cbfs-files += $(tmp-cbfs-file)|$(2)|$($(2)-type)|$($(2)-position)) \ |
| 132 | $(eval $(2)-name:=) \ |
| 133 | $(eval $(2)-type:=) \ |
| 134 | $(eval $(2)-position:=) |
| 135 | |
| 136 | ####################################################################### |
| 137 | # a variety of flags for our build |
Sven Schnelle | 8eee19d | 2011-05-02 19:53:04 +0000 | [diff] [blame] | 138 | CBFS_COMPRESS_FLAG:= |
| 139 | ifeq ($(CONFIG_COMPRESS_RAMSTAGE),y) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 140 | CBFS_COMPRESS_FLAG:=l |
Sven Schnelle | 8eee19d | 2011-05-02 19:53:04 +0000 | [diff] [blame] | 141 | endif |
| 142 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 143 | CBFS_PAYLOAD_COMPRESS_FLAG:= |
| 144 | CBFS_PAYLOAD_COMPRESS_NAME:=none |
| 145 | ifeq ($(CONFIG_COMPRESSED_PAYLOAD_LZMA),y) |
| 146 | CBFS_PAYLOAD_COMPRESS_FLAG:=l |
| 147 | CBFS_PAYLOAD_COMPRESS_NAME:=LZMA |
| 148 | endif |
| 149 | |
| 150 | ifneq ($(CONFIG_LOCALVERSION),"") |
| 151 | COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION)) |
| 152 | endif |
| 153 | |
| 154 | INCLUDES := -Isrc -Isrc/include -I$(obj) -Isrc/arch/$(ARCHDIR-y)/include |
| 155 | INCLUDES += -Isrc/devices/oprom/include |
| 156 | # abspath is a workaround for romcc |
Patrick Georgi | c0e16e7 | 2012-05-05 15:11:22 +0200 | [diff] [blame] | 157 | INCLUDES += -include $(src)/include/kconfig.h |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 158 | |
Frank Vibrans | ec40260 | 2011-05-05 16:45:36 +0000 | [diff] [blame] | 159 | CFLAGS = $(INCLUDES) -Os -pipe -g -nostdinc |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 160 | CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes |
| 161 | CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs |
| 162 | CFLAGS += -Wstrict-aliasing -Wshadow |
| 163 | ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y) |
| 164 | CFLAGS += -Werror |
| 165 | endif |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 166 | CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer |
| 167 | |
| 168 | additional-dirs := $(objutil)/cbfstool $(objutil)/romcc $(objutil)/options |
| 169 | |
| 170 | ####################################################################### |
| 171 | # generate build support files |
| 172 | $(obj)/build.h: .xcompile |
| 173 | @printf " GEN build.h\n" |
| 174 | rm -f $(obj)/build.h |
| 175 | printf "/* build system definitions (autogenerated) */\n" > $(obj)/build.ht |
| 176 | printf "#ifndef __BUILD_H\n" >> $(obj)/build.ht |
| 177 | printf "#define __BUILD_H\n\n" >> $(obj)/build.ht |
Patrick Georgi | b8e9ba9 | 2011-03-17 07:47:49 +0000 | [diff] [blame] | 178 | printf "#define COREBOOT_VERSION \"$(KERNELVERSION)\"\n" >> $(obj)/build.ht |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 179 | printf "#define COREBOOT_EXTRA_VERSION \"$(COREBOOT_EXTRA_VERSION)\"\n" >> $(obj)/build.ht |
| 180 | printf "#define COREBOOT_BUILD \"`LANG= date`\"\n" >> $(obj)/build.ht |
Sven Schnelle | 164bcfd | 2011-08-14 20:56:34 +0200 | [diff] [blame] | 181 | printf "#define COREBOOT_DMI_DATE \"`LANG= date +"%m/%d/%Y"`\"\n" >> $(obj)/build.ht |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 182 | printf "\n" >> $(obj)/build.ht |
| 183 | printf "#define COREBOOT_COMPILER \"$(shell LANG= $(CC) --version | head -n1)\"\n" >> $(obj)/build.ht |
| 184 | printf "#define COREBOOT_ASSEMBLER \"$(shell LANG= $(AS) --version | head -n1)\"\n" >> $(obj)/build.ht |
| 185 | printf "#define COREBOOT_LINKER \"$(shell LANG= $(LD) --version | head -n1)\"\n" >> $(obj)/build.ht |
| 186 | printf "#define COREBOOT_COMPILE_TIME \"`LANG= date +%T`\"\n" >> $(obj)/build.ht |
| 187 | printf "#define COREBOOT_COMPILE_BY \"$(subst \,@,$(shell PATH=$$PATH:/usr/ucb whoami))\"\n" >> $(obj)/build.ht |
| 188 | printf "#define COREBOOT_COMPILE_HOST \"$(shell hostname -s 2>/dev/null)\"\n" >> $(obj)/build.ht |
| 189 | printf "#define COREBOOT_COMPILE_DOMAIN \"$(shell test `uname -s` = "Linux" && dnsdomainname || domainname 2>/dev/null)\"\n" >> $(obj)/build.ht |
| 190 | printf "#endif\n" >> $(obj)/build.ht |
| 191 | mv $(obj)/build.ht $(obj)/build.h |
| 192 | |
| 193 | $(obj)/ldoptions: $(obj)/config.h |
| 194 | awk '/^#define ([^"])* ([^"])*$$/ {gsub("\\r","",$$3); print $$2 " = " $$3 ";";}' $< > $@ |
| 195 | |
Kyösti Mälkki | 0db2ae3a | 2012-04-19 12:00:06 +0300 | [diff] [blame] | 196 | build-dirs: |
| 197 | mkdir -p $(objcbfs) $(objgenerated) |
| 198 | |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 199 | ####################################################################### |
| 200 | # Build the tools |
| 201 | CBFSTOOL:=$(obj)/cbfstool |
| 202 | |
| 203 | $(CBFSTOOL): $(objutil)/cbfstool/cbfstool |
| 204 | cp $< $@ |
| 205 | |
| 206 | _WINCHECK=$(shell uname -o 2> /dev/null) |
| 207 | STACK= |
| 208 | ifeq ($(_WINCHECK),Msys) |
| 209 | STACK=-Wl,--stack,16384000 |
| 210 | endif |
| 211 | ifeq ($(_WINCHECK),Cygwin) |
| 212 | STACK=-Wl,--stack,16384000 |
| 213 | endif |
| 214 | |
| 215 | ROMCC:= $(objutil)/romcc/romcc |
| 216 | $(ROMCC): $(top)/util/romcc/romcc.c |
| 217 | @printf " HOSTCC $(subst $(obj)/,,$(@)) (this may take a while)\n" |
| 218 | @# Note: Adding -O2 here might cause problems. For details see: |
| 219 | @# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html |
| 220 | $(HOSTCC) -g $(STACK) -Wall -o $@ $< |
| 221 | |
| 222 | ####################################################################### |
| 223 | # needed objects that every mainboard uses |
| 224 | # Creation of these is architecture and mainboard independent |
| 225 | $(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devicetree.cb $(objutil)/sconfig/sconfig |
| 226 | @printf " SCONFIG $(subst $(src)/,,$(<))\n" |
| 227 | mkdir -p $(obj)/mainboard/$(MAINBOARDDIR) |
| 228 | $(objutil)/sconfig/sconfig $(MAINBOARDDIR) $(obj)/mainboard/$(MAINBOARDDIR) |
| 229 | |
| 230 | ramstage-y+=$(obj)/mainboard/$(MAINBOARDDIR)/static.c |
| 231 | |
| 232 | $(objutil)/%.o: $(objutil)/%.c |
| 233 | @printf " HOSTCC $(subst $(objutil)/,,$(@))\n" |
| 234 | $(HOSTCC) -MMD -I$(subst $(objutil)/,util/,$(dir $<)) -I$(dir $<) $(HOSTCFLAGS) -c -o $@ $< |
| 235 | |
Patrick Georgi | 64ccc3b8 | 2011-05-20 23:08:12 +0000 | [diff] [blame] | 236 | $(obj)/%.ramstage.o $(abspath $(obj))/%.ramstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H) |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 237 | @printf " CC $(subst $(obj)/,,$(@))\n" |
| 238 | $(CC) -MMD $(CFLAGS) -c -o $@ $< |
| 239 | |
| 240 | ####################################################################### |
| 241 | # Clean up rules |
| 242 | clean-abuild: |
| 243 | rm -rf coreboot-builds |
| 244 | |
| 245 | clean-for-update-target: |
| 246 | rm -f $(obj)/coreboot_ram* $(obj)/coreboot.romstage $(obj)/coreboot.pre* $(obj)/coreboot.bootblock $(obj)/coreboot.a |
| 247 | rm -rf $(obj)/bootblock* $(obj)/romstage* $(obj)/location.* |
| 248 | rm -f $(obj)/option_table.* $(obj)/crt0.S $(obj)/ldscript |
| 249 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/static.c $(obj)/mainboard/$(MAINBOARDDIR)/config.py $(obj)/mainboard/$(MAINBOARDDIR)/static.dot |
| 250 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s $(obj)/mainboard/$(MAINBOARDDIR)/crt0.disasm |
| 251 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc |
| 252 | rm -f $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.* $(obj)/mainboard/$(MAINBOARDDIR)/dsdt.* |
| 253 | rm -f $(obj)/cpu/x86/smm/smm_bin.c $(obj)/cpu/x86/smm/smm.* $(obj)/cpu/x86/smm/smm |
Marc Jones | 1dd0dda | 2012-03-19 17:32:33 -0600 | [diff] [blame] | 254 | $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean OUT=$(abspath $(obj)) HOSTCC="$(HOSTCC)" CC="$(CC)" LD="$(LD)" |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 255 | |
| 256 | clean-target: |
| 257 | rm -f $(obj)/coreboot* |
| 258 | |
| 259 | ####################################################################### |
| 260 | # Development utilities |
| 261 | printcrt0s: |
| 262 | @echo crt0s=$(crt0s) |
| 263 | @echo ldscripts=$(ldscripts) |
| 264 | |
| 265 | update: |
| 266 | dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF |
| 267 | |
Patrick Georgi | cb02cb7 | 2012-02-25 19:42:59 +0100 | [diff] [blame] | 268 | lint lint-stable: |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 269 | FAILED=0; LINTLOG=`mktemp`; \ |
Patrick Georgi | cb02cb7 | 2012-02-25 19:42:59 +0100 | [diff] [blame] | 270 | for script in util/lint/$@-*; do \ |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 271 | echo; echo `basename $$script`; \ |
| 272 | grep "^# DESCR:" $$script | sed "s,.*DESCR: *,," ; \ |
| 273 | echo ========; \ |
| 274 | $$script > $$LINTLOG; \ |
Patrick Georgi | c040e476 | 2012-03-09 23:02:09 +0100 | [diff] [blame] | 275 | if [ `cat $$LINTLOG | wc -l` -eq 0 ]; then \ |
Patrick Georgi | 71b8480 | 2011-02-22 14:35:05 +0000 | [diff] [blame] | 276 | printf "success\n\n"; \ |
| 277 | else \ |
| 278 | echo test failed: ; \ |
| 279 | cat $$LINTLOG; \ |
| 280 | rm -f $$LINTLOG; \ |
| 281 | FAILED=$$(( $$FAILED + 1 )); \ |
| 282 | fi; \ |
| 283 | echo ========; \ |
| 284 | done; \ |
| 285 | test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." && exit 1; }; \ |
| 286 | rm -f $$LINTLOG |
Patrick Georgi | 6c44550 | 2011-05-16 15:32:28 +0000 | [diff] [blame] | 287 | |
Patrick Georgi | bb60528 | 2011-06-05 15:15:49 +0200 | [diff] [blame] | 288 | gitconfig: |
Patrick Georgi | 07408e6 | 2012-02-25 19:52:45 +0100 | [diff] [blame] | 289 | for hook in commit-msg pre-commit; do if ! [ -x .git/hooks/$$hook ]; then cp util/gitconfig/$$hook .git/hooks/$$hook; chmod +x .git/hooks/$$hook; fi; done |
Patrick Georgi | bb60528 | 2011-06-05 15:15:49 +0200 | [diff] [blame] | 290 | (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email@example.com\n'; exit 1) |
| 291 | |
Patrick Georgi | 6c44550 | 2011-05-16 15:32:28 +0000 | [diff] [blame] | 292 | crossgcc: clean-for-update |
Peter Stuge | 0b6b4d6 | 2011-06-09 05:06:25 +0200 | [diff] [blame] | 293 | $(MAKE) -C util/crossgcc build-without-gdb |
| 294 | |
| 295 | crosstools: clean-for-update |
Patrick Georgi | 6c44550 | 2011-05-16 15:32:28 +0000 | [diff] [blame] | 296 | $(MAKE) -C util/crossgcc build |
| 297 | |
| 298 | crossgcc-clean: clean-for-update |
| 299 | $(MAKE) -C util/crossgcc clean |
| 300 | |
Patrick Georgi | 43105d6 | 2011-11-05 14:44:41 +0100 | [diff] [blame] | 301 | tools: $(objutil)/kconfig/conf $(objutil)/cbfstool/cbfstool $(objutil)/nvramtool/nvramtool $(objutil)/romcc/romcc $(objutil)/sconfig/sconfig |
| 302 | |