-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (33 loc) · 1.04 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
# This snippet has been shmelessly stol^Hborrowed from thestinger's repose Makefile
VERSION = 1.1
GIT_DESC=$(shell test -d .git && git describe --always 2>/dev/null)
ifneq "$(GIT_DESC)" ""
VERSION=$(GIT_DESC)
endif
CC ?= gcc
CFLAGS += -Wall -std=gnu99 -Os -DVERSION="\"$(VERSION)\"" -I/usr/include/freetype2
LDFLAGS += -lm -lalpm -pthread -lsensors -lxcb -lxcb-xinerama -lxcb-randr -lX11 -lX11-xcb -lXft -lfreetype -lz -lfontconfig
CFDEBUG = -ggdb -Wall -Wunused-parameter \
-Wimplicit-function-declaration
EXEC = cbar
SRCS = cbar.c render.c
OBJS = ${SRCS:.c=.o}
PREFIX?=/usr
BINDIR=${PREFIX}/bin
all: ${EXEC}
.c.o:
${CC} ${CFLAGS} -o $@ -c $<
${EXEC}: ${OBJS}
${CC} -o ${EXEC} ${OBJS} ${LDFLAGS}
debug: ${EXEC}
debug: CC += ${CFDEBUG}
clean:
rm -f ./*.o ./*.1
rm -f ./${EXEC}
install: cbar doc
install -D -m 755 cbar ${DESTDIR}${BINDIR}/cbar
install -D -m 644 cbar.1 ${DESTDIR}${PREFIX}/share/man/man1/cbar.1
uninstall:
rm -f ${DESTDIR}${BINDIR}/cbar
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/cbar.1
.PHONY: all debug clean install