-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.13 KB
/
Makefile
File metadata and controls
51 lines (38 loc) · 1.13 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
VERSION = "git"
WM_NAME = "ɯm"
CC = cc
LIBS = -lxcb -lxcb-icccm -lxcb-ewmh -lxcb-xinerama -lxcb-randr
CFLAGS = -std=c99 -pedantic -Wall -Wextra
CFLAGS += -DWM_NAME=\"$(WM_NAME)\" -DVERSION=\"$(VERSION)\"
LDFLAGS = $(LIBS)
PREFIX ?= /usr/local
BINPREFIX = $(PREFIX)/bin
SRC = wm.c helpers.c events.c messages.c monitor.c client.c rules.c pointer.c ewmh.c icccm.c tile.c
OBJ = $(SRC:.c=.o)
all: CFLAGS += -Os
all: LDFLAGS += -s
all: options $(WM_NAME)
debug: CFLAGS += -O0 -g -DDEBUG
debug: options $(WM_NAME)
options:
@echo "$(WM_NAME) build options:"
@echo "CC = $(CC)"
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "PREFIX = $(PREFIX)"
.c.o:
@echo "CC $<"
@$(CC) $(CFLAGS) -c -o $@ $<
$(WM_NAME): $(OBJ)
@echo CC -o $@
@$(CC) -o $@ $(OBJ) $(LDFLAGS)
clean:
@echo "cleaning"
@rm -f $(OBJ) $(WM_NAME)
install:
@echo "installing executable files to $(DESTDIR)$(BINPREFIX)"
@install -D -m 755 $(WM_NAME) $(DESTDIR)$(BINPREFIX)/$(WM_NAME)
uninstall:
@echo "removing executable files from $(DESTDIR)$(BINPREFIX)"
@rm -f $(DESTDIR)$(BINPREFIX)/$(WM_NAME)
.PHONY: all debug options clean install uninstall