[CRIU] [PATCH 4/6] gen-offsets.h: move arguments from Makefile to the script

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


Makes invocation way easier.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 Makefile       |   16 ++++------------
 gen-offsets.sh |   11 ++++++-----
 2 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/Makefile b/Makefile
index 2f4d1f3..2538f81 100644
--- a/Makefile
+++ b/Makefile
@@ -89,12 +89,8 @@ $(HEAD-BIN): $(HEAD-LDS) $(OBJS-BLOB) parasite-util-net.o
 
 $(HEAD-BLOB-GEN): $(HEAD-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
-	$(Q) $(SH) $(GEN-OFFSETS)			\
-		parasite_h__				\
-		parasite_blob_offset__			\
-		parasite_blob				\
-		$(OBJS-BLOB)				\
-		$(HEAD-BIN) > parasite-blob.h
+	$(Q) $(SH) $(GEN-OFFSETS) parasite	\
+		> parasite-blob.h
 	$(Q) sync
 
 $(ROBJS): $(RSRCS-BLOB)
@@ -107,12 +103,8 @@ $(RHEAD-BIN): $(ROBJS) $(RHEAD-LDS)
 
 $(RHEAD-BLOB-GEN): $(RHEAD-BIN) $(GEN-OFFSETS)
 	$(E) "  GEN     " $@
-	$(Q) $(SH) $(GEN-OFFSETS)			\
-		restorer_h__				\
-		restorer_blob_offset__			\
-		restorer_blob				\
-		$(ROBJS-BLOB)				\
-		$(RHEAD-BIN) > restorer-blob.h
+	$(Q) $(SH) $(GEN-OFFSETS) restorer	\
+		> restorer-blob.h
 	$(Q) sync
 
 %.o: %.c
diff --git a/gen-offsets.sh b/gen-offsets.sh
index 838f986..083d4ff 100644
--- a/gen-offsets.sh
+++ b/gen-offsets.sh
@@ -1,10 +1,11 @@
 #!/bin/sh
 
-INC_GUARD=$1
-PREFIX=$2
-BLOB=$3
-OBJNAME=$4
-BINARY=$5
+NAME=$1
+INC_GUARD=__${NAME}_h__
+PREFIX=${NAME}_blob_offset__
+BLOB=${NAME}_blob
+OBJNAME=${NAME}.o
+BINARY=${NAME}.bin
 
 AWK_CMD='$2 ~ /^[tT]$/ { print "#define '$PREFIX'" $3 " 0x" $1; }'
 
-- 
1.7.7.6



More information about the CRIU mailing list