-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·135 lines (114 loc) · 2.66 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
##
## EPITECH PROJECT, 2023
## Makefile template
## File description:
## Makefile
##
_SRC = main.c \
\
display/array.c \
display/bool.c \
display/display.c \
display/null.c \
display/number.c \
display/object.c \
display/string.c \
\
export/export.c \
\
getters/array.c \
getters/bool.c \
getters/number.c \
getters/string.c \
\
parse/values/string/dup.c \
parse/values/string/len.c \
parse/values/array.c \
parse/values/bool.c \
parse/values/null.c \
parse/values/number.c \
parse/values/object.c \
parse/values/string.c \
parse/file.c \
parse/key.c \
parse/parse.c \
parse/separator.c \
parse/value.c \
\
stringify/size/array.c \
stringify/size/bool.c \
stringify/size/null.c \
stringify/size/number.c \
stringify/size/object.c \
stringify/size/size.c \
stringify/size/string.c \
stringify/array.c \
stringify/bool.c \
stringify/null.c \
stringify/number.c \
stringify/object.c \
stringify/string.c \
stringify/stringify.c \
\
types/array/append.c \
types/array/array.c \
types/array/get.c \
types/array/remove.c \
types/array/from_bool.c \
types/array/from_float.c \
types/array/from_int.c \
types/array/from_string.c \
types/array/to_bool.c \
types/array/to_float.c \
types/array/to_int.c \
types/array/to_string.c \
\
types/cjson/props/array.c \
types/cjson/props/bool.c \
types/cjson/props/number.c \
types/cjson/props/string.c \
types/cjson/free.c \
types/cjson/new.c \
types/cjson/prop.c \
types/cjson/set_key.c \
types/cjson/set_value.c \
types/cjson/set_prop.c \
\
utils/charstr.c \
utils/error.c \
utils/file.c \
utils/skip.c \
utils/strcmp.c \
utils/strdup.c \
utils/strlen.c \
utils/strncpy.c \
SRCDIR = src/
SRC = $(addprefix $(SRCDIR), $(_SRC))
OBJ = $(SRC:.c=.o)
INC = -I ./include
NAME = cjson
COLOUR_GREEN=\033[0;32m
COLOUR_ORANGE=\033[0;33m
COLOUR_RED=\033[0;31m
COLOUR_BLUE=\033[0;34m
BOLD_BLUE=\033[1;34m
COLOUR_GREY=\033[0;30m
COLOUR_END=\033[0m
all: $(NAME)
$(NAME): $(OBJ)
@ar rc lib$(NAME).a $(OBJ)
@cp lib$(NAME).a ../
bin: $(OBJ)
@gcc -o $(NAME) $(OBJ) $(LDFLAGS) $(INC)
bin-re: fclean bin
%.o: %.c
@echo "$(COLOUR_BLUE)📦 Compiling lib$(NAME) - $(BOLD_BLUE)\
[$<]$(COLOUR_END)"
@gcc -c $< -o $@ $(INC)
clean:
@echo "$(COLOUR_RED)🧽 Cleaning lib$(NAME) objects...$(COLOUR_END)"
@rm -f $(OBJ)
fclean: clean
@echo "$(COLOUR_RED)🧽 Cleaning lib$(NAME) $(NAME).a...$(COLOUR_END)"
@rm -f lib$(NAME).a $(NAME)
re: fclean all