-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (70 loc) · 2.93 KB
/
Copy pathMakefile
File metadata and controls
96 lines (70 loc) · 2.93 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
include config.mk
BINDIR = ./bin
TEST_DIR = t
CCOR_H = libccor/ccor.h
OBJS = control.o parser.o \
pty.o proc.o region.o screen.o term.o utf8.o \
frontend-cairo.o frontend.o config.o main.o
TOBJS = utf8.o parser.o screen.o control.o term.o \
region.o config.o
all: $(BINDIR)/mx libccor/libccor.a
libccor/libccor.a: libccor/ccor.c $(CCOR_H)
cd libccor && $(MAKE)
$(BINDIR)/mx: $(OBJS) libccor/libccor.a
mkdir -p $(BINDIR)
$(CC) -o $@ $(OBJS) libccor/libccor.a $(LDFLAGS)
.SUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
config.o: config.h $(CCOR_H)
control.o: control.h parser.h screen.h term.h types.h utf8.h $(CCOR_H)
frontend.o: frontend.h parser.h screen.h term.h types.h $(CCOR_H)
frontend-cairo.o: config.h frontend.h parser.h region.h screen.h term.h \
types.h utf8.h $(CCOR_H)
main.o: config.h frontend.h parser.h proc.h pty.h screen.h term.h \
types.h utf8.h $(CCOR_H)
parser.o: parser.h types.h utf8.h $(CCOR_H)
proc.o: proc.h pty.h
pty.o: config.h pty.h types.h $(CCOR_H)
region.o: region.h screen.h types.h $(CCOR_H)
screen.o: screen.h types.h $(CCOR_H)
term.o: config.h control.h parser.h screen.h term.h types.h utf8.h $(CCOR_H)
utf8.o: types.h utf8.h $(CCOR_H)
$(TEST_DIR)/mx-test: $(TOBJS) $(TEST_DIR)/mx-test.c libccor/libccor.a \
parser.h screen.h term.h types.h utf8.h $(CCOR_H)
$(CC) $(CFLAGS) -I. -o $@ $(TEST_DIR)/mx-test.c $(TOBJS) libccor/libccor.a $(LDFLAGS) -lm
$(TEST_DIR)/test-region: $(TEST_DIR)/test-region.c region.o screen.o \
region.h screen.h types.h $(CCOR_H)
$(CC) -std=c99 $(FEATURE) -I. -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -o $@ $(TEST_DIR)/test-region.c region.o screen.o $(LDFLAGS) -lm
$(TEST_DIR)/test-resize: $(TOBJS) $(TEST_DIR)/test-resize.c libccor/libccor.a \
parser.h screen.h term.h types.h $(CCOR_H)
$(CC) $(CFLAGS) -I. -o $@ $(TEST_DIR)/test-resize.c $(TOBJS) libccor/libccor.a $(LDFLAGS) -lm
$(TEST_DIR)/test-screen: $(TOBJS) $(TEST_DIR)/test-screen.c libccor/libccor.a \
parser.h screen.h term.h types.h $(CCOR_H)
$(CC) $(CFLAGS) -I. -o $@ $(TEST_DIR)/test-screen.c $(TOBJS) libccor/libccor.a $(LDFLAGS) -lm
test: test-mock test-region test-resize test-screen test-colour-correct
test-mock: all $(TEST_DIR)/mx-test
@MOCK_TERM=./$(TEST_DIR)/mx-test perl $(TEST_DIR)/prove.pl
test-region: all $(TEST_DIR)/mx-test $(TEST_DIR)/test-region
@./$(TEST_DIR)/test-region
test-resize: all $(TEST_DIR)/test-resize
@./$(TEST_DIR)/test-resize
test-screen: all $(TEST_DIR)/test-screen
@./$(TEST_DIR)/test-screen
test-colour-correct: libccor/libccor.a
@cd libccor && $(MAKE) test
check: test
mx: $(BINDIR)/mx
@:
clean:
rm -rf $(BINDIR) *.o t/mx-test \
t/test-region t/test-resize t/test-screen
cd libccor && $(MAKE) clean 2>/dev/null || true
dist: clean
tar -czf term-$(VERSION).tar.gz *
indent:
indent -kr *.c *.h
install: $(BINDIR)/mx
install -D -m 755 $(BINDIR)/mx $(DESTDIR)$(PREFIX)/bin/mx
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/mx