-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (36 loc) · 1.05 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
CFLAGS_WARN = -Wmissing-prototypes -Wno-unused-parameter -Wno-char-subscripts \
-Wno-missing-field-initializers -Wno-format-zero-length
CFLAGS_DEF = -D_XOPEN_SOURCE
CFLAGS = -Wall -Wextra -g -std=c11 -fms-extensions -fno-common \
${CFLAGS_WARN} ${CFLAGS_DEF}
LDFLAGS = -lncurses -g
LDFLAGS_STATIC = -static ${LDFLAGS} -ltinfo -lgpm
OBJ = main.o ncurses.o ui.o mem.o keys.o cmds.o buffer.o \
list.o motion.o external.o str.o prompt.o io.o \
yank.o pos.o region.o retain.o range.o parse_cmd.o word.o \
buffers.o window.o windows.o tab.o tabs.o ctags.o
SRC = ${OBJ:.o=.c}
Q = @
tim: ${OBJ}
@echo link $@
$Q${CC} -o $@ ${OBJ} ${LDFLAGS}
%.o: %.c
@echo compile $<
$Q${CC} -c -o $@ $< ${CFLAGS}
tim.static: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS_STATIC}
check: tim
cd test && ./run.pl
checkmem: tim
cd test && ./run.pl -v
clean:
@echo clean
$Qrm -f ${OBJ} tim
tags:
@echo gen ctags
$Qctags -R --exclude='_*' .
.%.d: %.c
@echo depend $<
$Q${CC} -MM -o $@ $< ${CPPFLAGS}
-include ${OBJ:%.o=.%.d}
.PHONY: check checkmem clean tags