-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (51 loc) · 897 Bytes
/
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
.PHONY: all clean fclean re
NAME=libvec.a
CC=gcc
CFLAG=
CFLAG+= -Werror
CFLAG+= -Wextra
CFLAG+= -Wall
SRCNAME= v_realloc\
v_memcpy\
v_append_raw\
v_copy\
v_del\
v_del_last\
v_get\
v_get_size\
v_new\
v_pop\
v_print\
v_push\
v_push_first\
v_push_int\
v_sort_size\
v_raw\
v_reset\
v_reverse_rotate\
v_rotate\
v_size\
v_split\
v_swap\
v_putnbr\
OBJDIR=obj/
CLEANOBJDIR=OBJDIR
CLEANOBJ=OBJ
SRCDIR=src/
SRC= $(addprefix $(SRCDIR), $(addsuffix .c, $(SRCNAME)))
OBJ= $(addprefix $(OBJDIR), $(addsuffix .o, $(SRCNAME)))
INCDIR= inc/
all: $(NAME)
$(OBJDIR)%.o: $(SRCDIR)%.c
@$(CC) $(CFLAG) -c $< -o $@ -I $(INCDIR)
@(echo "_ \033[032m$@\033[00m")
$(OBJDIR):
@mkdir -p $(OBJDIR)
$(NAME): $(OBJDIR) $(OBJ)
@ar -rc $(NAME) $(OBJ)
@(echo "[ \033[35m$(NAME)\033[00m ]")
clean:
@rm -rf $(OBJ) $(OBJDIR)
fclean: clean
@rm -rf $(NAME)
re: fclean all