diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-07-03 17:30:54 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-07-03 17:30:54 -0400 |
commit | 63104eec234bdecb55fd9c15467ae00d0a3f42ac (patch) | |
tree | aee8fd42c0904cbc8671a7c023a421277db1b16f /Makefile | |
parent | 05668381140309088443bf5dc53add4104610fbb (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-- | Makefile | 30 |
1 files changed, 18 insertions, 12 deletions
@@ -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 |
813 | prepare2: prepare3 outputmakefile | 813 | prepare2: prepare3 outputmakefile |
814 | 814 | ||
815 | prepare1: prepare2 include/linux/version.h include/asm \ | 815 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ |
816 | include/config/auto.conf | 816 | include/asm include/config/auto.conf |
817 | ifneq ($(KBUILD_MODULES),) | 817 | ifneq ($(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 | ||
850 | 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 | ||
851 | 858 | ||
852 | define filechk_version.h | 859 | define 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 | ) | ||
861 | endef | 863 | endef |
862 | 864 | ||
863 | include/linux/version.h: $(srctree)/Makefile include/config/kernel.release FORCE | 865 | include/linux/version.h: $(srctree)/Makefile FORCE |
864 | $(call filechk,version.h) | 866 | $(call filechk,version.h) |
865 | 867 | ||
868 | include/linux/utsrelease.h: include/config/kernel.release FORCE | ||
869 | $(call filechk,utsrelease.h) | ||
870 | |||
866 | # --------------------------------------------------------------------------- | 871 | # --------------------------------------------------------------------------- |
867 | 872 | ||
868 | PHONY += depend dep | 873 | PHONY += 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' |
956 | MRPROPER_DIRS += include/config include2 | 961 | MRPROPER_DIRS += include/config include2 |
957 | MRPROPER_FILES += .config .config.old include/asm .version .old_version \ | 962 | MRPROPER_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 |