diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -309,6 +309,9 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) | |||
309 | 309 | ||
310 | CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | 310 | CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ |
311 | -fno-strict-aliasing -fno-common | 311 | -fno-strict-aliasing -fno-common |
312 | # Force gcc to behave correct even for buggy distributions | ||
313 | CFLAGS += $(call cc-option, -fno-stack-protector-all \ | ||
314 | -fno-stack-protector) | ||
312 | AFLAGS := -D__ASSEMBLY__ | 315 | AFLAGS := -D__ASSEMBLY__ |
313 | 316 | ||
314 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) | 317 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) |
@@ -809,8 +812,8 @@ endif | |||
809 | # prepare2 creates a makefile if using a separate output directory | 812 | # prepare2 creates a makefile if using a separate output directory |
810 | prepare2: prepare3 outputmakefile | 813 | prepare2: prepare3 outputmakefile |
811 | 814 | ||
812 | prepare1: prepare2 include/linux/version.h include/asm \ | 815 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ |
813 | include/config/auto.conf | 816 | include/asm include/config/auto.conf |
814 | ifneq ($(KBUILD_MODULES),) | 817 | ifneq ($(KBUILD_MODULES),) |
815 | $(Q)mkdir -p $(MODVERDIR) | 818 | $(Q)mkdir -p $(MODVERDIR) |
816 | $(Q)rm -f $(MODVERDIR)/* | 819 | $(Q)rm -f $(MODVERDIR)/* |
@@ -845,21 +848,26 @@ include/asm: | |||
845 | # needs to be updated, so this check is forced on all builds | 848 | # needs to be updated, so this check is forced on all builds |
846 | 849 | ||
847 | uts_len := 64 | 850 | uts_len := 64 |
851 | define filechk_utsrelease.h | ||
852 | if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ | ||
853 | echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ | ||
854 | exit 1; \ | ||
855 | fi; \ | ||
856 | (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) | ||
857 | endef | ||
848 | 858 | ||
849 | define filechk_version.h | 859 | define filechk_version.h |
850 | if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ | 860 | (echo \#define LINUX_VERSION_CODE $(shell \ |
851 | echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ | 861 | expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ |
852 | exit 1; \ | 862 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) |
853 | fi; \ | ||
854 | (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ | ||
855 | echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \ | ||
856 | echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \ | ||
857 | ) | ||
858 | endef | 863 | endef |
859 | 864 | ||
860 | include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE | 865 | include/linux/version.h: $(srctree)/Makefile FORCE |
861 | $(call filechk,version.h) | 866 | $(call filechk,version.h) |
862 | 867 | ||
868 | include/linux/utsrelease.h: include/config/kernel.release FORCE | ||
869 | $(call filechk,utsrelease.h) | ||
870 | |||
863 | # --------------------------------------------------------------------------- | 871 | # --------------------------------------------------------------------------- |
864 | 872 | ||
865 | PHONY += depend dep | 873 | PHONY += depend dep |
@@ -952,7 +960,8 @@ CLEAN_FILES += vmlinux System.map \ | |||
952 | # Directories & files removed with 'make mrproper' | 960 | # Directories & files removed with 'make mrproper' |
953 | MRPROPER_DIRS += include/config include2 | 961 | MRPROPER_DIRS += include/config include2 |
954 | MRPROPER_FILES += .config .config.old include/asm .version .old_version \ | 962 | MRPROPER_FILES += .config .config.old include/asm .version .old_version \ |
955 | include/linux/autoconf.h include/linux/version.h \ | 963 | include/linux/autoconf.h include/linux/version.h \ |
964 | include/linux/utsrelease.h \ | ||
956 | Module.symvers tags TAGS cscope* | 965 | Module.symvers tags TAGS cscope* |
957 | 966 | ||
958 | # clean - Delete most, but leave enough to build external modules | 967 | # clean - Delete most, but leave enough to build external modules |