-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (49 loc) · 1.62 KB
/
Makefile
File metadata and controls
69 lines (49 loc) · 1.62 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
PROGRAM = marisa
FILES.c = buffer.c editorOperations.c file_io.c frame.c init.c input.c keymap.c main.c terminal.c utils.c
FILES.h = marisa.h buffer.h frame.h utils.h
FILES.o = ${FILES.c:.c=.o}
CC = gcc
LD = ld
SFLAGS = -std=c11
GFLAGS = -g
OFLAGS = -O0
WFLAG1 = -Wall
WFLAG2 = -Wextra
WFLAG3 = -Werror
WFLAG4 = -Wstrict-prototypes
WFLAG5 = -Wmissing-prototypes
WFLAG6 = -Wshadow
WFLAG7 = -Wnull-dereference
WFLAG8 = -Wduplicated-cond
WFLAG9 = -Wunused-macros
WFLAG10 = -Wduplicated-branches
WFLAG11 = -Wvector-operation-performance
WFLAG12 = -Wredundant-decls
WFLAG13 = -Wmissing-field-initializers
WFLAG14 = -Wpointer-arith
WFLAG15 = -Wfloat-equal
WFLAG16 = -Wcast-qual
WFLAG17 = -Wbad-function-cast
WFLAG18 = -Wundef
WFLAG19 = -Wmaybe-uninitialized
WFLAG20 = -Wvla
LIB1 = -lncursesw
WFLAGS = ${WFLAG1} ${WFLAG2} ${WFLAG3} ${WFLAG4} ${WFLAG5} ${WFLAG6} ${WFLAG7} ${WFLAG8} ${WFLAG9} ${WFLAG10} ${WFLAG11} ${WFLAG12} ${WFLAG13} ${WFLAG14} ${WFLAG15} ${WFLAG16} ${WFLAG17} ${WFLAG18} ${WFLAG19} ${WFLAG20}
UFLAGS = # Set on command line only
CFLAGS = ${SFLAGS} ${GFLAGS} ${OFLAGS} ${WFLAGS} ${UFLAGS} $(shell pkg-config --cflags glib-2.0)
LDFLAGS =
LDLIBS = ${LIB1}
LFLAGS = $(shell pkg-config --libs glib-2.0)
CTAGS = ctags -f TAGS -e -R --languages=C
all: ${PROGRAM} tags
${PROGRAM}: ${FILES.o}
${CC} -o $@ ${CFLAGS} ${FILES.o} ${LFLAGS} ${LDFLAGS} ${LDLIBS}
${FILES.o}: ${FILES.h}
# If it exists, prog1.dSYM is a directory on macOS
DEBRIS = a.out core *~ *.dSYM *.su TAGS log
RM_FR = rm -fr
tags: ${FILES.c}
@-${RM_FR} TAGS
@-${CTAGS} ${FILES.c}
clean:
@-${RM_FR} ${FILES.o} ${PROGRAM} ${DEBRIS}