-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (28 loc) · 932 Bytes
/
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
# dwm - dynamic window manager
# See LICENSE file for copyright and license details.
include config.mk
SRCS = $(filter-out transient.c, $(wildcard *.c))
DEPS = $(SRCS:.c=.d)
OBJS = $(SRCS:.c=.o)
BIN = dwm
$(BIN): $(OBJS)
$(CC) $^ -o $@ $(LDLIBS)
$(OBJS): config.mk
clean:
@$(RM) --verbose -- $(DEPS) $(OBJS) $(BIN) $(BIN)-$(VERSION).tar.xz
dist:
git archive --prefix $(BIN)-$(VERSION)/ HEAD | xz > $(BIN)-$(VERSION).tar.xz
install: $(BIN)
mkdir -p "$(DESTDIR)$(BINDIR)"
cp -f $(BIN) "$(DESTDIR)$(BINDIR)"
chmod 755 "$(DESTDIR)$(BINDIR)/$(BIN)"
mkdir -p "$(DESTDIR)$(MANDIR)/man1"
sed "s/VERSION/$(VERSION)/g" < $(BIN).1 > "$(DESTDIR)$(MANDIR)/man1/$(BIN).1"
chmod 644 "$(DESTDIR)$(MANDIR)/man1/$(BIN).1"
uninstall:
@$(RM) "$(DESTDIR)$(BINDIR)/$(BIN)" \
"$(DESTDIR)$(MANDIR)/man1/$(BIN).1"
lint:
-clang-tidy --quiet $(SRCS) -- $(CPPFLAGS) $(CFLAGS)
.PHONY: clean dist install uninstall lint
-include $(DEPS)