-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (33 loc) · 857 Bytes
/
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
CC := gcc
CFLAGS := -O2 \
-Wall \
-Wextra \
-Wformat=2 \
-Wformat-overflow \
-Wformat-truncation \
-Wshadow \
-Wdouble-promotion \
-Wundef \
-fno-common \
-z noexecstack \
-Wconversion \
-g
LIBS = -lm
SRC := main.c
TARGET := bin/main
INSTALL_DIR := ~/.local/bin
.PHONY: build deploy
build: create_dir $(TARGET)
create_dir:
mkdir -p bin
$(TARGET): $(SRC)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
deploy: $(INSTALL_DIR)/tagger
$(INSTALL_DIR)/tagger: $(SRC)
$(CC) $(CFLAGS) -o $@ $^
run: build
$(TARGET)
cppcheck:
cppcheck --enable=all --inconclusive --force --suppress=unusedFunction .
valgrind:
valgrind --tool=memcheck --leak-check=full --show-reachable=yes --num-callers=20 -s --track-fds=yes --track-origins=yes ./bin/main