make: Add scripts/Makefile.rules

Suitable when needed to build rules with subdirectories.
We will use it alot for new make scheme.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
make: Use scripts/Makefile.rules

To eliminate code duplication.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
make: Add scripts/Make.build helper

This script contains of vatious helpers which allow us
to write makefiles in simplified way. It will generate
all rules we need.

There are a few variables the script operates with. Better
to explain them with example. Lets consider the following
tree

$(buildroot)
	arch/
		x86/
			parasite.c
	scripts/
	pie/
		Makefile
		parasite.c

 - "obj-y": the object file which is always compiled in the
   directory the Makefile (where obj-y is used) lays on, this
   is the case for pie/parasite.c. When compiling the builder
   will add pie/ prefix to obj-y files.

 - "obj-e": the object file which is always compiled but lays
   on some different directory. For example above it's a case
   for arch/x86/parasite.c. No additional prefixes will be added
   by script.

 - "asm-y", "asm-e": same as obj, but for .S files
 - "lib-e": external library file we need to link with when
   produce builtin targets.

Also, if there are several targets which need to be built in
some directory, the builder supports that named "targeted" rules.

Typical use

	targets += parasite
	targets += restorer

	obj-y += log-simple.o
	obj-y += util-net.o

	parasite-obj-y	+= parasite.o
	parasite-asm-e	+= $(ARCH_DIR)/parasite-head.o
	lib-e		+= $(SYSCALL-LIB)

	restorer-obj-y	+= restorer.o
	restorer-obj-e	+= $(ARCH_DIR)/restorer.o

here two targets need to be built -- parasite and restorer,
both share obj-y,lib-e files but have some differences in other
aspects so we describe per-target additional object files.

When building the script will link two targets -- parasite.built-in.o
and restorer.built-in.o.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
make: pie -- Switch to new build scheme

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
zdtm: make -- Add -f key on clean* ops

Otherwise if no such files present I'm getting warnings.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
make: Generate crtools version from Makefile definition

This allows us to have a unique place where version lives
and what is more important other subsystems (such as docs
generation) may reuse version definitions.

At moment EXTRA (which corresponds kernels -rc tag) and
NAME is not yet used, but I desided to put them in place
for future needs.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Add include/version.h to .gitignore

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
make: Add scripts/Makefile.protobuf

This script will be needed for reworked
protobuf library building. The main idea
is to make the overall building procedure
close to one the kernel uses.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
make: protobuf -- Switch to new build scheme

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>