fix ping loss, add ttl from ip header compile .h file to detect changes

This commit is contained in:
2025-05-22 15:30:34 +02:00
parent b96652f9a4
commit 94085f5bb2
6 changed files with 44 additions and 31 deletions

View File

@ -1,8 +1,9 @@
NAME = ft_ping
CC=cc
FLAGS=-Werror -Wextra -Wall -g -Wno-unused-result
FLAGS=-Werror -Wextra -Wall -g -Wno-unused-result -Qunused-arguments
SRCS_DIR = srcs
INCLUDES_DIR = srcs/includes
OBJS_DIR = .objs
SRCS = main.c\
@ -13,7 +14,10 @@ SRCS = main.c\
stats.c\
waitlist_utils.c
OBJS = $(addprefix $(OBJS_DIR)/,$(SRCS:.c=.o))
INCLUDES = ft_ping.h
OBJS = $(addprefix $(OBJS_DIR)/,$(SRCS:.c=.o))\
$(addprefix $(OBJS_DIR)/,$(INCLUDES:.h=.pch))
all: $(NAME)
@ -25,6 +29,8 @@ $(OBJS_DIR):
$(OBJS_DIR)/%.o: $(SRCS_DIR)/%.c
$(CC) $(FLAGS) -c $< -o $@
$(OBJS_DIR)/%.pch: $(INCLUDES_DIR)/%.h
$(CC) $(FLAGS) -c $< -o $@
clean:
rm -rf $(OBJS_DIR)