Multi threading downloader simulate [WIP]

This commit is contained in:
Fabio Scotto di Santolo
2025-07-29 16:08:16 +02:00
parent da62f6025f
commit 13b4869d99
3 changed files with 123 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Makefile for Multi-threaded File Downloader
CC := gcc
CFLAGS := -Wall -Wextra -pedantic -std=c11 -pthread -g
TARGET := downloader
SRC := main.c
OBJS := $(SRC:.c=.o)
.PHONY: all clean test valgrind
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
test: $(TARGET)
./downloader test1.txt test2.txt test3.txt
valgrind: $(TARGET)
valgrind --leak-check=full ./downloader test1.txt test2.txt
clean:
rm -f $(TARGET) $(OBJS)