Only create blocks when creating config.h

This commit is contained in:
Ashish Kumar Yadav 2021-04-22 18:27:19 +05:30
parent 76569ceb4a
commit 7ce14b2d36

View file

@ -8,12 +8,9 @@ X11LIBS = $(shell pkg-config --libs x11)
all: dwmblocks sigdwmblocks/sigdwmblocks xgetrootname/xgetrootname all: dwmblocks sigdwmblocks/sigdwmblocks xgetrootname/xgetrootname
dwmblocks: dwmblocks.c blocks config.h block.h dwmblocks: dwmblocks.c config.h block.h
${CC} -o $@ -Wno-missing-field-initializers -Wno-unused-parameter ${CFLAGS} ${X11CFLAGS} $< ${X11LIBS} ${CC} -o $@ -Wno-missing-field-initializers -Wno-unused-parameter ${CFLAGS} ${X11CFLAGS} $< ${X11LIBS}
blocks:
cp -r blocks.def $@
E0BLOCKS = $(abspath blocks) 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}) E1BLOCKS = $(subst \,\\\\,${E0BLOCKS})
@ -27,6 +24,7 @@ EFBLOCKS = $(subst ','\'',${E4BLOCKS})
# this comment is a workaround for syntax highlighting bug in vim') # this comment is a workaround for syntax highlighting bug in vim')
config.h: config.h:
[ -d blocks ] || cp -R blocks.def blocks
sed '2s=<path to the folder containing block scripts>=${EFBLOCKS}=' config.def.h >$@ sed '2s=<path to the folder containing block scripts>=${EFBLOCKS}=' config.def.h >$@
sigdwmblocks/sigdwmblocks: sigdwmblocks/sigdwmblocks.c sigdwmblocks/sigdwmblocks: sigdwmblocks/sigdwmblocks.c