-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (74 loc) · 2.09 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
##
## EPITECH PROJECT, 2019
## my_radar
## File description:
## Project root Makefile
##
CC = gcc
MAIN = $(addprefix $(SRC_D), $(MAIN_F))
OBJ_M = $(MAIN:.c=.o)
MAIN_F = main.c
SRC = $(addprefix $(SRC_D), $(SRC_F))
OBJ = $(SRC:.c=.o)
SRC_D = src/
SRC_F = usage.c \
simulation.c \
draw/draw_plane.c \
draw/draw_towers.c \
draw/draw_background.c \
draw/draw_timer.c \
events/poll_events.c \
utilities/geometry.c \
utilities/positions_checking.c \
utilities/get_box_corners.c \
collisions/box_collisions.c \
collisions/plane_collisions.c \
structures/tower.c \
structures/window.c \
structures/path.c \
structures/plane/plane_create.c \
structures/plane/plane_init.c \
structures/plane/plane_move.c \
structures/quadtree/quadtree.c \
structures/quadtree/quadtree_query.c \
structures/sim/sim.c \
structures/sim/sim_fonts.c \
structures/sim/sim_textures.c \
structures/sim/sim_texts.c \
structures/sim/sim_states.c \
file_manipulation/get_file_buffer.c \
file_manipulation/get_entities_from_file.c \
SRC_UT = $(addprefix $(SRC_UT_D), $(SRC_UT_F))
OBJ_UT = $(SRC_UT:.c=.o)
SRC_UT_D = tests/
SRC_UT_F = test_boundary_overlaps.c \
test_pos_match.c \
test_pos_are_near.c \
test_boundary_contains_pos.c \
INC = -I./include/ -I./include/structures/ -I./include/structures/sim/
CFLAGS = -W -Wall -Wextra -Werror $(INC) $(LDFLAGS)
DBFLAGS = -g -g3 -ggdb
LDFLAGS = -L./lib -lmy -lcsfml-graphics -lcsfml-system -lm
LDFLAGS_UT = -lcriterion -lgcov --coverage
NAME = my_radar
NAME_UT = unit_tests
all: $(NAME)
$(NAME): makelib $(OBJ) $(OBJ_M)
$(CC) -o $(NAME) $(OBJ) $(OBJ_M) $(CFLAGS)
makelib:
make -C ./lib/my/ all
tests_run: clean $(OBJ) $(OBJ_UT)
echo -e "\e[1;32mCompiling $(NAME_UT) binary... \e[0m"
$(CC) -o $(NAME_UT) $(SRC) $(SRC_UT) $(CFLAGS) $(LDFLAGS_UT)
./$(NAME_UT)
@rm -f $(SRC_UT_F:.c=.gcda)
@rm -f $(SRC_UT_F:.c=.gcno)
clean:
rm -f $(OBJ)
rm -f *.gc*
make -C ./lib/my clean
fclean: clean
rm -f $(NAME)
rm -f $(NAME_UT)
make -C ./lib/my clean
re: fclean all