aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 21 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 4dcf25d43fa6..b36aeb617bd2 100644
--- a/Makefile
+++ b/Makefile
@@ -309,6 +309,9 @@ CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
309 309
310CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 310CFLAGS := -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
313CFLAGS += $(call cc-option, -fno-stack-protector-all \
314 -fno-stack-protector)
312AFLAGS := -D__ASSEMBLY__ 315AFLAGS := -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
810prepare2: prepare3 outputmakefile 813prepare2: prepare3 outputmakefile
811 814
812prepare1: prepare2 include/linux/version.h include/asm \ 815prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
813 include/config/auto.conf 816 include/asm include/config/auto.conf
814ifneq ($(KBUILD_MODULES),) 817ifneq ($(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
847uts_len := 64 850uts_len := 64
851define 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)\";)
857endef
848 858
849define filechk_version.h 859define 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 )
858endef 863endef
859 864
860include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE 865include/linux/version.h: $(srctree)/Makefile FORCE
861 $(call filechk,version.h) 866 $(call filechk,version.h)
862 867
868include/linux/utsrelease.h: include/config/kernel.release FORCE
869 $(call filechk,utsrelease.h)
870
863# --------------------------------------------------------------------------- 871# ---------------------------------------------------------------------------
864 872
865PHONY += depend dep 873PHONY += 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'
953MRPROPER_DIRS += include/config include2 961MRPROPER_DIRS += include/config include2
954MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 962MRPROPER_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