criu/scripts/Makefile.version
Pavel Emelyanov 47eac37e8b make: Move criu version constants from scripts/ to root Makefile
It's nicer to have them there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-19 18:14:26 +04:00

22 lines
993 B
Text

CRTOOLSVERSION := $(VERSION_MAJOR)$(if $(VERSION_MINOR),.$(VERSION_MINOR))$(if $(VERSION_SUBLEVEL),.$(VERSION_SUBLEVEL))
VERSION_HEADER := include/version.h
$(VERSION_HEADER): Makefile scripts/Makefile.version
$(E) " GEN " $@
$(Q) echo "/* Autogenerated, do not edit */" > $(VERSION_HEADER)
$(Q) echo "#ifndef __CR_VERSION_H__" >> $(VERSION_HEADER)
$(Q) echo "#define __CR_VERSION_H__" >> $(VERSION_HEADER)
$(Q) echo "static char version[] = {" >> $(VERSION_HEADER)
$(Q) echo \"$(CRTOOLSVERSION)\" >> $(VERSION_HEADER)
$(Q) echo "};" >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MAJOR " $(VERSION_MAJOR) >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MINOR " $(VERSION_MINOR) >> $(VERSION_HEADER)
$(Q) echo "#endif /* __CR_VERSION_H__ */" >> $(VERSION_HEADER)
##
## 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