Files
CS-LABS/mine/lab_7/vlad/Makefile
2025-12-10 16:50:28 +07:00

43 lines
1014 B
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -g -pthread
MAX_REPL ?= 100
INPUT1 ?= in1.txt
OUTPUT1 ?= out1.txt
INPUT2 ?= in2.txt
OUTPUT2 ?= out2.txt
all: threads_pairs
threads_pairs: main.c
$(CC) $(CFLAGS) -o $@ $<
test_all: threads_pairs
@echo "=== Тест с двумя файлами ==="
@printf "aabb\nzzzz\n" > $(INPUT1)
@printf "hello\nkkk\n" > $(INPUT2)
./threads_pairs $(MAX_REPL) $(INPUT1) $(OUTPUT1) $(INPUT2) $(OUTPUT2)
@echo "--- $(INPUT1) -> $(OUTPUT1) ---"
@cat $(INPUT1)
@echo "-----"
@cat $(OUTPUT1)
@echo
@echo "--- $(INPUT2) -> $(OUTPUT2) ---"
@cat $(INPUT2)
@echo "-----"
@cat $(OUTPUT2)
clean:
@echo "Очистка..."
rm -f threads_pairs
rm -f in1.txt out1.txt in2.txt out2.txt
help:
@echo "Available targets:"
@echo " all - build threads_pairs"
@echo " test_all - run all tests"
@echo " clean - remove binaries and test files"
@echo " help - show this help"
.PHONY: all test_one test_two test_all clean help