diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-20 12:49:26 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-03-09 20:14:15 +0100 |
commit | d5c0d3ee9c6c851b22fa0ed55c4c5113c6341b64 (patch) | |
tree | 58112a5f7112c820d5604236e92eb38c7a364409 /Makefile | |
parent | 6640f5e3999e3d5472017e04435df24a346dffce (diff) | |
download | barebox-d5c0d3ee9c6c851b22fa0ed55c4c5113c6341b64.tar.gz barebox-d5c0d3ee9c6c851b22fa0ed55c4c5113c6341b64.tar.xz |
Make: update setlocalversion from the kernel
This syncs the localversion generation with the kernel.
At least one effect is that a barebox built from a tar archive no
longer marks itself as dirty. Also it moves some stuff from a scary
Makefile to a not-so-scary shell script.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 61 |
1 files changed, 2 insertions, 59 deletions
@@ -744,68 +744,11 @@ PHONY += $(barebox-dirs) $(barebox-dirs): prepare scripts $(Q)$(MAKE) $(build)=$@ -# Build the kernel release string -# -# The KERNELRELEASE value built here is stored in the file -# include/config/kernel.release, and is used when executing several -# make targets, such as "make install" or "make modules_install." -# -# The eventual kernel release string consists of the following fields, -# shown in a hierarchical format to show how smaller parts are concatenated -# to form the larger and final value, with values coming from places like -# the Makefile, kernel config options, make command line options and/or -# SCM tag information. -# -# $(KERNELVERSION) -# $(VERSION) eg, 2 -# $(PATCHLEVEL) eg, 6 -# $(SUBLEVEL) eg, 18 -# $(EXTRAVERSION) eg, -rc6 -# $(localver-full) -# $(localver) -# localversion* (all localversion* files) -# $(CONFIG_LOCALVERSION) (from kernel config setting) -# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set) -# ./scripts/setlocalversion (SCM tag, if one exists) -# $(LOCALVERSION) (from make command line if provided) -# -# Note how the final $(localver-auto) string is included *only* if the -# kernel config option CONFIG_LOCALVERSION_AUTO is selected. Also, at the -# moment, only git is supported but other SCMs can edit the script -# scripts/setlocalversion and add the appropriate checks as needed. - -nullstring := -space := $(nullstring) # end of line - -___localver = $(objtree)/localversion* $(srctree)/localversion* -__localver = $(sort $(wildcard $(___localver))) -# skip backup files (containing '~') -_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f))) - -localver = $(subst $(space),, \ - $(shell cat /dev/null $(_localver)) \ - $(patsubst "%",%,$(CONFIG_LOCALVERSION))) - -# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called -# and if the SCM is know a tag from the SCM is appended. -# The appended tag is determined by the SCM used. -# -# Currently, only git is supported. -# Other SCMs can edit scripts/setlocalversion and add the appropriate -# checks as needed. -ifdef CONFIG_LOCALVERSION_AUTO - _localver-auto = $(shell $(CONFIG_SHELL) \ - $(srctree)/scripts/setlocalversion $(srctree)) - localver-auto = $(LOCALVERSION)$(_localver-auto) -endif - -localver-full = $(localver)$(localver-auto) - # Store (new) KERNELRELASE string in include/config/kernel.release -kernelrelease = $(KERNELVERSION)$(localver-full) +localversion = $(shell $(srctree)/scripts/setlocalversion $(srctree)) include/config/kernel.release: include/config/auto.conf FORCE $(Q)rm -f $@ - $(Q)echo $(kernelrelease) > $@ + $(Q)echo $(KERNELVERSION)$(localversion) > $@ Doxyfile.version: include/config/auto.conf FORCE $(Q)rm -f $@ |