From 1338b0ca40ad6f353a480314ee7e8c84da1aaf96 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Yadav Date: Sun, 7 Mar 2021 23:26:16 +0530 Subject: [PATCH] Fixed bugs in escaping - makefile --- GNUmakefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 60da681..09bfb5f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -12,11 +12,16 @@ dwmblocks: dwmblocks.c config.h block.h ${CC} -o $@ -Wno-missing-field-initializers -Wno-unused-parameter ${CFLAGS} ${X11CFLAGS} $< ${X11LIBS} E0BLOCKS = $(abspath blocks) -# two level escaping of '\', one for sed and one for C +# two level escaping of `\', one for sed and one for C E1BLOCKS = $(subst \,\\\\,${E0BLOCKS}) -# escaping special character '&' and delimiter '=' for sed -E2BLOCKS = $(subst &,\&,${E1BLOCKS}) -EFBLOCKS = $(subst =,\=,${E2BLOCKS}) +# escaping special character `&' and delimiter `=' for sed +E3BLOCKS = $(subst &,\&,${E2BLOCKS}) +E4BLOCKS = $(subst =,\=,${E3BLOCKS}) +# escaping `"' for C +E2BLOCKS = $(subst ",\\",${E1BLOCKS}) +# escaping `'' for shell +EFBLOCKS = $(subst ','\'',${E4BLOCKS}) +# this comment is a workaround for syntax highlighting bug in vim') config.h: sed '2s==${EFBLOCKS}=' config.def.h >$@