-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (45 loc) · 1.15 KB
/
Makefile
File metadata and controls
56 lines (45 loc) · 1.15 KB
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
55
56
PROG = xmenu
OBJS = ${PROG:=.o} control/font.o
SRCS = ${OBJS:.o=.c}
MAN = ${PROG:=.1}
DOC = README.md
PREFIX ?= /usr/local
MANPREFIX ?= ${PREFIX}/share/man
bindir = ${DESTDIR}${PREFIX}/bin
mandir = ${DESTDIR}${MANPREFIX}/man1
.PHONY: all
all: ${PROG}
${PROG}: ${OBJS}
${CC} -o $@ ${OBJS} \
-lfontconfig -lXft -lX11 -lXinerama -lXrender -lImlib2 ${LDLIBS} \
-L/usr{,/local,/X11R6}/lib ${LDFLAGS}
.PHONY: debug
debug:
@${MAKE} ${MAKEFLAGS} \
CFLAGS+="-g -O0 -DDEBUG=1 -Wall -Wextra -Wpedantic ${DEBUG}" \
${PROG}
.c.o:
${CC} -std=c99 -D_XOPEN_SOURCE=800 -D_BSD_SOURCE -D_GNU_SOURCE \
-I./ -I/usr{,/local,/X11R6}/include{,/freetype2} \
${CPPFLAGS} ${CFLAGS} -o $@ -c $<
xmenu.o control/font.o: control/font.h
.PHONY: tags
tags: ${SRCS}
ctags ${SRCS}
.PHONY: lint
lint: ${SRCS}
-mandoc -T lint -W warning ${MAN}
-clang-tidy ${SRCS} -- -std=c99 ${DEFS} ${INCS} ${CPPFLAGS}
.PHONY: clean
clean:
rm -f ${OBJS} ${PROG} ${PROG:=.core} tags
.PHONY: install
install: all
mkdir -p ${bindir}
mkdir -p ${mandir}
install -m 755 ${PROG} ${bindir}/${PROG}
install -m 644 ${MAN} ${mandir}/${MAN}
.PHONY: uninstall
uninstall:
-rm ${bindir}/${PROG}
-rm ${mandir}/${MAN}