[CRIU] [PATCH 3/3] make: Split generation of %.bin and %.bin.o into two rules

Cyrill Gorcunov gorcunov at openvz.org
Wed Apr 18 10:46:21 EDT 2012


This allows to have more detailed control over files
generated and might be extended in future.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile.pie |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/Makefile.pie b/Makefile.pie
index 5f348d4..d349425 100644
--- a/Makefile.pie
+++ b/Makefile.pie
@@ -9,6 +9,7 @@ PSRCS		+= $(patsubst %.o,%.c,$(POBJS))
 PBLOB-NAME	:= parasite
 PBLOB-HDR	:= parasite-blob.h
 PBLOB-BIN	:= parasite.bin
+PBLOB-BIN-O	:= $(PBLOB-BIN).o
 
 ROBJS		+= restorer.o
 ROBJS		+= restorer-log.o
@@ -17,6 +18,7 @@ RSRCS		+= $(patsubst %.o,%.c,$(ROBJS))
 RBLOB-NAME	:= restorer
 RBLOB-HDR	:= restorer-blob.h
 RBLOB-BIN	:= restorer.bin
+RBLOB-BIN-O	:= $(RBLOB-BIN).o
 
 DEPS		+= $(patsubst %.o,%.d,$(POBJS))
 DEPS		+= $(patsubst %.o,%.d,$(ROBJS))
@@ -39,11 +41,14 @@ parasite-util-net.o: util-net.c $(SYS-OBJ)
 
 POBJS		+= parasite-util-net.o
 
-$(PBLOB-BIN): $(PIELDS) $(POBJS) $(PASM-OBJS)
+$(PBLOB-BIN-O): $(PIELDS) $(POBJS) $(PASM-OBJS)
 	$(E) "  GEN     " $@
-	$(Q) $(LD) --oformat=binary -T $(PIELDS) -o $(PBLOB-BIN) $(POBJS) $(PASM-OBJS) $(SYS-OBJ)
 	$(Q) $(LD) --oformat=elf64-x86-64 -T $(PIELDS) -o $(PBLOB-BIN).o $(POBJS) $(PASM-OBJS) $(SYS-OBJ)
 
+$(PBLOB-BIN): $(PBLOB-BIN-O) $(PIELDS) $(POBJS) $(PASM-OBJS)
+	$(E) "  GEN     " $@
+	$(Q) $(LD) --oformat=binary -T $(PIELDS) -o $(PBLOB-BIN) $(POBJS) $(PASM-OBJS) $(SYS-OBJ)
+
 $(PBLOB-HDR): $(PBLOB-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
 	$(Q) $(SH) $(GEN-OFFSETS) $(PBLOB-NAME) > $@ || rm -f $@
@@ -52,11 +57,14 @@ $(ROBJS): $(RSRCS) $(SYS-OBJ)
 	$(E) "  CC      " $@
 	$(Q) $(CC) -c $(CFLAGS) $(PIEFLAGS) $(patsubst %.o,%.c,$@) -o $@
 
-$(RBLOB-BIN): $(PIELDS) $(ROBJS)
+$(RBLOB-BIN-O): $(PIELDS) $(ROBJS)
 	$(E) "  GEN     " $@
-	$(Q) $(LD) --oformat=binary -T $(PIELDS) -o $(RBLOB-BIN) $(ROBJS) $(SYS-OBJ)
 	$(Q) $(LD) --oformat=elf64-x86-64 -T $(PIELDS) -o $(RBLOB-BIN).o $(ROBJS) $(SYS-OBJ)
 
+$(RBLOB-BIN): $(RBLOB-BIN-O) $(PIELDS) $(ROBJS)
+	$(E) "  GEN     " $@
+	$(Q) $(LD) --oformat=binary -T $(PIELDS) -o $(RBLOB-BIN) $(ROBJS) $(SYS-OBJ)
+
 $(RBLOB-HDR): $(RBLOB-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
 	$(Q) $(SH) $(GEN-OFFSETS) $(RBLOB-NAME) > $@ || rm -f $@
-- 
1.7.7.6



More information about the CRIU mailing list