-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
65 lines (47 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
63
64
65
# Set to true to enable experimental multithreading
THREADS = false
CC ?= cc
INSTALL ?= install
STRIP ?= strip
CFLAGS = -std=c99
CFLAGS += -pedantic
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Wcast-align
CFLAGS += -Wswitch-default
CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef
CFLAGS += -D_DEFAULT_SOURCE
PREFIX ?= /usr/local
INCLUDES = -I/usr/local/include
LIB_PATH = -L/usr/local/lib
LIBS = -lmarkdown
ifeq ($(THREADS), true)
CFLAGS += -DTHREADS
LIBS += -lpthread
endif
PROJECT = swege
all:
$(CC) $(CFLAGS) -O3 $(INCLUDES) $(LIB_PATH) $(PROJECT).c -o $(PROJECT) $(LIBS)
debug:
$(CC) $(CFLAGS) -g $(INCLUDES) $(LIB_PATH) $(PROJECT).c -o $(PROJECT) $(LIBS)
gdb: debug
gdb $(PROJECT)
memcheck: debug
valgrind --leak-check=yes ./$(PROJECT)
memcheck_v: debug
valgrind --leak-check=yes -v ./$(PROJECT)
memcheck_full: debug
valgrind --leak-check=full --show-leak-kinds=debug ./$(PROJECT)
clean:
rm -f ./$(PROJECT)
install:
mkdir -p "$(DESTDIR)$(PREFIX)/bin"
$(INSTALL) $(PROJECT) "$(DESTDIR)$(PREFIX)/bin/$(PROJECT)"
uninstall:
rm -f "$(DESTDIR)$(PREFIX)/bin/$(PROJECT)"
strip:
$(STRIP) ./$(PROJECT)
site:
./$(PROJECT)
.PHONY: all debug gdb memcheck memcheck_v memcheck_full clean install uninstall strip site