make: Simplify ARCH retrieval

Actually the former code was being expanding
uname_M variable which is not set that early
(this was not a problem since we assign it a
line below, still it was a dead code which
should be fixed).

Also update

 | ifeq ($(findstring arm,$(ARCH)),arm)

to simple

 | ifeq ($(ARCH),arm)

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: protobuf -- Mangle integer constant on ARM only

It's known to work on x86-64 so make the build procedure
a bit faster here.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: protobuf -- Generate protofiles deps

Some protobuf files do import another files so
we should generate dependencies and rebuild
the program when needed.

For example core.proto imports core-x86.proto
and core-arm.proto, thus if any of them are
changed the final core.pb-c.c should be regenerated.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: protobuf -- Order .c files generation

This patch introduce dependencies on .c files
generation parsing import keywords in .proto
files.

In particular, the core.proto file refers to
core-x86.proto which means we need to generate
.[c|h] files from core-x86.proto earlier than
handlig of core.proto.

A positive side effect of this patch is that
the compilation is independent now of order the
proto files are declated in the make file.

Instead of currently present manual order

PROTO_FILES	+= core-x86.proto
PROTO_FILES	+= core-arm.proto
PROTO_FILES	+= core.proto

one can write it in any arrangement, say

PROTO_FILES     += core.proto
PROTO_FILES     += core-arm.proto
PROTO_FILES     += core-x86.proto

and it still be resolved correctly.

BUT beware of circular import directives,
we can't handle them now.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>