-
Notifications
You must be signed in to change notification settings - Fork 13
/
GNUmakefile
48 lines (33 loc) · 1.36 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PREFIX = /usr/local
CC = gcc
CFLAGS = -O3 -Wall -Wextra
X11CFLAGS = $(shell pkg-config --cflags x11)
X11LIBS = $(shell pkg-config --libs x11)
BLOCKS := $(wildcard blocks/*.c)
all: dsblocks sigdsblocks/sigdsblocks xgetrootname/xgetrootname
dsblocks.o: dsblocks.c shared.h sigvals.h config.h block.h
${CC} -o $@ -c -Wno-missing-field-initializers -Wno-unused-parameter ${CFLAGS} ${X11CFLAGS} $<
util.o: util.c util.h shared.h sigvals.h
${CC} -o $@ -c ${CFLAGS} ${X11CFLAGS} $<
blocks/%.o: blocks/%.c blocks/%.h util.h shared.h sigvals.h
${CC} -o $@ -c -Wno-unused-parameter ${CFLAGS} $<
dsblocks: dsblocks.o util.o ${BLOCKS:c=o}
${CC} -o $@ $^ ${X11LIBS}
sigdsblocks/sigdsblocks: sigdsblocks/sigdsblocks.c sigvals.h
${CC} -o $@ ${CFLAGS} $<
xgetrootname/xgetrootname: xgetrootname/xgetrootname.c
${CC} -o $@ ${CFLAGS} ${X11CFLAGS} $< ${X11LIBS}
clean:
rm -f blocks/*.o *.o dsblocks sigdsblocks/sigdsblocks xgetrootname/xgetrootname
BINDIR = ${DESTDIR}${PREFIX}/bin
PIDDIR = ${DESTDIR}/var/local/dsblocks
install: all
mkdir -p ${BINDIR}
cp -f dsblocks sigdsblocks/sigdsblocks xgetrootname/xgetrootname ${BINDIR}
chmod 755 ${BINDIR}/dsblocks ${BINDIR}/sigdsblocks ${BINDIR}/xgetrootname
mkdir -p ${PIDDIR}
chmod 777 ${PIDDIR}
uninstall:
rm -f ${BINDIR}/dsblocks ${BINDIR}/sigdsblocks ${BINDIR}/xgetrootname
rm -df ${PIDDIR} || exit 0
.PHONY: all clean install uninstall