[CRIU] [PATCH] make: protobuf -- Escape slashes to future needs

Cyrill Gorcunov gorcunov at openvz.org
Fri Nov 8 05:37:28 PST 2013


At moment we generate protobuf dependencies having in
mind that protobuf/ directory is _always_ in the source
code root. This may change one day in future so better to
be on safe side and escape slashes immediately.

I meet this problem when been needed to build protobuf
builtin in $(root)/src/protobuf directory.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 protobuf/Makefile | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/protobuf/Makefile b/protobuf/Makefile
index 9a90087fca25..60e1919ec0b4 100644
--- a/protobuf/Makefile
+++ b/protobuf/Makefile
@@ -66,19 +66,19 @@ proto-h		:= $(proto-obj-y:.o=.pb-c.h)
 
 $(obj)/%.proto.d: $(obj)/%.proto
 	$(E) "  PB DDEP " $@
-	$(Q) grep "^[[:blank:]]*import[[:blank:]]" $^ | sed	  		  \
-		-e 's/[[:blank:]]*import[[:blank:]]*//' 			  \
-		-e 's/[\";]//g'							  \
-		-e 's/.*/$(subst /,\/,$^):$(obj)\/&/'				| \
+	$(Q) grep "^[[:blank:]]*import[[:blank:]]" $^ | sed	  				  \
+		-e 's/[[:blank:]]*import[[:blank:]]*//' 					  \
+		-e 's/[\";]//g'									  \
+		-e 's/.*/$(subst /,\/,$^):$(subst /,\/,$(obj))\/&/'				| \
 		uniq > $@
 
 $(obj)/%.proto.c.d: $(obj)/%.proto | $(obj)/%.proto.d
 	$(E) "  PB DEP  " $@
-	$(Q) grep "^[[:blank:]]*import[[:blank:]]" $< | sed	  		  \
-		-e 's/[[:blank:]]*import[[:blank:]]*//' 			  \
-		-e 's/.proto/.pb-c.c/'	  					  \
-		-e 's/[\";]//g'		  					  \
-		-e 's/.*/$(subst .proto,.pb-c.c,$(subst /,\/,$<)):$(obj)\/&/'	| \
+	$(Q) grep "^[[:blank:]]*import[[:blank:]]" $< | sed	  				  \
+		-e 's/[[:blank:]]*import[[:blank:]]*//' 					  \
+		-e 's/.proto/.pb-c.c/'	  							  \
+		-e 's/[\";]//g'		  							  \
+		-e 's/.*/$(subst .proto,.pb-c.c,$(subst /,\/,$<)):$(subst /,\/,$(obj))\/&/'	| \
 		uniq > $@
 
 $(obj)/%.pb-c.c $(obj)/%.pb-c.h: $(obj)/%.proto $(obj)/%.proto.c.d
-- 
1.8.3.1



More information about the CRIU mailing list