-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.06 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
48
# slstatus - suckless status monitor
# See LICENSE file for copyright and license details.
include config.mk
SRCS = $(wildcard *.c components/*.c)
DEPS = $(SRCS:.c=.d)
OBJS = $(SRCS:.c=.o)
BIN = slstatus
$(BIN): $(OBJS)
$(CC) $^ -o $@ $(LDLIBS)
$(OBJS): config.mk
options:
@echo $(BIN) build options:
@echo "CPPFLAGS = $(CPPFLAGS)"
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "LDLIBS = $(LDLIBS)"
@echo "CC = $(CC)"
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"
cp -f $(BIN).1 "$(DESTDIR)$(MANDIR)/man1"
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: options clean dist install uninstall lint
-include $(DEPS)