-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
52 lines (37 loc) · 1.2 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
rust_aggressive:
rm -f lsrt
cargo build --release --features "aggressive" && mv target/release/lsrt lsrt
rust:
rm -f lsrt
cargo build --release && mv target/release/lsrt lsrt
doc :
cargo +nightly fmt && rm -r docs/code_documentation/doc && cargo doc --target-dir docs/code_documentation/ --no-deps --open
TARGET := lsrt
DEBUG := lsrt_debug
TEST := test
TEST_DBG := test_dbg
CC := gcc
DEBUG_FLAGS := -g -fsanitize=address -fsanitize=object-size -fno-optimize-sibling-calls -fsanitize=undefined -fsanitize=leak -fsanitize=alignment
CFLAGS := -O2 -std=gnu17 -Wall -Wextra -Wpedantic -Wno-unused-parameter
SRCS := $(wildcard src/*.c)
FILES_DIR_NAME := data
all: $(TARGET)
$(TARGET): $(SRCS) main.c
$(CC) $(CFLAGS) $^ -o $(TARGET)
$(DEBUG) : $(SRCS) main.c
$(CC) $(CFLAGS) $(DEBUG_FLAGS) $^ -o $(DEBUG)
test: $(TEST)
$(TEST): $(SRCS) $(wildcard test/*.c)
for file in $(wildcard test/*.c); do \
$(CC) $(CFLAGS) $$file $(SRCS) -o test/bin/$$(basename $$file .c); \
done
clean:
rm -f lsrt lsrt_debug test/bin/*
clean_data:
rm -rf $(FILES_DIR_NAME)/*
rmdir $(FILES_DIR_NAME)
rust_debug:
rm -f lsrt
cargo build && mv target/debug/lsrt_new lsrt
cr_final:
cd docs/compte_rendus/cr_final && tectonic main.tex