seems like working lab2
This commit is contained in:
27
lab_2/Makefile
Normal file
27
lab_2/Makefile
Normal 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
|
||||
Reference in New Issue
Block a user