[CRIU] [PATCH 3/6] Makefile: introduce, depend on and use GEN_OFFSETS

Kir Kolyshkin kir at openvz.org
Tue Feb 21 17:09:14 EST 2012


1. We need to regenerate *-blob.h files if generating script changes

2. Do not use hardcoded script name

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 Makefile |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 3486a73..2f4d1f3 100644
--- a/Makefile
+++ b/Makefile
@@ -71,6 +71,8 @@ DEPS		:= $(patsubst %.o,%.d,$(OBJS))		\
        		   $(patsubst %.o,%.d,$(OBJS-BLOB))	\
 		   $(patsubst %.o,%.d,$(ROBJS-BLOB))
 
+GEN-OFFSETS	:= gen-offsets.sh
+
 all: $(PROGRAM)
 
 $(OBJS-BLOB): $(SRCS-BLOB)
@@ -85,9 +87,9 @@ $(HEAD-BIN): $(HEAD-LDS) $(OBJS-BLOB) parasite-util-net.o
 	$(E) "  GEN     " $@
 	$(Q) $(LD) -T $^ -o $@
 
-$(HEAD-BLOB-GEN): $(HEAD-BIN)
+$(HEAD-BLOB-GEN): $(HEAD-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
-	$(Q) $(SH) gen-offsets.sh			\
+	$(Q) $(SH) $(GEN-OFFSETS)			\
 		parasite_h__				\
 		parasite_blob_offset__			\
 		parasite_blob				\
@@ -103,9 +105,9 @@ $(RHEAD-BIN): $(ROBJS) $(RHEAD-LDS)
 	$(E) "  GEN     " $@
 	$(Q) $(LD) -T $(patsubst %.bin,%.lds.S,$@) -o $@ $(ROBJS)
 
-$(RHEAD-BLOB-GEN): $(RHEAD-BIN)
+$(RHEAD-BLOB-GEN): $(RHEAD-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
-	$(Q) $(SH) gen-offsets.sh			\
+	$(Q) $(SH) $(GEN-OFFSETS)			\
 		restorer_h__				\
 		restorer_blob_offset__			\
 		restorer_blob				\
-- 
1.7.7.6



More information about the CRIU mailing list