-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (33 loc) · 1.12 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
WMNAME = wm
PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
MANPREFIX = ${PREFIX}/share/man
X11INC = -I/usr/X11R6/include
X11LIB = -L/usr/X11R6/lib -lX11 -lXft -lfreetype -lpthread -lz -lfontconfig -I/usr/include/freetype2
XINERAMALIB = -lXrandr
INCS = -I. -I/usr/include ${X11INC}
LIBS = -L/usr/lib -lc ${X11LIB} ${XINERAMALIB}
CFLAGS = -std=c++17 -pedantic -Wall -Wextra ${INCS}"
LDFLAGS = ${LIBS}
GCC = g++
EXEC = ${WMNAME}
SRC = ${WMNAME}.cpp utils.cpp logger.cpp tiling.cpp client.cpp desktop.cpp main.cpp
OBJ = ${SRC:.c=.o}
all: CFLAGS += -Os
all: LDFLAGS += -g
all: options ${WMNAME}
debug: CFLAGS += -O0
debug: options ${WMNAME}
.c.o:
@echo GCC $<
@${GCC} -c ${CFLAGS} $<
${OBJ}: config.h logger.h wm.h monitor.h desktop.h client.h toml.h
${WMNAME}: ${OBJ}
@echo CC -o $@
@${GCC} -o $@ ${OBJ} ${LDFLAGS} -g
install: all
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
@install -Dm755 ${WMNAME} ${DESTDIR}${PREFIX}/bin/${WMNAME}
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man.1
@install -Dm644 ${WMNAME}.1 ${DESTDIR}${MANPREFIX}/man1/${WMNAME}.1
.PHONY: all options clean install uninstall