-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (48 loc) · 1.88 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
49
50
51
52
53
54
55
56
57
58
59
PREFIX ?= /usr/local
src = ipc.c util.c clipboard.c history.c content.c send_signal.c main.c
headers = clipsim.h
LDLIBS += $(shell pkg-config x11 --libs)
LDLIBS += $(shell pkg-config xfixes --libs)
LDLIBS += $(shell pkg-config libmagic --libs)
LDLIBS += -lpthread
all: release
.PHONY: all clean install uninstall
.SUFFIXES:
.SUFFIXES: .c .o
clang: CC=clang
clang: CFLAGS += -Weverything -Wno-unsafe-buffer-usage
clang: CFLAGS += -Wno-format-nonliteral -Wno-declaration-after-statement
clang: CFLAGS += -Wno-format-zero-length
clang: clean release
CFLAGS += -std=c99 -D_DEFAULT_SOURCE
CFLAGS += -Wall -Wextra
release: CFLAGS += -O2 -flto
release: clipsim
debug: CFLAGS += -g
debug: CFLAGS += -DCLIPSIM_DEBUG -fsanitize=undefined
debug: CFLAGS += -Wno-format-zero-length
debug: clean clipsim
clipsim: $(src) $(headers) Makefile
-ctags --kinds-C=+l *.h *.c
-vtags.sed tags > .tags.vim
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(src) $(LDLIBS)
install: all
install -Dm755 clipsim ${DESTDIR}${PREFIX}/bin/clipsim
install -Dm644 clipsim.1 ${DESTDIR}${PREFIX}/man/man1/clipsim.1
install -Dm644 completions/clipsim.fish \
${DESTDIR}${PREFIX}/share/fish/vendor_completions.d/clipsim.fish
install -Dm644 completions/clipsim.bash \
${DESTDIR}${PREFIX}/share/bash-completion/completions/clipsim
install -Dm644 completions/clipsim.zsh \
${DESTDIR}${PREFIX}/share/zsh/site-functions/_clipsim
install -Dm644 LICENSE \
${DESTDIR}${PREFIX}/share/licenses/${pkgname}/LICENSE
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/clipsim
rm -f ${DESTDIR}${PREFIX}/share/man/man1/clipsim.1
rm -f ${DESTDIR}${PREFIX}/share/fish/vendor_completions.d/clipsim.fish
rm -f ${DESTDIR}${PREFIX}/share/bash-completion/completions/clipsim
rm -f ${DESTDIR}${PREFIX}/share/zsh/site-functions/_clipsim
rm -f ${DESTDIR}${PREFIX}/share/licenses/${pkgname}/LICENSE
clean:
rm -f *.o *~ clipsim