| 1 |
VERSION = 2 |
|---|
| 2 |
PATCHLEVEL = 6 |
|---|
| 3 |
SUBLEVEL = 7 |
|---|
| 4 |
EXTRAVERSION = -kgdb-ringcycle |
|---|
| 5 |
NAME=Zonked Quokka |
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
MAKEFLAGS += --no-print-directory |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
ifdef V |
|---|
| 36 |
ifeq ("$(origin V)", "command line") |
|---|
| 37 |
KBUILD_VERBOSE = $(V) |
|---|
| 38 |
endif |
|---|
| 39 |
endif |
|---|
| 40 |
ifndef KBUILD_VERBOSE |
|---|
| 41 |
KBUILD_VERBOSE = 0 |
|---|
| 42 |
endif |
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
ifdef C |
|---|
| 48 |
ifeq ("$(origin C)", "command line") |
|---|
| 49 |
KBUILD_CHECKSRC = $(C) |
|---|
| 50 |
endif |
|---|
| 51 |
endif |
|---|
| 52 |
ifndef KBUILD_CHECKSRC |
|---|
| 53 |
KBUILD_CHECKSRC = 0 |
|---|
| 54 |
endif |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
ifdef SUBDIRS |
|---|
| 60 |
KBUILD_EXTMOD ?= $(SUBDIRS) |
|---|
| 61 |
endif |
|---|
| 62 |
ifdef M |
|---|
| 63 |
ifeq ("$(origin M)", "command line") |
|---|
| 64 |
KBUILD_EXTMOD := $(M) |
|---|
| 65 |
endif |
|---|
| 66 |
endif |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
ifeq ($(KBUILD_SRC),) |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
ifdef O |
|---|
| 91 |
ifeq ("$(origin O)", "command line") |
|---|
| 92 |
KBUILD_OUTPUT := $(O) |
|---|
| 93 |
endif |
|---|
| 94 |
endif |
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
.PHONY: _all |
|---|
| 98 |
_all: |
|---|
| 99 |
|
|---|
| 100 |
ifneq ($(KBUILD_OUTPUT),) |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
saved-output := $(KBUILD_OUTPUT) |
|---|
| 104 |
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) |
|---|
| 105 |
$(if $(wildcard $(KBUILD_OUTPUT)),, \ |
|---|
| 106 |
$(error output directory "$(saved-output)" does not exist)) |
|---|
| 107 |
|
|---|
| 108 |
.PHONY: $(MAKECMDGOALS) |
|---|
| 109 |
|
|---|
| 110 |
$(filter-out _all,$(MAKECMDGOALS)) _all: |
|---|
| 111 |
$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ |
|---|
| 112 |
KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \ |
|---|
| 113 |
KBUILD_CHECK=$(KBUILD_CHECK) KBUILD_EXTMOD="$(KBUILD_EXTMOD)" \ |
|---|
| 114 |
-f $(CURDIR)/Makefile $@ |
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
skip-makefile := 1 |
|---|
| 118 |
endif |
|---|
| 119 |
endif |
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
ifeq ($(skip-makefile),) |
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
.PHONY: all |
|---|
| 127 |
ifeq ($(KBUILD_EXTMOD),) |
|---|
| 128 |
_all: all |
|---|
| 129 |
else |
|---|
| 130 |
_all: modules |
|---|
| 131 |
endif |
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
ifdef LC_ALL |
|---|
| 136 |
LANG := $(LC_ALL) |
|---|
| 137 |
LC_ALL := |
|---|
| 138 |
endif |
|---|
| 139 |
LC_COLLATE := C |
|---|
| 140 |
LC_CTYPE := C |
|---|
| 141 |
export LANG LC_ALL LC_COLLATE LC_CTYPE |
|---|
| 142 |
|
|---|
| 143 |
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) |
|---|
| 144 |
TOPDIR := $(srctree) |
|---|
| 145 |
|
|---|
| 146 |
objtree := $(CURDIR) |
|---|
| 147 |
src := $(srctree) |
|---|
| 148 |
obj := $(objtree) |
|---|
| 149 |
|
|---|
| 150 |
VPATH := $(srctree) |
|---|
| 151 |
|
|---|
| 152 |
export srctree objtree VPATH TOPDIR |
|---|
| 153 |
|
|---|
| 154 |
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ |
|---|
| 163 |
-e s/arm.*/arm/ -e s/sa110/arm/ \ |
|---|
| 164 |
-e s/s390x/s390/ -e s/parisc64/parisc/ ) |
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
ARCH ?= $(SUBARCH) |
|---|
| 186 |
CROSS_COMPILE ?= |
|---|
| 187 |
|
|---|
| 188 |
|
|---|
| 189 |
UTS_MACHINE := $(ARCH) |
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ |
|---|
| 193 |
|
|---|
| 194 |
) |
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
HOSTCC = gcc32 |
|---|
| 198 |
HOSTCXX = g++-3.3 |
|---|
| 199 |
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer |
|---|
| 200 |
HOSTCXXFLAGS = -O2 |
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
KBUILD_MODULES := |
|---|
| 206 |
KBUILD_BUILTIN := 1 |
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 |
ifeq ($(MAKECMDGOALS),modules) |
|---|
| 214 |
KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) |
|---|
| 215 |
endif |
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
ifneq ($(filter all _all modules,$(MAKECMDGOALS)),) |
|---|
| 222 |
KBUILD_MODULES := 1 |
|---|
| 223 |
endif |
|---|
| 224 |
|
|---|
| 225 |
ifeq ($(MAKECMDGOALS),) |
|---|
| 226 |
KBUILD_MODULES := 1 |
|---|
| 227 |
endif |
|---|
| 228 |
|
|---|
| 229 |
export KBUILD_MODULES KBUILD_BUILTIN KBUILD_VERBOSE |
|---|
| 230 |
export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD |
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
|
|---|
| 238 |
|
|---|
| 239 |
|
|---|
| 240 |
|
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 |
|
|---|
| 248 |
|
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 |
ifeq ($(KBUILD_VERBOSE),1) |
|---|
| 256 |
quiet = |
|---|
| 257 |
Q = |
|---|
| 258 |
else |
|---|
| 259 |
quiet=quiet_ |
|---|
| 260 |
Q = @ |
|---|
| 261 |
endif |
|---|
| 262 |
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
ifneq ($(findstring s,$(MAKEFLAGS)),) |
|---|
| 267 |
quiet=silent_ |
|---|
| 268 |
endif |
|---|
| 269 |
|
|---|
| 270 |
check_gcc = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) |
|---|
| 271 |
|
|---|
| 272 |
export quiet Q KBUILD_VERBOSE check_gcc |
|---|
| 273 |
|
|---|
| 274 |
|
|---|
| 275 |
MAKEFLAGS += --include-dir=$(srctree) |
|---|
| 276 |
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
|
|---|
| 281 |
|
|---|
| 282 |
|
|---|
| 283 |
|
|---|
| 284 |
AS = $(CROSS_COMPILE)as |
|---|
| 285 |
LD = $(CROSS_COMPILE)ld |
|---|
| 286 |
CC = $(CROSS_COMPILE)gcc32 |
|---|
| 287 |
CPP = $(CC) -E |
|---|
| 288 |
AR = $(CROSS_COMPILE)ar |
|---|
| 289 |
NM = $(CROSS_COMPILE)nm |
|---|
| 290 |
STRIP = $(CROSS_COMPILE)strip |
|---|
| 291 |
OBJCOPY = $(CROSS_COMPILE)objcopy |
|---|
| 292 |
OBJDUMP = $(CROSS_COMPILE)objdump |
|---|
| 293 |
AWK = awk |
|---|
| 294 |
RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ |
|---|
| 295 |
else echo rpm; fi) |
|---|
| 296 |
GENKSYMS = scripts/genksyms/genksyms |
|---|
| 297 |
DEPMOD = /sbin/depmod |
|---|
| 298 |
KALLSYMS = scripts/kallsyms |
|---|
| 299 |
PERL = perl |
|---|
| 300 |
CHECK = sparse |
|---|
| 301 |
MODFLAGS = -DMODULE |
|---|
| 302 |
CFLAGS_MODULE = $(MODFLAGS) |
|---|
| 303 |
AFLAGS_MODULE = $(MODFLAGS) |
|---|
| 304 |
LDFLAGS_MODULE = -r |
|---|
| 305 |
CFLAGS_KERNEL = |
|---|
| 306 |
AFLAGS_KERNEL = |
|---|
| 307 |
|
|---|
| 308 |
NOSTDINC_FLAGS = -nostdinc -iwithprefix include |
|---|
| 309 |
|
|---|
| 310 |
CPPFLAGS := -D__KERNEL__ -Iinclude \ |
|---|
| 311 |
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) |
|---|
| 312 |
|
|---|
| 313 |
CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ |
|---|
| 314 |
-fno-strict-aliasing -fno-common |
|---|
| 315 |
AFLAGS := -D__ASSEMBLY__ |
|---|
| 316 |
|
|---|
| 317 |
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ |
|---|
| 318 |
CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ |
|---|
| 319 |
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ |
|---|
| 320 |
HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK |
|---|
| 321 |
|
|---|
| 322 |
export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS |
|---|
| 323 |
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE |
|---|
| 324 |
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
|---|
| 325 |
|
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 |
export MODVERDIR := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_versions |
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 |
|
|---|
| 333 |
comma := , |
|---|
| 334 |
depfile = $(subst $(comma),_,$(@D)/.$(@F).d) |
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 |
|
|---|
| 338 |
RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \) -prune -o |
|---|
| 339 |
RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS |
|---|
| 340 |
|
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
.PHONY: scripts_basic |
|---|
| 346 |
scripts_basic: |
|---|
| 347 |
$(Q)$(MAKE) $(build)=scripts/basic |
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 |
|
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
no-dot-config-targets := clean mrproper distclean \ |
|---|
| 358 |
cscope TAGS tags help %docs check% |
|---|
| 359 |
|
|---|
| 360 |
config-targets := 0 |
|---|
| 361 |
mixed-targets := 0 |
|---|
| 362 |
dot-config := 1 |
|---|
| 363 |
|
|---|
| 364 |
ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),) |
|---|
| 365 |
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),) |
|---|
| 366 |
dot-config := 0 |
|---|
| 367 |
endif |
|---|
| 368 |
endif |
|---|
| 369 |
|
|---|
| 370 |
ifeq ($(KBUILD_EXTMOD),) |
|---|
| 371 |
ifneq ($(filter config %config,$(MAKECMDGOALS)),) |
|---|
| 372 |
config-targets := 1 |
|---|
| 373 |
ifneq ($(filter-out config %config,$(MAKECMDGOALS)),) |
|---|
| 374 |
mixed-targets := 1 |
|---|
| 375 |
endif |
|---|
| 376 |
endif |
|---|
| 377 |
endif |
|---|
| 378 |
|
|---|
| 379 |
ifeq ($(mixed-targets),1) |
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
%:: FORCE |
|---|
| 385 |
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@ |
|---|
| 386 |
|
|---|
| 387 |
else |
|---|
| 388 |
ifeq ($(config-targets),1) |
|---|
| 389 |
|
|---|
| 390 |
|
|---|
| 391 |
|
|---|
| 392 |
|
|---|
| 393 |
config: scripts_basic FORCE |
|---|
| 394 |
$(Q)$(MAKE) $(build)=scripts/kconfig $@ |
|---|
| 395 |
%config: scripts_basic FORCE |
|---|
| 396 |
$(Q)$(MAKE) $(build)=scripts/kconfig $@ |
|---|
| 397 |
|
|---|
| 398 |
else |
|---|
| 399 |
|
|---|
| 400 |
|
|---|
| 401 |
|
|---|
| 402 |
|
|---|
| 403 |
ifeq ($(KBUILD_EXTMOD),) |
|---|
| 404 |
|
|---|
| 405 |
|
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 |
|
|---|
| 409 |
.PHONY: scripts |
|---|
| 410 |
scripts: scripts_basic include/config/MARKER |
|---|
| 411 |
$(Q)$(MAKE) $(build)=$(@) |
|---|
| 412 |
|
|---|
| 413 |
scripts_basic: include/linux/autoconf.h |
|---|
| 414 |
|
|---|
| 415 |
|
|---|
| 416 |
|
|---|
| 417 |
|
|---|
| 418 |
|
|---|
| 419 |
|
|---|
| 420 |
all: vmlinux |
|---|
| 421 |
|
|---|
| 422 |
|
|---|
| 423 |
init-y := init/ |
|---|
| 424 |
drivers-y := drivers/ sound/ |
|---|
| 425 |
net-y := net/ |
|---|
| 426 |
libs-y := lib/ |
|---|
| 427 |
core-y := usr/ |
|---|
| 428 |
endif |
|---|
| 429 |
|
|---|
| 430 |
ifeq ($(dot-config),1) |
|---|
| 431 |
|
|---|
| 432 |
|
|---|
| 433 |
|
|---|
| 434 |
|
|---|
| 435 |
-include .config.cmd |
|---|
| 436 |
|
|---|
| 437 |
include .config |
|---|
| 438 |
|
|---|
| 439 |
|
|---|
| 440 |
|
|---|
| 441 |
|
|---|
| 442 |
.config: ; |
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 |
|
|---|
| 446 |
include/linux/autoconf.h: .config |
|---|
| 447 |
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig |
|---|
| 448 |
else |
|---|
| 449 |
|
|---|
| 450 |
include/linux/autoconf.h: ; |
|---|
| 451 |
endif |
|---|
| 452 |
|
|---|
| 453 |
include $(srctree)/arch/$(ARCH)/Makefile |
|---|
| 454 |
|
|---|
| 455 |
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE |
|---|
| 456 |
CFLAGS += -Os |
|---|
| 457 |
else |
|---|
| 458 |
CFLAGS += -O2 |
|---|
| 459 |
endif |
|---|
| 460 |
|
|---|
| 461 |
ifndef CONFIG_FRAME_POINTER |
|---|
| 462 |
CFLAGS += -fomit-frame-pointer |
|---|
| 463 |
else |
|---|
| 464 |
CFLAGS += -fno-omit-frame-pointer |
|---|
| 465 |
endif |
|---|
| 466 |
|
|---|
| 467 |
ifdef CONFIG_DEBUG_INFO |
|---|
| 468 |
CFLAGS += -g |
|---|
| 469 |
endif |
|---|
| 470 |
|
|---|
| 471 |
|
|---|
| 472 |
CFLAGS += $(call check_gcc,-Wdeclaration-after-statement,) |
|---|
| 473 |
|
|---|
| 474 |
|
|---|
| 475 |
|
|---|
| 476 |
|
|---|
| 477 |
|
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 |
MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
|---|
| 488 |
export MODLIB |
|---|
| 489 |
|
|---|
| 490 |
|
|---|
| 491 |
ifeq ($(KBUILD_EXTMOD),) |
|---|
| 492 |
core-y += kernel/ mm/ fs/ ipc/ security/ crypto/ |
|---|
| 493 |
|
|---|
| 494 |
vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ |
|---|
| 495 |
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \ |
|---|
| 496 |
$(net-y) $(net-m) $(libs-y) $(libs-m))) |
|---|
| 497 |
|
|---|
| 498 |
vmlinux-alldirs := $(sort $(vmlinux-dirs) $(patsubst %/,%,$(filter %/, \ |
|---|
| 499 |
$(init-n) $(init-) \ |
|---|
| 500 |
$(core-n) $(core-) $(drivers-n) $(drivers-) \ |
|---|
| 501 |
$(net-n) $(net-) $(libs-n) $(libs-)))) |
|---|
| 502 |
|
|---|
| 503 |
init-y := $(patsubst %/, %/built-in.o, $(init-y)) |
|---|
| 504 |
core-y := $(patsubst %/, %/built-in.o, $(core-y)) |
|---|
| 505 |
drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y)) |
|---|
| 506 |
net-y := $(patsubst %/, %/built-in.o, $(net-y)) |
|---|
| 507 |
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) |
|---|
| 508 |
libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) |
|---|
| 509 |
libs-y := $(libs-y1) $(libs-y2) |
|---|
| 510 |
|
|---|
| 511 |
|
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 |
|
|---|
| 518 |
|
|---|
| 519 |
|
|---|
| 520 |
|
|---|
| 521 |
head-y += $(HEAD) |
|---|
| 522 |
vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y) |
|---|
| 523 |
|
|---|
| 524 |
quiet_cmd_vmlinux__ = LD $@ |
|---|
| 525 |
define cmd_vmlinux__ |
|---|
| 526 |
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(head-y) $(init-y) \ |
|---|
| 527 |
--start-group \ |
|---|
| 528 |
$(core-y) \ |
|---|
| 529 |
$(libs-y) \ |
|---|
| 530 |
$(drivers-y) \ |
|---|
| 531 |
$(net-y) \ |
|---|
| 532 |
--end-group \ |
|---|
| 533 |
$(filter .tmp_kallsyms%,$^) \ |
|---|
| 534 |
-o $@ |
|---|
| 535 |
endef |
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 |
define rule_vmlinux__ |
|---|
| 540 |
+set -e; \ |
|---|
| 541 |
$(if $(filter .tmp_kallsyms%,$^),, \ |
|---|
| 542 |
echo ' GEN .version'; \ |
|---|
| 543 |
. $(srctree)/scripts/mkversion > .tmp_version; \ |
|---|
| 544 |
mv -f .tmp_version .version; \ |
|---|
| 545 |
$(MAKE) $(build)=init; \ |
|---|
| 546 |
) \ |
|---|
| 547 |
$(if $($(quiet)cmd_vmlinux__), \ |
|---|
| 548 |
echo ' $($(quiet)cmd_vmlinux__)' &&) \ |
|---|
| 549 |
$(cmd_vmlinux__); \ |
|---|
| 550 |
echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd |
|---|
| 551 |
endef |
|---|
| 552 |
|
|---|
| 553 |
define rule_vmlinux |
|---|
| 554 |
$(rule_vmlinux__); \ |
|---|
| 555 |
$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map |
|---|
| 556 |
endef |
|---|
| 557 |
|
|---|
| 558 |
LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s |
|---|
| 559 |
|
|---|
| 560 |
|
|---|
| 561 |
|
|---|
| 562 |
|
|---|
| 563 |
|
|---|
| 564 |
|
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 |
|
|---|
| 568 |
|
|---|
| 569 |
|
|---|
| 570 |
|
|---|
| 571 |
ifdef CONFIG_KALLSYMS |
|---|
| 572 |
|
|---|
| 573 |
kallsyms.o := .tmp_kallsyms2.o |
|---|
| 574 |
|
|---|
| 575 |
quiet_cmd_kallsyms = KSYM $@ |
|---|
| 576 |
cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) $(foreach x,$(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ |
|---|
| 577 |
|
|---|
| 578 |
.tmp_kallsyms1.o .tmp_kallsyms2.o: %.o: %.S scripts FORCE |
|---|
| 579 |
$(call if_changed_dep,as_o_S) |
|---|
| 580 |
|
|---|
| 581 |
.tmp_kallsyms%.S: .tmp_vmlinux% |
|---|
| 582 |
$(call cmd,kallsyms) |
|---|
| 583 |
|
|---|
| 584 |
.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE |
|---|
| 585 |
+$(call if_changed_rule,vmlinux__) |
|---|
| 586 |
|
|---|
| 587 |
.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE |
|---|
| 588 |
$(call if_changed_rule,vmlinux__) |
|---|
| 589 |
|
|---|
| 590 |
endif |
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| 593 |
|
|---|
| 594 |
vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE |
|---|
| 595 |
$(call if_changed_rule,vmlinux) |
|---|
| 596 |
|
|---|
| 597 |
|
|---|
| 598 |
|
|---|
| 599 |
|
|---|
| 600 |
$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; |
|---|
| 601 |
|
|---|
| 602 |
|
|---|
| 603 |
|
|---|
| 604 |
.PHONY: $(vmlinux-dirs) |
|---|
| 605 |
$(vmlinux-dirs): prepare-all scripts |
|---|
| 606 |
$(Q)$(MAKE) $(build)=$@ |
|---|
| 607 |
|
|---|
| 608 |
|
|---|
| 609 |
|
|---|
| 610 |
|
|---|
| 611 |
|
|---|
| 612 |
|
|---|
| 613 |
.PHONY: prepare-all prepare prepare0 prepare1 |
|---|
| 614 |
|
|---|
| 615 |
|
|---|
| 616 |
|
|---|
| 617 |
|
|---|
| 618 |
|
|---|
| 619 |
|
|---|
| 620 |
prepare1: |
|---|
| 621 |
ifneq ($(KBUILD_SRC),) |
|---|
| 622 |
@echo ' Using $(srctree) as source for kernel' |
|---|
| 623 |
$(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \ |
|---|
| 624 |
echo " $(srctree) is not clean, please run 'make mrproper'";\ |
|---|
| 625 |
echo " in the '$(srctree)' directory.";\ |
|---|
| 626 |
/bin/false; \ |
|---|
| 627 |
fi; |
|---|
| 628 |
$(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; |
|---|
| 629 |
$(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm |
|---|
| 630 |
endif |
|---|
| 631 |
|
|---|
| 632 |
prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER |
|---|
| 633 |
ifneq ($(KBUILD_MODULES),) |
|---|
| 634 |
$(Q)rm -rf $(MODVERDIR) |
|---|
| 635 |
$(Q)mkdir -p $(MODVERDIR) |
|---|
| 636 |
endif |
|---|
| 637 |
|
|---|
| 638 |
|
|---|
| 639 |
prepare-all: prepare0 prepare |
|---|
| 640 |
|
|---|
| 641 |
|
|---|
| 642 |
|
|---|
| 643 |
|
|---|
| 644 |
export AFLAGS_vmlinux.lds.o += -P -C -U$(ARCH) |
|---|
| 645 |
|
|---|
| 646 |
|
|---|
| 647 |
|
|---|
| 648 |
|
|---|
| 649 |
%.s: %.c scripts FORCE |
|---|
| 650 |
$(Q)$(MAKE) $(build)=$(@D) $@ |
|---|
| 651 |
%.i: %.c scripts FORCE |
|---|
| 652 |
$(Q)$(MAKE) $(build)=$(@D) $@ |
|---|
| 653 |
%.o: %.c scripts FORCE |
|---|
| 654 |
$(Q)$(MAKE) $(build)=$(@D) $@ |
|---|
| 655 |
%/: scripts prepare FORCE |
|---|
| 656 |
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) |
|---|
| 657 |
%.lst: %.c scripts FORCE |
|---|
| 658 |
$(Q)$(MAKE) $(build)=$(@D) $@ |
|---|
| 659 |
%.s: %.S scripts FORCE |
|---|
| 660 |
$(Q)$(MAKE) $(build)=$(@D) $@ |
|---|
| 661 |
%.o: %.S scripts FORCE |
|---|
| 662 |
$(Q)$(MAKE) $(build)=$(@D) $@ |
|---|
| 663 |
|
|---|
| 664 |
|
|---|
| 665 |
|
|---|
| 666 |
|
|---|
| 667 |
|
|---|
| 668 |
include/asm: |
|---|
| 669 |
@echo ' SYMLINK $@ -> include/asm-$(ARCH)' |
|---|
| 670 |
$(Q)if [ ! -d include ]; then mkdir -p include; fi; |
|---|
| 671 |
@ln -fsn asm-$(ARCH) $@ |
|---|
| 672 |
|
|---|
| 673 |
|
|---|
| 674 |
|
|---|
| 675 |
include/config/MARKER: include/linux/autoconf.h |
|---|
| 676 |
@echo ' SPLIT include/linux/autoconf.h -> include/config/*' |
|---|
| 677 |
@scripts/basic/split-include include/linux/autoconf.h include/config |
|---|
| 678 |
@touch $@ |
|---|
| 679 |
|
|---|
| 680 |
|
|---|
| 681 |
|
|---|
| 682 |
|
|---|
| 683 |
|
|---|
| 684 |
|
|---|
| 685 |
|
|---|
| 686 |
uts_len := 64 |
|---|
| 687 |
|
|---|
| 688 |
define filechk_version.h |
|---|
| 689 |
if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ |
|---|
| 690 |
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ |
|---|
| 691 |
exit 1; \ |
|---|
| 692 |
fi; \ |
|---|
| 693 |
(echo \ |
|---|
| 694 |
echo \ |
|---|
| 695 |
echo ' |
|---|
| 696 |
) |
|---|
| 697 |
endef |
|---|
| 698 |
|
|---|
| 699 |
include/linux/version.h: Makefile |
|---|
| 700 |
$(call filechk,version.h) |
|---|
| 701 |
|
|---|
| 702 |
|
|---|
| 703 |
|
|---|
| 704 |
.PHONY: depend dep |
|---|
| 705 |
depend dep: |
|---|
| 706 |
@echo '*** Warning: make $@ is unnecessary now.' |
|---|
| 707 |
|
|---|
| 708 |
|
|---|
| 709 |
|
|---|
| 710 |
|
|---|
| 711 |
ifdef CONFIG_MODULES |
|---|
| 712 |
|
|---|
| 713 |
|
|---|
| 714 |
|
|---|
| 715 |
all: modules |
|---|
| 716 |
|
|---|
| 717 |
|
|---|
| 718 |
|
|---|
| 719 |
.PHONY: modules |
|---|
| 720 |
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) |
|---|
| 721 |
@echo ' Building modules, stage 2.'; |
|---|
| 722 |
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost |
|---|
| 723 |
|
|---|
| 724 |
|
|---|
| 725 |
|
|---|
| 726 |
.PHONY: modules_prepare |
|---|
| 727 |
modules_prepare: prepare-all scripts |
|---|
| 728 |
|
|---|
| 729 |
|
|---|
| 730 |
.PHONY: modules_install |
|---|
| 731 |
modules_install: _modinst_ _modinst_post |
|---|
| 732 |
|
|---|
| 733 |
.PHONY: _modinst_ |
|---|
| 734 |
_modinst_: |
|---|
| 735 |
@if [ -z "`$(DEPMOD) -V | grep module-init-tools`" ]; then \ |
|---|
| 736 |
echo "Warning: you may need to install module-init-tools"; \ |
|---|
| 737 |
echo "See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt";\ |
|---|
| 738 |
sleep 1; \ |
|---|
| 739 |
fi |
|---|
| 740 |
@rm -rf $(MODLIB)/kernel |
|---|
| 741 |
@rm -f $(MODLIB)/build |
|---|
| 742 |
@mkdir -p $(MODLIB)/kernel |
|---|
| 743 |
@ln -s $(TOPDIR) $(MODLIB)/build |
|---|
| 744 |
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst |
|---|
| 745 |
|
|---|
| 746 |
|
|---|
| 747 |
|
|---|
| 748 |
|
|---|
| 749 |
|
|---|
| 750 |
|
|---|
| 751 |
ifeq "$(strip $(INSTALL_MOD_PATH))" "" |
|---|
| 752 |
depmod_opts := |
|---|
| 753 |
else |
|---|
| 754 |
depmod_opts := -b $(INSTALL_MOD_PATH) -r |
|---|
| 755 |
endif |
|---|
| 756 |
.PHONY: _modinst_post |
|---|
| 757 |
_modinst_post: _modinst_ |
|---|
| 758 |
if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi |
|---|
| 759 |
|
|---|
| 760 |
else |
|---|
| 761 |
|
|---|
| 762 |
|
|---|
| 763 |
|
|---|
| 764 |
|
|---|
| 765 |
modules modules_install: FORCE |
|---|
| 766 |
@echo |
|---|
| 767 |
@echo "The present kernel configuration has modules disabled." |
|---|
| 768 |
@echo "Type 'make config' and enable loadable module support." |
|---|
| 769 |
@echo "Then build a kernel with module support enabled." |
|---|
| 770 |
@echo |
|---|
| 771 |
@exit 1 |
|---|
| 772 |
|
|---|
| 773 |
endif |
|---|
| 774 |
|
|---|
| 775 |
|
|---|
| 776 |
|
|---|
| 777 |
|
|---|
| 778 |
define filechk_gen-asm-offsets |
|---|
| 779 |
(set -e; \ |
|---|
| 780 |
echo "#ifndef __ASM_OFFSETS_H__"; \ |
|---|
| 781 |
echo "#define __ASM_OFFSETS_H__"; \ |
|---|
| 782 |
echo "/*"; \ |
|---|
| 783 |
echo " * DO NOT MODIFY."; \ |
|---|
| 784 |
echo " *"; \ |
|---|
| 785 |
echo " * This file was generated by arch/$(ARCH)/Makefile"; \ |
|---|
| 786 |
echo " *"; \ |
|---|
| 787 |
echo " */"; \ |
|---|
| 788 |
echo ""; \ |
|---|
| 789 |
sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ |
|---|
| 790 |
echo ""; \ |
|---|
| 791 |
echo "#endif" ) |
|---|
| 792 |
endef |
|---|
| 793 |
|
|---|
| 794 |
|
|---|
| 795 |
|
|---|
| 796 |
|
|---|
| 797 |
|
|---|
| 798 |
|
|---|
| 799 |
|
|---|
| 800 |
|
|---|
| 801 |
|
|---|
| 802 |
|
|---|
| 803 |
CLEAN_DIRS += $(MODVERDIR) |
|---|
| 804 |
CLEAN_FILES += vmlinux System.map kernel.spec \ |
|---|
| 805 |
.tmp_kallsyms* .tmp_version .tmp_vmlinux* |
|---|
| 806 |
|
|---|
| 807 |
|
|---|
| 808 |
MRPROPER_DIRS += include/config include2 |
|---|
| 809 |
MRPROPER_FILES += .config .config.old include/asm .version \ |
|---|
| 810 |
include/linux/autoconf.h include/linux/version.h \ |
|---|
| 811 |
Module.symvers tags TAGS cscope* |
|---|
| 812 |
|
|---|
| 813 |
|
|---|
| 814 |
|
|---|
| 815 |
clean: rm-dirs := $(CLEAN_DIRS) |
|---|
| 816 |
clean: rm-files := $(CLEAN_FILES) |
|---|
| 817 |
clean-dirs := $(addprefix _clean_,$(vmlinux-alldirs)) |
|---|
| 818 |
|
|---|
| 819 |
.PHONY: $(clean-dirs) clean archclean |
|---|
| 820 |
$(clean-dirs): |
|---|
| 821 |
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) |
|---|
| 822 |
|
|---|
| 823 |
clean: archclean $(clean-dirs) |
|---|
| 824 |
$(call cmd,rmdirs) |
|---|
| 825 |
$(call cmd,rmfiles) |
|---|
| 826 |
@find . $(RCS_FIND_IGNORE) \ |
|---|
| 827 |
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
|---|
| 828 |
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ |
|---|
| 829 |
-type f -print | xargs rm -f |
|---|
| 830 |
|
|---|
| 831 |
|
|---|
| 832 |
|
|---|
| 833 |
mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS)) |
|---|
| 834 |
mrproper: rm-files := $(wildcard $(MRPROPER_FILES)) |
|---|
| 835 |
mrproper-dirs := $(addprefix _mrproper_,Documentation/DocBook scripts) |
|---|
| 836 |
|
|---|
| 837 |
.PHONY: $(mrproper-dirs) mrproper archmrproper |
|---|
| 838 |
$(mrproper-dirs): |
|---|
| 839 |
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@) |
|---|
| 840 |
|
|---|
| 841 |
mrproper: clean archmrproper $(mrproper-dirs) |
|---|
| 842 |
$(call cmd,rmdirs) |
|---|
| 843 |
$(call cmd,rmfiles) |
|---|
| 844 |
|
|---|
| 845 |
|
|---|
| 846 |
|
|---|
| 847 |
.PHONY: distclean |
|---|
| 848 |
|
|---|
| 849 |
distclean: mrproper |
|---|
| 850 |
@find . $(RCS_FIND_IGNORE) \ |
|---|
| 851 |
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \ |
|---|
| 852 |
-o -name '*.bak' -o -name ' |
|---|
| 853 |
-o -name '.*.rej' -o -size 0 \ |
|---|
| 854 |
-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ |
|---|
| 855 |
-type f -print | xargs rm -f |
|---|
| 856 |
|
|---|
| 857 |
|
|---|
| 858 |
|
|---|
| 859 |
|
|---|
| 860 |
.PHONY: rpm |
|---|
| 861 |
|
|---|
| 862 |
|
|---|
| 863 |
KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE)) |
|---|
| 864 |
|
|---|
| 865 |
|
|---|
| 866 |
|
|---|
| 867 |
spec: |
|---|
| 868 |
$(CONFIG_SHELL) $(srctree)/scripts/mkspec > $(objtree)/kernel.spec |
|---|
| 869 |
|
|---|
| 870 |
|
|---|
| 871 |
|
|---|