-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 846 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 846 Bytes
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
# Color codes for better output
COLOR_RESET=\033[0m
COLOR_RED=\033[31m
COLOR_GREEN=\033[32m
COLOR_YELLOW=\033[33m
COLOR_BLUE=\033[34m
# Compilation flags and variables
FLAGS=-Wall -Werror -Wextra -fsanitize=address -g
CC=gcc
EXEC_NAME=ft_ping
SRCS=srcs/main.c srcs/parsing/parse_clo.c srcs/handle_errors.c srcs/icmp_utils.c srcs/handle_time.c srcs/libft.c
INCLUDES=includes/
IP_ADDRESS := $(shell ip addr | grep "enp1s0" | grep inet | cut -d ' ' -f6 | cut -d '/' -f1)
IP := $(echo "HEHLLO")
all: $(EXEC_NAME)
$(EXEC_NAME): $(SRCS)
@$(CC) $(FLAGS) $(SRCS) -D SRC_ADDRESS=\"10.0.2.15\" -I $(INCLUDES) -o $(EXEC_NAME)
@echo "$(COLOR_BLUE)$(EXEC_NAME) executable created$(COLOR_RESET)"
clean:
@rm -rf $(EXEC_NAME)
@echo "$(COLOR_YELLOW)Cleaned up the generated files$(COLOR_RESET)"
fclean: clean
re: fclean all
.PHONY: all clean fclean re