This commit is contained in:
2025-10-21 20:45:45 +07:00
parent e0d0c21c53
commit 9216d798ac
10 changed files with 184 additions and 19 deletions

27
lab_2/old/Makefile Normal file
View File

@@ -0,0 +1,27 @@
# Makefile
CC = gcc
CFLAGS = -Wall -Wextra -std=c99
LDFLAGS = -ldl
# Цель по умолчанию
all: task12 libtextlib.so
# Основная программа
task12: task12.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
# Динамическая библиотека
libtextlib.so: textlib.c
$(CC) $(CFLAGS) -fPIC -shared -o $@ $<
# Очистка
clean:
rm -f task12 libtextlib.so input.txt output.txt
# Тест
test: all
echo -e "Hello world\ntest line\nanother" > input.txt
./task12 input.txt output.txt 5 ./libtextlib.so
cat output.txt
.PHONY: all clean test