aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-03 17:30:54 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-07-03 17:30:54 -0400
commit63104eec234bdecb55fd9c15467ae00d0a3f42ac (patch)
treeaee8fd42c0904cbc8671a7c023a421277db1b16f /Makefile
parent05668381140309088443bf5dc53add4104610fbb (diff)
kbuild: introduce utsrelease.h
include/linux/version.h contained both actual KERNEL version and UTS_RELEASE that contains a subset from git SHA1 for when kernel was compiled as part of a git repository. This had the unfortunate side-effect that all files including version.h would be recompiled when some git changes was made due to changes SHA1. Split it out so we keep independent parts in separate files. Also update checkversion.pl script to no longer check for UTS_RELEASE. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 18 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 1cc793ff42d4..b36aeb617bd2 100644
--- a/Makefile
+++ b/Makefile
@@ -812,8 +812,8 @@ endif
812# prepare2 creates a makefile if using a separate output directory 812# prepare2 creates a makefile if using a separate output directory
813prepare2: prepare3 outputmakefile 813prepare2: prepare3 outputmakefile
814 814
815prepare1: prepare2 include/linux/version.h include/asm \ 815prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
816 include/config/auto.conf 816 include/asm include/config/auto.conf
817ifneq ($(KBUILD_MODULES),) 817ifneq ($(KBUILD_MODULES),)
818 $(Q)mkdir -p $(MODVERDIR) 818 $(Q)mkdir -p $(MODVERDIR)
819 $(Q)rm -f $(MODVERDIR)/* 819 $(Q)rm -f $(MODVERDIR)/*
@@ -848,21 +848,26 @@ include/asm:
848# 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
849 849
850uts_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
851 858
852define filechk_version.h 859define filechk_version.h
853 if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ 860 (echo \#define LINUX_VERSION_CODE $(shell \
854 echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ 861 expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \
855 exit 1; \ 862 echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
856 fi; \
857 (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
858 echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
859 echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
860 )
861endef 863endef
862 864
863include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE 865include/linux/version.h: $(srctree)/Makefile FORCE
864 $(call filechk,version.h) 866 $(call filechk,version.h)
865 867
868include/linux/utsrelease.h: include/config/kernel.release FORCE
869 $(call filechk,utsrelease.h)
870
866# --------------------------------------------------------------------------- 871# ---------------------------------------------------------------------------
867 872
868PHONY += depend dep 873PHONY += depend dep
@@ -955,7 +960,8 @@ CLEAN_FILES += vmlinux System.map \
955# Directories & files removed with 'make mrproper' 960# Directories & files removed with 'make mrproper'
956MRPROPER_DIRS += include/config include2 961MRPROPER_DIRS += include/config include2
957MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 962MRPROPER_FILES += .config .config.old include/asm .version .old_version \
958 include/linux/autoconf.h include/linux/version.h \ 963 include/linux/autoconf.h include/linux/version.h \
964 include/linux/utsrelease.h \
959 Module.symvers tags TAGS cscope* 965 Module.symvers tags TAGS cscope*
960 966
961# clean - Delete most, but leave enough to build external modules 967# clean - Delete most, but leave enough to build external modules