diff options
-rw-r--r-- | Makefile | 43 |
1 files changed, 27 insertions, 16 deletions
@@ -910,14 +910,19 @@ endif | |||
910 | # $(localver) | 910 | # $(localver) |
911 | # localversion* (files without backups, containing '~') | 911 | # localversion* (files without backups, containing '~') |
912 | # $(CONFIG_LOCALVERSION) (from kernel config setting) | 912 | # $(CONFIG_LOCALVERSION) (from kernel config setting) |
913 | # $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) | 913 | # $(LOCALVERSION) (from make command line, if provided) |
914 | # ./scripts/setlocalversion (SCM tag, if one exists) | 914 | # $(localver-extra) |
915 | # $(LOCALVERSION) (from make command line if provided) | 915 | # $(scm-identifier) (unique SCM tag, if one exists) |
916 | # ./scripts/setlocalversion (only with CONFIG_LOCALVERSION_AUTO) | ||
917 | # .scmversion (only with CONFIG_LOCALVERSION_AUTO) | ||
918 | # + (only without CONFIG_LOCALVERSION_AUTO | ||
919 | # and without LOCALVERSION= and | ||
920 | # repository is at non-tagged commit) | ||
916 | # | 921 | # |
917 | # Note how the final $(localver-auto) string is included *only* if the | 922 | # For kernels without CONFIG_LOCALVERSION_AUTO compiled from an SCM that has |
918 | # kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the | 923 | # been revised beyond a tagged commit, `+' is appended to the version string |
919 | # moment, only git is supported but other SCMs can edit the script | 924 | # when not overridden by using "make LOCALVERSION=". This indicates that the |
920 | # scripts/setlocalversion and add the appropriate checks as needed. | 925 | # kernel is not a vanilla release version and has been modified. |
921 | 926 | ||
922 | pattern = ".*/localversion[^~]*" | 927 | pattern = ".*/localversion[^~]*" |
923 | string = $(shell cat /dev/null \ | 928 | string = $(shell cat /dev/null \ |
@@ -926,26 +931,32 @@ string = $(shell cat /dev/null \ | |||
926 | localver = $(subst $(space),, $(string) \ | 931 | localver = $(subst $(space),, $(string) \ |
927 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) | 932 | $(patsubst "%",%,$(CONFIG_LOCALVERSION))) |
928 | 933 | ||
929 | # If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called | 934 | # scripts/setlocalversion is called to create a unique identifier if the source |
930 | # and if the SCM is know a tag from the SCM is appended. | 935 | # is managed by a known SCM and the repository has been revised since the last |
931 | # The appended tag is determined by the SCM used. | 936 | # tagged (release) commit. The format of the identifier is determined by the |
937 | # SCM's implementation. | ||
932 | # | 938 | # |
933 | # .scmversion is used when generating rpm packages so we do not loose | 939 | # .scmversion is used when generating rpm packages so we do not loose |
934 | # the version information from the SCM when we do the build of the kernel | 940 | # the version information from the SCM when we do the build of the kernel |
935 | # from the copied source | 941 | # from the copied source |
936 | ifdef CONFIG_LOCALVERSION_AUTO | ||
937 | |||
938 | ifeq ($(wildcard .scmversion),) | 942 | ifeq ($(wildcard .scmversion),) |
939 | _localver-auto = $(shell $(CONFIG_SHELL) \ | 943 | scm-identifier = $(shell $(CONFIG_SHELL) \ |
940 | $(srctree)/scripts/setlocalversion $(srctree)) | 944 | $(srctree)/scripts/setlocalversion $(srctree)) |
941 | else | 945 | else |
942 | _localver-auto = $(shell cat .scmversion 2> /dev/null) | 946 | scm-identifier = $(shell cat .scmversion 2> /dev/null) |
943 | endif | 947 | endif |
944 | 948 | ||
945 | localver-auto = $(LOCALVERSION)$(_localver-auto) | 949 | ifdef CONFIG_LOCALVERSION_AUTO |
950 | localver-extra = $(scm-identifier) | ||
951 | else | ||
952 | ifneq ($scm-identifier,) | ||
953 | ifeq ($(LOCALVERSION),) | ||
954 | localver-extra = + | ||
955 | endif | ||
956 | endif | ||
946 | endif | 957 | endif |
947 | 958 | ||
948 | localver-full = $(localver)$(localver-auto) | 959 | localver-full = $(localver)$(LOCALVERSION)$(localver-extra) |
949 | 960 | ||
950 | # Store (new) KERNELRELASE string in include/config/kernel.release | 961 | # Store (new) KERNELRELASE string in include/config/kernel.release |
951 | kernelrelease = $(KERNELVERSION)$(localver-full) | 962 | kernelrelease = $(KERNELVERSION)$(localver-full) |