diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 47 |
1 files changed, 32 insertions, 15 deletions
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 35 | 3 | SUBLEVEL = 35 |
4 | EXTRAVERSION = -rc4 | 4 | EXTRAVERSION = |
5 | NAME = Sheep on Meth | 5 | NAME = Sheep on Meth |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
@@ -332,10 +332,9 @@ CHECK = sparse | |||
332 | 332 | ||
333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ | 333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ |
334 | -Wbitwise -Wno-return-void $(CF) | 334 | -Wbitwise -Wno-return-void $(CF) |
335 | MODFLAGS = -DMODULE | 335 | CFLAGS_MODULE = |
336 | CFLAGS_MODULE = $(MODFLAGS) | 336 | AFLAGS_MODULE = |
337 | AFLAGS_MODULE = $(MODFLAGS) | 337 | LDFLAGS_MODULE = |
338 | LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds | ||
339 | CFLAGS_KERNEL = | 338 | CFLAGS_KERNEL = |
340 | AFLAGS_KERNEL = | 339 | AFLAGS_KERNEL = |
341 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | 340 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage |
@@ -354,7 +353,12 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | |||
354 | -Werror-implicit-function-declaration \ | 353 | -Werror-implicit-function-declaration \ |
355 | -Wno-format-security \ | 354 | -Wno-format-security \ |
356 | -fno-delete-null-pointer-checks | 355 | -fno-delete-null-pointer-checks |
356 | KBUILD_AFLAGS_KERNEL := | ||
357 | KBUILD_CFLAGS_KERNEL := | ||
357 | KBUILD_AFLAGS := -D__ASSEMBLY__ | 358 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
359 | KBUILD_AFLAGS_MODULE := -DMODULE | ||
360 | KBUILD_CFLAGS_MODULE := -DMODULE | ||
361 | KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds | ||
358 | 362 | ||
359 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) | 363 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) |
360 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | 364 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) |
@@ -369,6 +373,8 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | |||
369 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 373 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS |
370 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | 374 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV |
371 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 375 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
376 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | ||
377 | export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL | ||
372 | 378 | ||
373 | # When compiling out-of-tree modules, put MODVERDIR in the module | 379 | # When compiling out-of-tree modules, put MODVERDIR in the module |
374 | # tree rather than in the kernel tree. The kernel tree might | 380 | # tree rather than in the kernel tree. The kernel tree might |
@@ -412,9 +418,9 @@ endif | |||
412 | # of make so .config is not included in this case either (for *config). | 418 | # of make so .config is not included in this case either (for *config). |
413 | 419 | ||
414 | no-dot-config-targets := clean mrproper distclean \ | 420 | no-dot-config-targets := clean mrproper distclean \ |
415 | cscope TAGS tags help %docs check% \ | 421 | cscope TAGS tags help %docs check% coccicheck \ |
416 | include/linux/version.h headers_% \ | 422 | include/linux/version.h headers_% \ |
417 | kernelrelease kernelversion | 423 | kernelversion %src-pkg |
418 | 424 | ||
419 | config-targets := 0 | 425 | config-targets := 0 |
420 | mixed-targets := 0 | 426 | mixed-targets := 0 |
@@ -526,7 +532,7 @@ endif # $(dot-config) | |||
526 | # The all: target is the default when no target is given on the | 532 | # The all: target is the default when no target is given on the |
527 | # command line. | 533 | # command line. |
528 | # This allow a user to issue only 'make' to build a kernel including modules | 534 | # This allow a user to issue only 'make' to build a kernel including modules |
529 | # Defaults vmlinux but it is usually overridden in the arch makefile | 535 | # Defaults to vmlinux, but the arch makefile usually adds further targets |
530 | all: vmlinux | 536 | all: vmlinux |
531 | 537 | ||
532 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE | 538 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE |
@@ -557,6 +563,10 @@ KBUILD_CFLAGS += -g | |||
557 | KBUILD_AFLAGS += -gdwarf-2 | 563 | KBUILD_AFLAGS += -gdwarf-2 |
558 | endif | 564 | endif |
559 | 565 | ||
566 | ifdef CONFIG_DEBUG_INFO_REDUCED | ||
567 | KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) | ||
568 | endif | ||
569 | |||
560 | ifdef CONFIG_FUNCTION_TRACER | 570 | ifdef CONFIG_FUNCTION_TRACER |
561 | KBUILD_CFLAGS += -pg | 571 | KBUILD_CFLAGS += -pg |
562 | endif | 572 | endif |
@@ -603,7 +613,7 @@ endif | |||
603 | # Use --build-id when available. | 613 | # Use --build-id when available. |
604 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ | 614 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ |
605 | $(call cc-ldoption, -Wl$(comma)--build-id,)) | 615 | $(call cc-ldoption, -Wl$(comma)--build-id,)) |
606 | LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) | 616 | KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) |
607 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) | 617 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) |
608 | 618 | ||
609 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) | 619 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) |
@@ -886,7 +896,7 @@ $(vmlinux-dirs): prepare scripts | |||
886 | # Store (new) KERNELRELASE string in include/config/kernel.release | 896 | # Store (new) KERNELRELASE string in include/config/kernel.release |
887 | include/config/kernel.release: include/config/auto.conf FORCE | 897 | include/config/kernel.release: include/config/auto.conf FORCE |
888 | $(Q)rm -f $@ | 898 | $(Q)rm -f $@ |
889 | $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) scripts/setlocalversion $(srctree))" > $@ | 899 | $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" > $@ |
890 | 900 | ||
891 | 901 | ||
892 | # Things we need to do before we recursively start building the kernel | 902 | # Things we need to do before we recursively start building the kernel |
@@ -1158,6 +1168,8 @@ distclean: mrproper | |||
1158 | # rpm target kept for backward compatibility | 1168 | # rpm target kept for backward compatibility |
1159 | package-dir := $(srctree)/scripts/package | 1169 | package-dir := $(srctree)/scripts/package |
1160 | 1170 | ||
1171 | %src-pkg: FORCE | ||
1172 | $(Q)$(MAKE) $(build)=$(package-dir) $@ | ||
1161 | %pkg: include/config/kernel.release FORCE | 1173 | %pkg: include/config/kernel.release FORCE |
1162 | $(Q)$(MAKE) $(build)=$(package-dir) $@ | 1174 | $(Q)$(MAKE) $(build)=$(package-dir) $@ |
1163 | rpm: include/config/kernel.release FORCE | 1175 | rpm: include/config/kernel.release FORCE |
@@ -1209,8 +1221,9 @@ help: | |||
1209 | @echo ' includecheck - Check for duplicate included header files' | 1221 | @echo ' includecheck - Check for duplicate included header files' |
1210 | @echo ' export_report - List the usages of all exported symbols' | 1222 | @echo ' export_report - List the usages of all exported symbols' |
1211 | @echo ' headers_check - Sanity check on exported headers' | 1223 | @echo ' headers_check - Sanity check on exported headers' |
1212 | @echo ' headerdep - Detect inclusion cycles in headers'; \ | 1224 | @echo ' headerdep - Detect inclusion cycles in headers' |
1213 | echo '' | 1225 | @$(MAKE) -f $(srctree)/scripts/Makefile.help checker-help |
1226 | @echo '' | ||
1214 | @echo 'Kernel packaging:' | 1227 | @echo 'Kernel packaging:' |
1215 | @$(MAKE) $(build)=$(package-dir) help | 1228 | @$(MAKE) $(build)=$(package-dir) help |
1216 | @echo '' | 1229 | @echo '' |
@@ -1369,6 +1382,9 @@ versioncheck: | |||
1369 | -name '*.[hcS]' -type f -print | sort \ | 1382 | -name '*.[hcS]' -type f -print | sort \ |
1370 | | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl | 1383 | | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl |
1371 | 1384 | ||
1385 | coccicheck: | ||
1386 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/$@ | ||
1387 | |||
1372 | namespacecheck: | 1388 | namespacecheck: |
1373 | $(PERL) $(srctree)/scripts/namespace.pl | 1389 | $(PERL) $(srctree)/scripts/namespace.pl |
1374 | 1390 | ||
@@ -1393,9 +1409,9 @@ checkstack: | |||
1393 | $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ | 1409 | $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ |
1394 | $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) | 1410 | $(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) |
1395 | 1411 | ||
1396 | kernelrelease: | 1412 | kernelrelease: include/config/kernel.release |
1397 | $(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \ | 1413 | @echo $(KERNELRELEASE) |
1398 | $(error kernelrelease not valid - run 'make prepare' to update it)) | 1414 | |
1399 | kernelversion: | 1415 | kernelversion: |
1400 | @echo $(KERNELVERSION) | 1416 | @echo $(KERNELVERSION) |
1401 | 1417 | ||
@@ -1472,6 +1488,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ | |||
1472 | $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) | 1488 | $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) |
1473 | 1489 | ||
1474 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ | 1490 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ |
1491 | $(KBUILD_AFLAGS_KERNEL) \ | ||
1475 | $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \ | 1492 | $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \ |
1476 | $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) | 1493 | $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) |
1477 | 1494 | ||