Write a simple UNIX cp clone

This commit is contained in:
Fabio Scotto di Santolo
2025-09-17 18:33:08 +02:00
parent ef8d74ec19
commit a611ca2fc3
3 changed files with 282 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
CC := gcc
CFLAGS := -Wall -Wextra -pedantic -std=c11 -pthread -g
TARGET := cp
SRC := main.c
OBJS := $(SRC:.c=.o)
.PHONY: all clean valgrind
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(TARGET) $(OBJS)