| 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 |
|
|---|
| 872 |
|
|---|
| 873 |
|
|---|
| 874 |
|
|---|
| 875 |
rpm: clean spec |
|---|
| 876 |
set -e; \ |
|---|
| 877 |
cd .. ; \ |
|---|
| 878 |
ln -sf $(srctree) $(KERNELPATH) ; \ |
|---|
| 879 |
tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \ |
|---|
| 880 |
rm $(KERNELPATH) |
|---|
| 881 |
|
|---|
| 882 |
set -e; \ |
|---|
| 883 |
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version;\ |
|---|
| 884 |
mv -f $(objtree)/.tmp_version $(objtree)/.version; |
|---|
| 885 |
|
|---|
| 886 |
$(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz |
|---|
| 887 |
rm ../$(KERNELPATH).tar.gz |
|---|
| 888 |
|
|---|
| 889 |
|
|---|
| 890 |
|
|---|
| 891 |
|
|---|
| 892 |
boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig) |
|---|
| 893 |
boards := $(notdir $(boards)) |
|---|
| 894 |
|
|---|
| 895 |
help: |
|---|
| 896 |
@echo 'Cleaning targets:' |
|---|
| 897 |
@echo ' clean - remove most generated files but keep the config' |
|---|
| 898 |
@echo ' mrproper - remove all generated files + config + various backup files' |
|---|
| 899 |
@echo '' |
|---|
| 900 |
@echo 'Configuration targets:' |
|---|
| 901 |
@$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help |
|---|
| 902 |
@echo '' |
|---|
| 903 |
@echo 'Other generic targets:' |
|---|
| 904 |
@echo ' all - Build all targets marked with [*]' |
|---|
| 905 |
@echo '* vmlinux - Build the bare kernel' |
|---|
| 906 |
@echo '* modules - Build all modules' |
|---|
| 907 |
@echo ' modules_install - Install all modules' |
|---|
| 908 |
@echo ' dir/ - Build all files in dir and below' |
|---|
| 909 |
@echo ' dir/file.[ois] - Build specified target only' |
|---|
| 910 |
@echo ' rpm - Build a kernel as an RPM package' |
|---|
| 911 |
@echo ' tags/TAGS - Generate tags file for editors' |
|---|
| 912 |
@echo ' cscope - Generate cscope index' |
|---|
| 913 |
@echo ' checkstack - Generate a list of stack hogs' |
|---|
| 914 |
@echo '' |
|---|
| 915 |
@echo 'Documentation targets:' |
|---|
| 916 |
@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp |
|---|
| 917 |
@echo '' |
|---|
| 918 |
@echo 'Architecture specific targets ($(ARCH)):' |
|---|
| 919 |
@$(if $(archhelp),$(archhelp),\ |
|---|
| 920 |
echo ' No architecture specific help defined for $(ARCH)') |
|---|
| 921 |
@echo '' |
|---|
| 922 |
@$(if $(boards), \ |
|---|
| 923 |
$(foreach b, $(boards), \ |
|---|
| 924 |
printf " %-24s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \ |
|---|
| 925 |
echo '') |
|---|
| 926 |
|
|---|
| 927 |
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' |
|---|
| 928 |
@echo ' make O=dir [targets] Locate all output files in "dir", including .config' |
|---|
| 929 |
@echo ' make C=1 [targets] Check all c source with checker tool' |
|---|
| 930 |
@echo '' |
|---|
| 931 |
@echo 'Execute "make" or "make all" to build all targets marked with [*] ' |
|---|
| 932 |
@echo 'For further info see the ./README file' |
|---|
| 933 |
|
|---|
| 934 |
|
|---|
| 935 |
|
|---|
| 936 |
|
|---|
| 937 |
%docs: scripts_basic FORCE |
|---|
| 938 |
$(Q)$(MAKE) $(build)=Documentation/DocBook $@ |
|---|
| 939 |
|
|---|
| 940 |
else |
|---|
| 941 |
|
|---|
| 942 |
|
|---|
| 943 |
|
|---|
| 944 |
|
|---|
| 945 |
|
|---|
| 946 |
|
|---|
| 947 |
|
|---|
| 948 |
|
|---|
| 949 |
|
|---|
| 950 |
|
|---|
| 951 |
|
|---|
| 952 |
|
|---|
| 953 |
|
|---|
| 954 |
|
|---|
| 955 |
|
|---|
| 956 |
|
|---|
| 957 |
|
|---|
| 958 |
|
|---|
| 959 |
|
|---|
| 960 |
KBUILD_MODULES := 1 |
|---|
| 961 |
.PHONY: crmodverdir |
|---|
| 962 |
crmodverdir: |
|---|
| 963 |
$(Q)mkdir -p $(MODVERDIR) |
|---|
| 964 |
|
|---|
| 965 |
module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) |
|---|
| 966 |
.PHONY: $(module-dirs) modules |
|---|
| 967 |
$(module-dirs): crmodverdir |
|---|
| 968 |
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) |
|---|
| 969 |
|
|---|
| 970 |
modules: $(module-dirs) |
|---|
| 971 |
@echo ' Building modules, stage 2.'; |
|---|
| 972 |
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost |
|---|
| 973 |
|
|---|
| 974 |
.PHONY: modules_install |
|---|
| 975 |
modules_install: |
|---|
| 976 |
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst |
|---|
| 977 |
|
|---|
| 978 |
clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD)) |
|---|
| 979 |
|
|---|
| 980 |
.PHONY: $(clean-dirs) clean |
|---|
| 981 |
$(clean-dirs): |
|---|
| 982 |
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) |
|---|
| 983 |
|
|---|
| 984 |
clean: rm-dirs := $(MODVERDIR) |
|---|
| 985 |
clean: $(clean-dirs) |
|---|
| 986 |
$(call cmd,rmdirs) |
|---|
| 987 |
@find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ |
|---|
| 988 |
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ |
|---|
| 989 |
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \ |
|---|
| 990 |
-type f -print | xargs rm -f |
|---|
| 991 |
|
|---|
| 992 |
help: |
|---|
| 993 |
@echo ' Building external modules.' |
|---|
| 994 |
@echo ' Syntax: make -C path/to/kernel/src M=$$PWD target' |
|---|
| 995 |
@echo '' |
|---|
| 996 |
@echo ' modules - default target, build the module(s)' |
|---|
| 997 |
@echo ' modules_install - install the module' |
|---|
| 998 |
@echo ' clean - remove generated files in module directory only' |
|---|
| 999 |
@echo '' |
|---|
| 1000 |
endif |
|---|
| 1001 |
|
|---|
| 1002 |
|
|---|
| 1003 |
|
|---|
| 1004 |
|
|---|
| 1005 |
define all-sources |
|---|
| 1006 |
( find . $(RCS_FIND_IGNORE) \ |
|---|
| 1007 |
\( -name include -o -name arch \) -prune -o \ |
|---|
| 1008 |
-name '*.[chS]' -print; \ |
|---|
| 1009 |
find arch/$(ARCH) $(RCS_FIND_IGNORE) \ |
|---|
| 1010 |
-name '*.[chS]' -print; \ |
|---|
| 1011 |
find security/selinux/include $(RCS_FIND_IGNORE) \ |
|---|
| 1012 |
-name '*.[chS]' -print; \ |
|---|
| 1013 |
find include $(RCS_FIND_IGNORE) \ |
|---|
| 1014 |
\( -name config -o -name 'asm-*' \) -prune \ |
|---|
| 1015 |
-o -name '*.[chS]' -print; \ |
|---|
| 1016 |
find include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ |
|---|
| 1017 |
-name '*.[chS]' -print; \ |
|---|
| 1018 |
find include/asm-generic $(RCS_FIND_IGNORE) \ |
|---|
| 1019 |
-name '*.[chS]' -print ) |
|---|
| 1020 |
endef |
|---|
| 1021 |
|
|---|
| 1022 |
quiet_cmd_cscope-file = FILELST cscope.files |
|---|
| 1023 |
cmd_cscope-file = $(all-sources) > cscope.files |
|---|
| 1024 |
|
|---|
| 1025 |
quiet_cmd_cscope = MAKE cscope.out |
|---|
| 1026 |
cmd_cscope = cscope -k -b -q |
|---|
| 1027 |
|
|---|
| 1028 |
cscope: FORCE |
|---|
| 1029 |
$(call cmd,cscope-file) |
|---|
| 1030 |
$(call cmd,cscope) |
|---|
| 1031 |
|
|---|
| 1032 |
quiet_cmd_TAGS = MAKE $@ |
|---|
| 1033 |
cmd_TAGS = $(all-sources) | etags - |
|---|
| 1034 |
|
|---|
| 1035 |
|
|---|
| 1036 |
|
|---|
| 1037 |
quiet_cmd_tags = MAKE $@ |
|---|
| 1038 |
define cmd_tags |
|---|
| 1039 |
rm -f $@; \ |
|---|
| 1040 |
CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \ |
|---|
| 1041 |
$(all-sources) | xargs ctags $$CTAGSF -a |
|---|
| 1042 |
endef |
|---|
| 1043 |
|
|---|
| 1044 |
TAGS: FORCE |
|---|
| 1045 |
$(call cmd,TAGS) |
|---|
| 1046 |
|
|---|
| 1047 |
tags: FORCE |
|---|
| 1048 |
$(call cmd,tags) |
|---|
| 1049 |
|
|---|
| 1050 |
|
|---|
| 1051 |
|
|---|
| 1052 |
|
|---|
| 1053 |
|
|---|
| 1054 |
configcheck: |
|---|
| 1055 |
find * $(RCS_FIND_IGNORE) \ |
|---|
| 1056 |
-name '*.[hcS]' -type f -print | sort \ |
|---|
| 1057 |
| xargs $(PERL) -w scripts/checkconfig.pl |
|---|
| 1058 |
|
|---|
| 1059 |
includecheck: |
|---|
| 1060 |
find * $(RCS_FIND_IGNORE) \ |
|---|
| 1061 |
-name '*.[hcS]' -type f -print | sort \ |
|---|
| 1062 |
| xargs $(PERL) -w scripts/checkincludes.pl |
|---|
| 1063 |
|
|---|
| 1064 |
versioncheck: |
|---|
| 1065 |
find * $(RCS_FIND_IGNORE) \ |
|---|
| 1066 |
-name '*.[hcS]' -type f -print | sort \ |
|---|
| 1067 |
| xargs $(PERL) -w scripts/checkversion.pl |
|---|
| 1068 |
|
|---|
| 1069 |
buildcheck: |
|---|
| 1070 |
$(PERL) scripts/reference_discarded.pl |
|---|
| 1071 |
$(PERL) scripts/reference_init.pl |
|---|
| 1072 |
|
|---|
| 1073 |
endif |
|---|
| 1074 |
endif |
|---|
| 1075 |
|
|---|
| 1076 |
.PHONY: checkstack |
|---|
| 1077 |
checkstack: |
|---|
| 1078 |
$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ |
|---|
| 1079 |
$(PERL) scripts/checkstack.pl $(ARCH) |
|---|
| 1080 |
|
|---|
| 1081 |
|
|---|
| 1082 |
|
|---|
| 1083 |
|
|---|
| 1084 |
quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs))) |
|---|
| 1085 |
cmd_rmdirs = rm -rf $(rm-dirs) |
|---|
| 1086 |
|
|---|
| 1087 |
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) |
|---|
| 1088 |
cmd_rmfiles = rm -f $(rm-files) |
|---|
| 1089 |
|
|---|
| 1090 |
|
|---|
| 1091 |
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \ |
|---|
| 1092 |
$(NOSTDINC_FLAGS) $(CPPFLAGS) \ |
|---|
| 1093 |
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) |
|---|
| 1094 |
|
|---|
| 1095 |
quiet_cmd_as_o_S = AS $@ |
|---|
| 1096 |
cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< |
|---|
| 1097 |
|
|---|
| 1098 |
|
|---|
| 1099 |
|
|---|
| 1100 |
targets := $(wildcard $(sort $(targets))) |
|---|
| 1101 |
cmd_files := $(wildcard .*.cmd $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) |
|---|
| 1102 |
|
|---|
| 1103 |
ifneq ($(cmd_files),) |
|---|
| 1104 |
$(cmd_files): ; |
|---|
| 1105 |
include $(cmd_files) |
|---|
| 1106 |
endif |
|---|
| 1107 |
|
|---|
| 1108 |
|
|---|
| 1109 |
|
|---|
| 1110 |
|
|---|
| 1111 |
if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ |
|---|
| 1112 |
$(filter-out $(cmd_$(1)),$(cmd_$@))\ |
|---|
| 1113 |
$(filter-out $(cmd_$@),$(cmd_$(1)))),\ |
|---|
| 1114 |
@set -e; \ |
|---|
| 1115 |
$(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ |
|---|
| 1116 |
$(cmd_$(1)); \ |
|---|
| 1117 |
scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ |
|---|
| 1118 |
rm -f $(depfile); \ |
|---|
| 1119 |
mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) |
|---|
| 1120 |
|
|---|
| 1121 |
|
|---|
| 1122 |
|
|---|
| 1123 |
|
|---|
| 1124 |
|
|---|
| 1125 |
if_changed_rule = $(if $(strip $? \ |
|---|
| 1126 |
$(filter-out $(cmd_$(1)),$(cmd_$(@F)))\ |
|---|
| 1127 |
$(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\ |
|---|
| 1128 |
@$(rule_$(1))) |
|---|
| 1129 |
|
|---|
| 1130 |
|
|---|
| 1131 |
|
|---|
| 1132 |
cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) |
|---|
| 1133 |
|
|---|
| 1134 |
|
|---|
| 1135 |
|
|---|
| 1136 |
|
|---|
| 1137 |
|
|---|
| 1138 |
|
|---|
| 1139 |
|
|---|
| 1140 |
|
|---|
| 1141 |
|
|---|
| 1142 |
|
|---|
| 1143 |
|
|---|
| 1144 |
|
|---|
| 1145 |
|
|---|
| 1146 |
|
|---|
| 1147 |
define filechk |
|---|
| 1148 |
@set -e; \ |
|---|
| 1149 |
echo ' CHK $@'; \ |
|---|
| 1150 |
mkdir -p $(dir $@); \ |
|---|
| 1151 |
$(filechk_$(1)) < $< > $@.tmp; \ |
|---|
| 1152 |
if [ -r $@ ] && cmp -s $@ $@.tmp; then \ |
|---|
| 1153 |
rm -f $@.tmp; \ |
|---|
| 1154 |
else \ |
|---|
| 1155 |
echo ' UPD $@'; \ |
|---|
| 1156 |
mv -f $@.tmp $@; \ |
|---|
| 1157 |
fi |
|---|
| 1158 |
endef |
|---|
| 1159 |
|
|---|
| 1160 |
|
|---|
| 1161 |
|
|---|
| 1162 |
|
|---|
| 1163 |
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj |
|---|
| 1164 |
|
|---|
| 1165 |
|
|---|
| 1166 |
|
|---|
| 1167 |
|
|---|
| 1168 |
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj |
|---|
| 1169 |
|
|---|
| 1170 |
|
|---|
| 1171 |
|
|---|
| 1172 |
|
|---|
| 1173 |
descend =$(Q)$(MAKE) -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj=$(1) $(2) |
|---|
| 1174 |
|
|---|
| 1175 |
endif |
|---|
| 1176 |
|
|---|
| 1177 |
FORCE: |
|---|