Compare commits
3 commits
9c30479fcf
...
1449f852c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1449f852c0 | ||
|
|
55871d938d | ||
|
|
ccdb7fa121 |
3 changed files with 52 additions and 5 deletions
31
Dockerfile
Normal file
31
Dockerfile
Normal 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"]
|
||||
16
Makefile
16
Makefile
|
|
@ -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
10
docker-compose.yml
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue