-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (43 loc) · 1.85 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vchornyi <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/10/20 15:24:46 by vchornyi #+# #+# #
# Updated: 2018/10/20 15:24:47 by vchornyi ### ########.fr #
# #
# **************************************************************************** #
NAME = ft_ssl
FLAGS = -Wall -Wextra -Werror
INC = -Iincludes/ -I$(LIB_DIR)/includes
SRC_NAME = ssl.c md5.c common.c sha256.c sha512.c get_next_block.c error.c \
md5_round.c sha256_round.c result.c sha512_schedule.c \
sha512_round.c common_permutations.c split_arg_list.c \
parse_args.c
OBJ_NAME = $(SRC_NAME:.c=.o)
OBJ = $(addprefix $(OBJ_DIR),$(OBJ_NAME))
LIB_DIR = libft/
SRC_DIR = src/
OBJ_DIR = obj/
all: $(NAME)
$(NAME): $(OBJ)
@make -C $(LIB_DIR) --silent
@gcc -o $(NAME) $(OBJ) -L $(LIB_DIR) -lft
@echo "##### ft_ssl compiling finished! #####"
$(OBJ_DIR)%.o: $(SRC_DIR)%.c
@mkdir -p $(OBJ_DIR)
@echo "##### Creating" [ $@ ] " #####"
@gcc $(FLAGS) -o $@ -c $< $(INC)
clean:
@make -C $(LIB_DIR) clean --silent
@rm -f $(OBJ)
@rm -rf $(OBJ_DIR)
@echo "##### Removed object files #####"
fclean: clean
@make -C $(LIB_DIR) fclean --silent
@rm -f $(NAME)
@echo "##### Removed binary files #####"
re: fclean all
.PHONY: all clean fclean re