-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 942 Bytes
/
Makefile
File metadata and controls
56 lines (43 loc) · 942 Bytes
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
##
## EPITECH PROJECT, 2023
## json-parser
## File description:
## Makefile
##
NAME = main
CC = gcc
VPATH := src
vpath %.c $(VPATH)
SRC := main.c
INC_DIR := includes
LIB_DIR := ./lib/jp
LIB_NAME := jp
CFLAGS = -iquote $(INC_DIR) -L$(LIB_DIR) -l$(LIB_NAME) -g \
-l csfml-window -l csfml-graphics -l csfml-system -l csfml-audio
LIBFLAGS = -ljp
BUILD_DIR = build
OBJ := $(SRC:%.c=$(BUILD_DIR)/%.o)
all: $(NAME)
@ echo "Compilation done"
$(BUILD_DIR)/%.o: %.c
@ mkdir -p $(@D)
@ make -s -C ${LIB_DIR}
@ $(CC) $(CFLAGS) $(LIBFLAGS) -c $< -o $@
@ echo "$(CC) $<"
$(NAME): $(OBJ) $(SRC)
@ mkdir -p $(BUILD_DIR)
$(CC) -o $(NAME) $(OBJ) $(CFLAGS) $(LIBFLAGS)
clean:
@ $(RM) *.gcda
@ $(RM) *.gcno
@ $(RM) *.gcov
@ $(RM) vgcore.*
@ $(RM) coding-style-reports.log
@ $(RM) $(OBJ)
fclean: clean
@ make fclean -s -C $(LIB_DIR)
@ $(RM) -r $(BUILD_DIR)
@ $(RM) $(NAME)
@ $(RM) $(UNIT)
re: fclean all
.PHONY: clean fclean re