-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (43 loc) · 1.63 KB
/
Makefile
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
49
50
51
52
53
54
# dwmasyncblocks
# See LICENCE file for copyright and license details.
PREFIX := /usr/local
MANPREFIX = ${PREFIX}/share/man
CC := cc
CFLAGS := -pedantic -Wall -Wno-deprecated-declarations -Os
LDFLAGS := -lX11
all: options dwmblocks dwmblocksctl
options:
@echo dwmblocks build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
dwmblocks: main.c config.h
@echo making dwmblocks
@${CC} -o dwmblocks main.c ${CFLAGS} ${LDFLAGS}
dwmblocksctl: dwmblocksctl.c config.h
@echo making dwmblocksctl
@${CC} -o dwmblocksctl dwmblocksctl.c ${CFLAGS}
clean:
@echo cleaning
@rm -f *.o *.gch dwmblocks dwmblocksctl
install: dwmblocks dwmblocksctl
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f dwmblocks ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocks
@cp -f dwmblocksctl ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/dwmblocksctl
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@cp -f dwmblocks.1 ${DESTDIR}${MANPREFIX}/man1/dwmblocks.1
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwmblocks.1
@cp -f dwmblocksctl.1 ${DESTDIR}${MANPREFIX}/man1/dwmblocksctl.1
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwmblocksctl.1
uninstall:
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/dwmblocks
@rm -f ${DESTDIR}${PREFIX}/bin/dwmblocksctl
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
@rm -f ${DESTDIR}${MANPREFIX}/man1/dwmblocks.1
@rm -f ${DESTDIR}${MANPREFIX}/man1/dwmblocksctl.1
.PHONY: all options clean install uninstall