aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 30ee071365eb11cefc7eac50f246b4cea732d032 (plain) (blame)
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
PROG = cwm
OBJS = calmwm.o client.o conf.o group.o kbfunc.o menu.o parse.o \
	   reallocarray.o screen.o search.o strlcat.o strlcpy.o strtonum.o \
	   util.o xevents.o xmalloc.o xutil.o
LIBS = x11 xft xrandr

PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
MANDIR ?= ${PREFIX}/share/man

CFLAGS   ?= -O2
CFLAGS   += -MMD -Wall -Wextra -Wno-unused-parameter
CPPFLAGS += -D_GNU_SOURCE $(shell pkg-config --cflags ${LIBS})
LDLIBS   += $(shell pkg-config --libs ${LIBS})

${PROG}: ${OBJS}
	${CC} -o $@ ${CFLAGS} ${OBJS} ${LDLIBS}

install:
	install -D -m 0755 -t '${DESTDIR}${BINDIR}' ${PROG}
	install -D -m 0644 -t '${DESTDIR}${MANDIR}/man1' ${PROG}.1
	install -D -m 0644 -t '${DESTDIR}${MANDIR}/man5' ${PROG}rc.5

clean:
	rm -f ${OBJS} ${OBJS:.o=.d} ${PROG}

.INTERMEDIATE: parse.c
.PHONY: clean install

-include ${OBJS:.o=.d}