-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
62 lines (48 loc) · 1.21 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
60
61
62
TARGET = xedgewarp
VERSION = 1.2
SDIR = src
IDIR = include
ODIR = obj
INSTALL = install
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
CC = gcc
CFLAGS += -I$(IDIR)
CFLAGS += -std=gnu99 -fcommon
CFLAGS += -Wall -Wundef -Wshadow -Wformat-security
LIBS = $(shell pkg-config --libs xcb xcb-randr xcb-aux x11 x11-xcb xi)
INCS = $(wildcard $(IDIR)/*.h)
SRCS = $(wildcard $(SDIR)/*.c)
OBJS = $(patsubst %,$(ODIR)/%,$(notdir $(SRCS:.c=.o)))
MANS = man/xedgewarp.1
.NOTPARALLEL:
.PHONY: all
all: clean $(TARGET) mans
.PHONY: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
$(ODIR)/%.o: $(SDIR)/%.c $(INCS)
$(CC) -D'__VERSION="${VERSION}"' $(CFLAGS) -o $@ -c $<
.PHONY: install
install: $(TARGET)
$(INSTALL) -Dm 0755 $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET)
$(INSTALL) -Dm 0644 man/xedgewarp.1 $(DESTDIR)$(MANDIR)/xedgewarp.1
.PHONY: uninstall
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
$(RM) $(DESTDIR)$(MANDIR)/xedgewarp.1
.PHONY: mans
mans: $(MANS)
$(MANS): %.1: %.man
a2x --no-xmllint -f manpage $<
.PHONY: test
test: clean $(TARGET)
@cd test/; \
xvfb-run ./run.pl; \
cd ../
.PHONY: clean
clean:
$(RM) $(TARGET) $(OBJS)
$(RM) man/*.1 man/*.xml
$(RM) test/GLOB*