Compare commits

...

3 commits

Author SHA1 Message Date
Raphael
1449f852c0
build: adding some rules for debug / bonus 2026-03-28 14:39:52 +01:00
Raphael
55871d938d
build: adding the includes directory in INC_DIR 2026-03-28 14:39:29 +01:00
Raphael
ccdb7fa121
build(docker): adding a docker to get ping from inetutils 2.0 2026-03-28 14:38:29 +01:00
3 changed files with 52 additions and 5 deletions

31
Dockerfile Normal file
View file

@ -0,0 +1,31 @@
FROM debian:latest
RUN apt-get update && \
apt-get install -y --force-yes \
build-essential \
wget \
tar \
make \
autoconf \
automake \
libtool \
&& \
rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
RUN wget https://ftp.gnu.org/gnu/inetutils/inetutils-2.0.tar.gz && \
tar -xzf inetutils-2.0.tar.gz && \
cd inetutils-2.0 && \
./configure --disable-logger --disable-syslogd --disable-whois --disable-rcp --disable-rlogin --disable-rsh --disable-talk --disable-telnet --disable-tftp --disable-uucpd --enable-ping && \
make && \
make install && \
ldconfig
RUN ping -V
RUN useradd -m -s /bin/bash devuser && \
echo "devuser:devuser" | chpasswd
WORKDIR /home/devuser/ft_ping
USER devuser
CMD ["/bin/bash"]

View file

@ -6,7 +6,7 @@
# By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/11/12 11:05:05 by rparodi #+# #+# #
# Updated: 2026/03/23 14:53:55 by rparodi ### ########.fr #
# Updated: 2026/03/24 12:38:38 by rparodi ### ########.fr #
# #
# **************************************************************************** #
@ -23,7 +23,8 @@ RM = rm -rf
CFLAGS = -Werror -Wall -Wextra
INC_DIR = ./parsing/includes
INC_DIR = ./includes \
./parsing/includes
CPPFLAGS = $(addprefix -I, $(INC_DIR)) -MMD -MP
@ -83,7 +84,7 @@ $(OBJDIRNAME)/%.o: %.c
@printf '$(GREY) Compiling $(END)$(GREEN)$<$(END)\n'
@$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
bonus: CFLAGS += -D BONUS=1
bonus: CPPFLAGS += -D BONUS=1
bonus: re
# Header
@ -99,7 +100,7 @@ header:
@printf '$(GOLD) ****** ******* ****** $(END)\n'
@printf '$(GOLD) ****** $(END)\n'
@printf '$(GOLD) ****** $(END)\n'
@printf '$(GREY) Made by glaruell & rparodi$(END)\n\n'
@printf '$(GREY) Made by rparodi$(END)\n\n'
# Footer
footer:
@ -117,9 +118,14 @@ footer:
@printf ' $(GREY)The compilation is$(END) $(GOLD)finish$(END)\n $(GREY)Have a good $(END)$(GOLD)correction !$(END)\n'
debug: CPPFLAGS += -D DEBUG=1 -g
# debug: CFLAGS += -fsanitize=address
debug: re
d: debug
b: bonus
db: CPPFLAGS += -D BONUS=1 -D DEBUG=1 -g
db: debug
tmux:
@tmux new-session -d -s $(NAME)
@tmux send-keys -t $(NAME):0 'vim' C-m

10
docker-compose.yml Normal file
View file

@ -0,0 +1,10 @@
services:
ft_ping:
build: .
container_name: ft_ping_dev
cap_add:
- NET_RAW
- NET_ADMIN
volumes:
- .:/home/devuser/ft_ping
tty: true