-
Notifications
You must be signed in to change notification settings - Fork 192
/
Makefile
48 lines (35 loc) · 1.17 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
# This snippet has been shmelessly stol^Hborrowed from thestinger's repose Makefile
VERSION = 1.4
GIT_DESC=$(shell test -d .git && git describe --always 2>/dev/null)
ifneq "$(GIT_DESC)" ""
VERSION=$(GIT_DESC)
endif
CC ?= gcc
CFLAGS += -Wall -std=c99 -Os -DVERSION="\"$(VERSION)\"" -D_GNU_SOURCE
LDFLAGS += -lxcb -lxcb-xinerama -lxcb-randr
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long \
-Wsign-conversion -Wconversion -Wimplicit-function-declaration
EXEC = lemonbar
SRCS = lemonbar.c utils.c
OBJS = ${SRCS:.c=.o}
PREFIX?=/usr
BINDIR=${PREFIX}/bin
all: ${EXEC}
doc: README.pod
pod2man --section=1 --center="lemonbar Manual" --name "lemonbar" --release="lemonbar $(VERSION)" README.pod > lemonbar.1
.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: lemonbar doc
install -D -m 755 lemonbar ${DESTDIR}${BINDIR}/lemonbar
install -D -m 644 lemonbar.1 ${DESTDIR}${PREFIX}/share/man/man1/lemonbar.1
uninstall:
rm -f ${DESTDIR}${BINDIR}/lemonbar
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/lemonbar.1
.PHONY: all debug clean install