[CRIU] [PATCH v4 4/4] make: insert Makefile.inc into Makefile

Kinsbursky Stanislav skinsbursky at openvz.org
Mon Nov 19 10:35:32 EST 2012


From: Stanislav Kinsbursky <skinsbursky at openvz.org>

Makefile.inc is included only into Makefile now. So let's insert it's content
into Makefile itself.
This patch also does some cleanup.

Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
 Makefile          |   79 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 Makefile.inc      |   76 ---------------------------------------------------
 protobuf/Makefile |    4 +--
 3 files changed, 76 insertions(+), 83 deletions(-)
 delete mode 100644 Makefile.inc
-------------- next part --------------
diff --git a/Makefile b/Makefile
index 36a103a..ef6a7fb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,77 @@
-include Makefile.inc
+#
+# Common definitions
+#
+
+ifeq ($(strip $(V)),)
+	E = @echo
+	Q = @
+else
+	E = @\#
+	Q =
+endif
+
+FIND		:= find
+CSCOPE		:= cscope
+TAGS		:= ctags
+RM		:= rm
+LD		:= ld
+HEXDUMP		:= hexdump
+CC		:= gcc
+ECHO		:= echo
+NM		:= nm
+AWK		:= awk
+SH		:= sh
+MAKE		:= make
+
+# Additional ARCH settings for x86
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+                  -e s/arm.*/arm/ -e s/sa110/arm/ \
+                  -e s/s390x/s390/ -e s/parisc64/parisc/ \
+                  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
+                  -e s/sh[234].*/sh/ )
+
+uname_M      := $(shell uname -m | sed -e s/i.86/i386/)
+ifeq ($(uname_M),i386)
+	ARCH         := x86
+	DEFINES      := -DCONFIG_X86_32
+endif
+ifeq ($(uname_M),x86_64)
+	ARCH         := x86_64
+	DEFINES      := -DCONFIG_X86_64
+endif
+
+SRC_DIR		= $(shell pwd)
+
+CFLAGS		= -I$(SRC_DIR)/include -fno-strict-aliasing
+
+LIBS		+= -lrt -lpthread -lprotobuf-c
+
+DEFINES		+= -D_FILE_OFFSET_BITS=64
+DEFINES		+= -D_GNU_SOURCE
+
+WARNINGS	:= -Wall
+
+ifneq ($(WERROR),0)
+	WARNINGS += -Werror
+endif
+
+ifeq ($(DEBUG),1)
+	DEFINES += -DCR_DEBUG
+endif
+
+ifeq ($(DEBUG),1)
+	DEFINES += -DCR_DEBUG
+	CFLAGS	+= -O0 -ggdb3
+else
+	CFLAGS	+= -O2
+endif
+
+CFLAGS		+= $(WARNINGS) $(DEFINES)
+MAKEFLAGS	+= --no-print-directory
+SYSCALL-LIB	?= $(SRC_DIR)/x86_64/syscall-x86-64.o
+PROTOBUF-LIB	:= $(SRC_DIR)/protobuf/protobuf-lib.o
+
+export E Q CC ECHO MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS SRC_DIR SYSCALL-LIB SH
 
 PROGRAM		:= crtools
 
@@ -44,8 +117,6 @@ OBJS		+= pstree.o
 OBJS		+= protobuf.o
 OBJS		+= tty.o
 
-PROTOBUF-LIB	:= protobuf/protobuf-lib.o
-
 DEPS		:= $(patsubst %.o,%.d,$(OBJS))
 
 .PHONY: all zdtm test rebuild clean distclean tags cscope	\
@@ -123,7 +194,7 @@ distclean: clean
 tags:
 	$(E) "  GEN" $@
 	$(Q) $(RM) -f tags
-	$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' -print | xargs ctags -a
+	$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' -print | xargs $(TAGS) -a
 
 cscope:
 	$(E) "  GEN" $@
diff --git a/Makefile.inc b/Makefile.inc
deleted file mode 100644
index bae9a36..0000000
--- a/Makefile.inc
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Common definitions
-#
-
-ifeq ($(strip $(V)),)
-	E = @echo
-	Q = @
-else
-	E = @\#
-	Q =
-endif
-export E Q
-
-FIND		:= find
-CSCOPE		:= cscope
-TAGS		:= ctags
-RM		:= rm
-LD		:= ld
-HEXDUMP		:= hexdump
-CC		:= gcc
-ECHO		:= echo
-NM		:= nm
-AWK		:= awk
-SH		:= sh
-MAKE		:= make
-
-# Additional ARCH settings for x86
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-                  -e s/arm.*/arm/ -e s/sa110/arm/ \
-                  -e s/s390x/s390/ -e s/parisc64/parisc/ \
-                  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-                  -e s/sh[234].*/sh/ )
-
-uname_M      := $(shell uname -m | sed -e s/i.86/i386/)
-ifeq ($(uname_M),i386)
-	ARCH         := x86
-	DEFINES      += -DCONFIG_X86_32
-endif
-ifeq ($(uname_M),x86_64)
-	ARCH         := x86_64
-	DEFINES      += -DCONFIG_X86_64
-endif
-
-no-deps-targets := tags cscope clean cleanout cleandep realclean
-
-SRC_DIR		?= $(shell pwd)
-
-CFLAGS		+= -I$(SRC_DIR)/include -fno-strict-aliasing
-
-LIBS		+= -lrt -lpthread -lprotobuf-c
-
-DEFINES		+= -D_FILE_OFFSET_BITS=64
-DEFINES		+= -D_GNU_SOURCE
-
-ifneq ($(WERROR),0)
-	WARNINGS += -Werror
-endif
-
-ifeq ($(DEBUG),1)
-	DEFINES += -DCR_DEBUG
-endif
-
-ifeq ($(DEBUG),1)
-	DEFINES += -DCR_DEBUG
-	CFLAGS	+= -O0 -ggdb3
-else
-	CFLAGS	+= -O2
-endif
-
-WARNINGS	+= -Wall
-CFLAGS		+= $(WARNINGS) $(DEFINES)
-MAKEFLAGS	+= --no-print-directory
-SYSCALL-LIB	?= $(SRC_DIR)/x86_64/syscall-x86-64.o
-
-export CC ECHO MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS SRC_DIR SYSCALL-LIB SH
-
diff --git a/protobuf/Makefile b/protobuf/Makefile
index 6a7f297..c5e9314 100644
--- a/protobuf/Makefile
+++ b/protobuf/Makefile
@@ -1,5 +1,3 @@
-include ../Makefile.inc
-
 PROTO_LIBRARY	:= protobuf-lib.o
 
 PROTO_FILES	+= inventory.proto
@@ -58,7 +56,7 @@ PROTO_OBJS	:= $(patsubst %.c,%.o,$(PROTO_SRCS))
 
 $(PROTO_LIBRARY): $(PROTO_OBJS)
 	$(E) "  LINK     "$@
-	$(Q) ld -r -o $@ $(PROTO_OBJS)
+	$(Q) $(LD) -r -o $@ $(PROTO_OBJS)
 
 .PHONY: protobuf
 


More information about the CRIU mailing list