-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (30 loc) · 1.41 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: llefranc <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/04/24 12:53:39 by lucaslefran #+# #+# #
# Updated: 2023/05/15 21:52:08 by llefranc ### ########.fr #
# #
# **************************************************************************** #
NAME = ft_ping
SRCS = main.c init.c print.c icmp.c check.c rtts.c
HDRS = ping.h
PATH_SRCS = src/
OBJS = $(SRCS:.c=.o)
CC = gcc
FLAGS = -Wall -Werror -Wextra
all : $(NAME)
$(NAME) : $(addprefix $(PATH_SRCS), $(OBJS))
$(CC) -o $(NAME) $(addprefix $(PATH_SRCS), $(OBJS)) $(FLAGS) -lm
@echo "ft_ping is ready";
clean :
rm -rf $(addprefix $(PATH_SRCS), $(OBJS))
fclean : clean
rm -rf $(NAME)
re : fclean all
.PHONY : all clean fclean re
%.o : %.c $(addprefix $(PATH_SRCS), $(HDRS))
$(CC) $(FLAGS) -o $@ -c $<