-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
51 lines (32 loc) · 1.08 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
CC = gcc
CFLAGS = -std=c17 -ansi -pedantic -Wall -Wfatal-errors -Werror -Wextra -finline-functions -funroll-loops
CFLAGS_OPTIONALS = -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wstrict-overflow=5 -Waggregate-return -Wcast-qual -Wswitch-default -Wswitch-enum -Wconversion -Wunreachable-code
OPT = -O2
ARCHIVE = MUNAITPASOV_NAVARRO
SRC_DIR = src
INC_DIR = include
OBJ_DIR = build
EXEMPLES = exemples
EXE = saage
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJ = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SRC))
INC = -I $(INC_DIR)
all: $(EXE)
$(EXE): $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(OPT) $(CFLAGS_OPTIONALS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
$(CC) $(CFLAGS) $(OPT) $(INC) -c -o $@ $<
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
dist: mrproper
mkdir -p $(ARCHIVE)
cp -R makefile rapport_MUNAITPASOV_NAVARRO.pdf graph.png $(SRC_DIR) $(INC_DIR) $(EXEMPLES) $(ARCHIVE)
zip -r $(ARCHIVE).zip $(ARCHIVE)
rm -rf $(ARCHIVE)
.PHONY: all clean mrproper uninstall
clean:
rm -rf $(OBJ_DIR)
mrproper: clean
rm -f $(EXE)
uninstall: mrproper
rm -f $(ARCHIVE).zip