2013-02-11 19:24:06 +04:00
|
|
|
CRTOOLSVERSION := $(VERSION_MAJOR)$(if $(VERSION_MINOR),.$(VERSION_MINOR))$(if $(VERSION_SUBLEVEL),.$(VERSION_SUBLEVEL))
|
|
|
|
|
|
|
|
VERSION_HEADER := include/version.h
|
2013-09-14 15:01:32 +04:00
|
|
|
GITID := $(shell if [ -d ".git" ]; then git reflog -n 1 | cut -f1 -d' '; fi)
|
|
|
|
ifeq ($(GITID),)
|
|
|
|
GITID := 0
|
|
|
|
endif
|
2013-02-11 19:24:06 +04:00
|
|
|
|
2013-02-19 18:14:26 +04:00
|
|
|
$(VERSION_HEADER): Makefile scripts/Makefile.version
|
2013-02-11 19:24:06 +04:00
|
|
|
$(E) " GEN " $@
|
2013-12-11 14:03:12 -08:00
|
|
|
$(Q) echo "/* Autogenerated, do not edit */" > $(VERSION_HEADER)
|
2013-02-11 19:24:06 +04:00
|
|
|
$(Q) echo "#ifndef __CR_VERSION_H__" >> $(VERSION_HEADER)
|
|
|
|
$(Q) echo "#define __CR_VERSION_H__" >> $(VERSION_HEADER)
|
2013-09-14 15:00:17 +04:00
|
|
|
$(Q) echo "#define CRIU_VERSION \"$(CRTOOLSVERSION)\"" >> $(VERSION_HEADER)
|
2013-02-11 19:24:06 +04:00
|
|
|
$(Q) echo "#define CRIU_VERSION_MAJOR " $(VERSION_MAJOR) >> $(VERSION_HEADER)
|
|
|
|
$(Q) echo "#define CRIU_VERSION_MINOR " $(VERSION_MINOR) >> $(VERSION_HEADER)
|
2013-09-14 15:01:32 +04:00
|
|
|
$(Q) echo "#define CRIU_GITID \"$(GITID)\"" >> $(VERSION_HEADER)
|
2013-02-11 19:24:06 +04:00
|
|
|
$(Q) echo "#endif /* __CR_VERSION_H__ */" >> $(VERSION_HEADER)
|
2013-02-15 23:40:24 +04:00
|
|
|
|
|
|
|
##
|
|
|
|
## In case if someone add last resort rule
|
|
|
|
## together with .SUFFIXES not cleaned, this
|
|
|
|
## will slow down the build procedure
|
|
|
|
scripts/Makefile.version::
|
|
|
|
@echo > /dev/null
|