-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
48 lines (36 loc) · 1.21 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
PROG = pmenu
OBJS = ${PROG:=.o} ctrlfnt.o
SRCS = ${OBJS:.o=.c}
MAN = ${PROG:=.1}
PREFIX ?= /usr/local
MANPREFIX ?= ${PREFIX}/share/man
LOCALINC ?= /usr/local/include
LOCALLIB ?= /usr/local/lib
X11INC ?= /usr/X11R6/include
X11LIB ?= /usr/X11R6/lib
FREETYPEINC ?= /usr/include/freetype2
DEFS = -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -D_BSD_SOURCE -D_DEFAULT_SOURCE
INCS = -I${LOCALINC} -I${X11INC} -I${FREETYPEINC} -I${X11INC}/freetype2
LIBS = -L${LOCALLIB} -L${X11LIB} -lm -lfontconfig -lXft -lX11 -lXinerama -lXrender -lXext -lImlib2
all: ${PROG}
${PROG}: ${OBJS}
${CC} -o $@ ${OBJS} ${LIBS} ${LDFLAGS}
pmenu.o: ctrlfnt.h
.c.o:
${CC} -std=c99 -pedantic ${DEFS} ${INCS} ${CFLAGS} ${CPPFLAGS} -c $<
tags: ${SRCS}
ctags ${SRCS}
lint: ${SRCS}
-mandoc -T lint -W warning ${MAN}
-clang-tidy ${SRCS} -- -std=c99 ${DEFS} ${INCS} ${CPPFLAGS}
clean:
-rm -f ${OBJS} ${PROG} ${PROG:=.core}
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
mkdir -p ${DESTDIR}${MANPREFIX}/man1
install -m 755 ${PROG} ${DESTDIR}${PREFIX}/bin/${PROG}
install -m 644 ${MAN} ${DESTDIR}${MANPREFIX}/man1/${MAN}
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/${PROG}
rm -f ${DESTDIR}${MANPREFIX}/man1/${MAN}
.PHONY: all tags clean install uninstall lint