-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (60 loc) · 1.98 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lbarthon <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/09/02 16:45:56 by lbarthon #+# #+# #
# Updated: 2020/03/06 11:09:14 by lbarthon ### ########.fr #
# #
# **************************************************************************** #
CC=gcc
CPPFLAGS=-I./libft/includes -I./includes/
CFLAGS=-Wall -Werror -Wextra
LDFLAGS=-Llibft -lft
NAME=ft_ssl
SRCDIR=./srcs
SRCS=errors/usage.c \
errors/commands.c \
flags.c \
hash.c \
display.c \
md5/md5.c \
md5/md5_utils.c \
sha256/sha256.c \
sha256/sha256_utils.c \
sha1/sha1.c \
sha1/sha1_utils.c \
utils/rotate.c \
utils/sha2_sig.c \
utils/sha2.c \
main.c
OBJDIR=.obj
OBJS=$(SRCS:.c=.o)
DEPS=$(SRCS:.c=.d)
LIBDIR=libft
LIB_NAME=$(LIBDIR)/libft.a
all: $(NAME)
$(NAME): $(LIB_NAME) $(addprefix $(OBJDIR)/,$(OBJS))
$(CC) $(CFLAGS) -o $(NAME) $^
-include $(addprefix $(OBJDIR)/,$(DEPS))
$(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR)
$(CC) $(CFLAGS) $(CPPFLAGS) -MMD -o $@ -c $<
$(OBJDIR):
@mkdir $@ 2> /dev/null || true
@mkdir $@/md5 2> /dev/null || true
@mkdir $@/sha256 2> /dev/null || true
@mkdir $@/sha1 2> /dev/null || true
@mkdir $@/errors 2> /dev/null || true
@mkdir $@/utils 2> /dev/null || true
$(LIB_NAME):
make -C $(LIBDIR)
fclean: clean
rm -f $(NAME)
make -C $(LIBDIR) fclean
clean:
rm -rf $(OBJDIR)
make -C $(LIBDIR) clean
re: fclean all
.PHONY: all fclean clean re