X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=c2f78a5a549390223a5dd76ee0543f1a5d36a55c;hb=87589f08beaec3e1f8a3af0c72406c845f706821;hp=935a9d610e68874f94c4ea6dac065eedd1a88ec3;hpb=5e8d780d745c1619aba81fe7166c5a4b5cad2b84;p=pandora-kernel.git diff --git a/Makefile b/Makefile index 935a9d610e68..c2f78a5a5493 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 -SUBLEVEL = 17 -EXTRAVERSION = +SUBLEVEL = 18 +EXTRAVERSION = -rc4 NAME=Crazed Snow-Weasel # *DOCUMENTATION* @@ -41,8 +41,9 @@ ifndef KBUILD_VERBOSE KBUILD_VERBOSE = 0 endif -# Call sparse as part of compilation of C files -# Use 'make C=1' to enable sparse checking +# Call checker as part of compilation of C files +# Use 'make C=1' to enable checking (sparse, by default) +# Override with 'make C=1 CHECK=checker_executable CHECKFLAGS=....' ifdef C ifeq ("$(origin C)", "command line") @@ -308,6 +309,9 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common +# Force gcc to behave correct even for buggy distributions +CFLAGS += $(call cc-option, -fno-stack-protector) + AFLAGS := -D__ASSEMBLY__ # Read KERNELRELEASE from include/config/kernel.release (if it exists) @@ -364,6 +368,7 @@ endif no-dot-config-targets := clean mrproper distclean \ cscope TAGS tags help %docs check% \ + include/linux/version.h headers_% \ kernelrelease kernelversion config-targets := 0 @@ -524,7 +529,7 @@ export MODLIB ifdef INSTALL_MOD_STRIP ifeq ($(INSTALL_MOD_STRIP),1) -mod_strip_cmd = $STRIP) --strip-debug +mod_strip_cmd = $(STRIP) --strip-debug else mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) endif # INSTALL_MOD_STRIP=1 @@ -808,8 +813,8 @@ endif # prepare2 creates a makefile if using a separate output directory prepare2: prepare3 outputmakefile -prepare1: prepare2 include/linux/version.h include/asm \ - include/config/auto.conf +prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ + include/asm include/config/auto.conf ifneq ($(KBUILD_MODULES),) $(Q)mkdir -p $(MODVERDIR) $(Q)rm -f $(MODVERDIR)/* @@ -844,27 +849,47 @@ include/asm: # needs to be updated, so this check is forced on all builds uts_len := 64 +define filechk_utsrelease.h + if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ + echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ + exit 1; \ + fi; \ + (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) +endef define filechk_version.h - if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ - echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ - exit 1; \ - fi; \ - (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ - echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \ - echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \ - ) + (echo \#define LINUX_VERSION_CODE $(shell \ + expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ + echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) endef -include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE +include/linux/version.h: $(srctree)/Makefile FORCE $(call filechk,version.h) +include/linux/utsrelease.h: include/config/kernel.release FORCE + $(call filechk,utsrelease.h) + # --------------------------------------------------------------------------- PHONY += depend dep depend dep: @echo '*** Warning: make $@ is unnecessary now.' +# --------------------------------------------------------------------------- +# Kernel headers +INSTALL_HDR_PATH=$(MODLIB)/abi +export INSTALL_HDR_PATH + +PHONY += headers_install +headers_install: include/linux/version.h + $(Q)unifdef -Ux /dev/null + $(Q)rm -rf $(INSTALL_HDR_PATH)/include + $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include + +PHONY += headers_check +headers_check: headers_install + $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1 + # --------------------------------------------------------------------------- # Modules @@ -951,7 +976,8 @@ CLEAN_FILES += vmlinux System.map \ # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include2 MRPROPER_FILES += .config .config.old include/asm .version .old_version \ - include/linux/autoconf.h include/linux/version.h \ + include/linux/autoconf.h include/linux/version.h \ + include/linux/utsrelease.h \ Module.symvers tags TAGS cscope* # clean - Delete most, but leave enough to build external modules @@ -1038,6 +1064,8 @@ help: @echo ' cscope - Generate cscope index' @echo ' kernelrelease - Output the release version string' @echo ' kernelversion - Output the version stored in Makefile' + @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH' + @echo ' (default: /lib/modules/$$VERSION/abi)' @echo '' @echo 'Static analysers' @echo ' checkstack - Generate a list of stack hogs' @@ -1060,8 +1088,8 @@ help: @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' @echo ' make O=dir [targets] Locate all output files in "dir", including .config' - @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse)' - @echo ' make C=2 [targets] Force check of all c source with $$CHECK (sparse)' + @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' + @echo ' make C=2 [targets] Force check of all c source with $$CHECK' @echo '' @echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'For further info see the ./README file'