This commit is contained in:
bronku 2025-10-14 16:35:41 +02:00
parent 2b222dda0b
commit 3b1db93d74
5 changed files with 126 additions and 72 deletions

View file

@ -1,25 +1,13 @@
# Compiler
CC = clang
CFLAGS = -Wall -Wextra -g
TARGET = file_sorting
BUILD_DIR = build
build/main: main.c build
clang main.c -o build/main
SRCS = main.c
OBJS = $(SRCS:%.c=$(BUILD_DIR)/%.o)
$(BUILD_DIR)/$(TARGET): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(BUILD_DIR)/$(TARGET)
$(BUILD_DIR)/%.o: %.c | $(BUILD_DIR)
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
build:
mkdir -p build
clean:
rm -rf build
run: $(BUILD_DIR)/$(TARGET)
$(BUILD_DIR)/$(TARGET)
run: build/main
build/main -f tests/1.in
.PHONY: clean run