-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
43 lines (30 loc) · 943 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
41
42
43
NAME := xdo
VERCMD ?= git describe --tags 2> /dev/null
VERSION := $(shell $(VERCMD) || cat VERSION)
CPPFLAGS += -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\"
CFLAGS += -std=c99 -pedantic -Wall -Wextra
LDLIBS := -lxcb -lxcb-util -lxcb-icccm -lxcb-ewmh -lxcb-xtest
PREFIX ?= /usr/local
BINPREFIX ?= $(PREFIX)/bin
MANPREFIX ?= $(PREFIX)/share/man
SRC := $(wildcard *.c)
OBJ := $(SRC:.c=.o)
all: $(NAME)
debug: CFLAGS += -O0 -g
debug: $(NAME)
include Sourcedeps
$(OBJ): Makefile
$(NAME): $(OBJ)
install:
mkdir -p "$(DESTDIR)$(BINPREFIX)"
cp -p $(NAME) "$(DESTDIR)$(BINPREFIX)"
mkdir -p "$(DESTDIR)$(MANPREFIX)/man1"
cp -p doc/$(NAME).1 "$(DESTDIR)$(MANPREFIX)/man1"
uninstall:
rm -f "$(DESTDIR)$(BINPREFIX)/$(NAME)"
rm -f $(DESTDIR)$(MANPREFIX)/man1/$(NAME).1
doc:
a2x -v -d manpage -f manpage -a revnumber=$(VERSION) doc/$(NAME).1.txt
clean:
rm -f $(OBJ) $(NAME)
.PHONY: all debug install uninstall doc clean