[CRIU] [PATCH v5 3/5] make: move pie files and build to separated directory
Kinsbursky Stanislav
skinsbursky at openvz.org
Wed Nov 21 07:50:56 EST 2012
From: Stanislav Kinsbursky <skinsbursky at openvz.org>
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
Makefile | 7 +++----
pie/Makefile | 15 +++++++++++----
pie/gen-offsets.sh | 0
pie/log-simple.c | 0
pie/parasite-head-x86-64.S | 0
pie/parasite.c | 0
pie/pie.lds.S | 0
pie/restorer.c | 2 +-
8 files changed, 15 insertions(+), 9 deletions(-)
rename Makefile.pie => pie/Makefile (90%)
rename gen-offsets.sh => pie/gen-offsets.sh (100%)
rename log-simple.c => pie/log-simple.c (100%)
rename parasite-head-x86-64.S => pie/parasite-head-x86-64.S (100%)
rename parasite.c => pie/parasite.c (100%)
rename pie.lds.S => pie/pie.lds.S (100%)
rename restorer.c => pie/restorer.c (99%)
-------------- next part --------------
diff --git a/Makefile b/Makefile
index bed7ee1..e425858 100644
--- a/Makefile
+++ b/Makefile
@@ -46,8 +46,6 @@ OBJS += tty.o
DEPS := $(patsubst %.o,%.d,$(OBJS))
-include Makefile.pie
-
.PHONY: all zdtm test rebuild clean distclean tags cscope \
docs help pie protobuf x86
@@ -55,7 +53,7 @@ all: pie
$(Q) $(MAKE) $(PROGRAM)
pie: protobuf $(ARCH)
- $(Q) $(MAKE) $(PIE-GEN)
+ $(Q) $(MAKE) -C pie/
protobuf:
$(Q) $(MAKE) -C protobuf/
@@ -97,7 +95,7 @@ rebuild:
$(Q) $(RM) -f ./protobuf/*.pb-c.h
$(Q) $(MAKE)
-clean: cleanpie
+clean:
$(E) " CLEAN"
$(Q) $(RM) -f ./*.o
$(Q) $(RM) -f ./*.d
@@ -109,6 +107,7 @@ clean: cleanpie
$(Q) $(RM) -rf ./test/dump/
$(Q) $(MAKE) -C protobuf/ clean
$(Q) $(MAKE) -C arch/x86/ clean
+ $(Q) $(MAKE) -C pie/ clean
$(Q) $(MAKE) -C test/zdtm cleandep
$(Q) $(MAKE) -C test/zdtm clean
$(Q) $(MAKE) -C test/zdtm cleanout
diff --git a/Makefile.pie b/pie/Makefile
similarity index 90%
rename from Makefile.pie
rename to pie/Makefile
index 99e3593..819cca7 100644
--- a/Makefile.pie
+++ b/pie/Makefile
@@ -1,3 +1,7 @@
+include ../Makefile.inc
+
+CFLAGS += -I../include/ -I../protobuf/ -I../syscall/
+
GEN-OFFSETS := gen-offsets.sh
PASM-OBJS += parasite-head-x86-64.o
@@ -27,6 +31,8 @@ PIELDS := pie.lds.S
PIEFLAGS := -fpie -Wa,--noexecstack -fno-strict-aliasing
ASMFLAGS := -D__ASSEMBLY__
+.DEFAULT_GOAL := pie
+
$(PASM-OBJS): $(PASM-SRC) $(SYSCALL-LIB)
$(E) " CC " $@
$(Q) $(CC) -c $(ASMFLAGS) $(CFLAGS) $(PIEFLAGS) $(patsubst %.o,%.S,$@) -o $@
@@ -35,7 +41,7 @@ $(POBJS): $(PSRCS) $(PASM-OBJS) $(SYSCALL-LIB)
$(E) " CC " $@
$(Q) $(CC) -c $(CFLAGS) $(PIEFLAGS) $(patsubst %.o,%.c,$@) -o $@
-parasite-util-net.o: util-net.c $(SYSCALL-LIB)
+parasite-util-net.o: $(SRC_DIR)/util-net.c $(SYSCALL-LIB)
$(E) " CC " $@
$(Q) $(CC) -c $(CFLAGS) $(PIEFLAGS) $< -o $@
@@ -73,12 +79,13 @@ $(RBLOB-HDR): $(RBLOB-BIN) $(GEN-OFFSETS)
$(E) " GEN " $@
$(Q) $(SH) $(GEN-OFFSETS) $(RBLOB-NAME) > $@ || rm -f $@
-PIE-GEN := $(PBLOB-HDR) $(RBLOB-HDR)
+pie: $(PBLOB-HDR) $(RBLOB-HDR)
-cleanpie:
+clean:
$(E) " CLEAN PIE"
$(Q) $(RM) -f ./$(PBLOB-HDR)
$(Q) $(RM) -f ./$(RBLOB-HDR)
+ $(Q) $(RM) -f ./*.o
$(Q) $(RM) -f ./*.bin
$(Q) $(RM) -f ./*.bin.o
-.PHONY: cleanpie
+.PHONY: clean pie
diff --git a/gen-offsets.sh b/pie/gen-offsets.sh
similarity index 100%
rename from gen-offsets.sh
rename to pie/gen-offsets.sh
diff --git a/log-simple.c b/pie/log-simple.c
similarity index 100%
rename from log-simple.c
rename to pie/log-simple.c
diff --git a/parasite-head-x86-64.S b/pie/parasite-head-x86-64.S
similarity index 100%
rename from parasite-head-x86-64.S
rename to pie/parasite-head-x86-64.S
diff --git a/parasite.c b/pie/parasite.c
similarity index 100%
rename from parasite.c
rename to pie/parasite.c
diff --git a/pie.lds.S b/pie/pie.lds.S
similarity index 100%
rename from pie.lds.S
rename to pie/pie.lds.S
diff --git a/restorer.c b/pie/restorer.c
similarity index 99%
rename from restorer.c
rename to pie/restorer.c
index 7b2d3ef..85a6da4 100644
--- a/restorer.c
+++ b/pie/restorer.c
@@ -25,7 +25,7 @@
#include "lock.h"
#include "restorer.h"
-#include "protobuf/creds.pb-c.h"
+#include "creds.pb-c.h"
#define sys_prctl_safe(opcode, val1, val2, val3) \
({ \
More information about the CRIU
mailing list