/
isadoraf
/
MyWorkComp
Обзор
Документация
Войти
/
isadoraf
/
MyWorkComp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
C(Make)/String.h/Makefile
79 строк
2 KB
isadoraf
upgrade Repository
19 фев 2026, 10:44
19 фев 2026, 10:44
be1ac9e
Код
Авторство
О чём код?
SHELL = /bin/sh CC=gcc FLAGS= CFLAGS:=$(FLAGS) GCOV:=$(FLAGS) -coverage SRC=$(wildcard *.c) # https://runebook.dev/ru/docs/gnu_make/wildcard-function OBJS=$(patsubst %.c,%.o,$(wildcard *.c)) TEST_SRC=$(wildcard tests/*.c) TEST_OBJS=$(patsubst %.c,%.o,$(wildcard tests/*.c)) # $^ - prerequisites https://runebook.dev/ru/docs/gnu_make/automatic-variables # $< - first prerequisites # $@ - target .PHONY: all clean test gcov_report control debug run ext1_flag ext2_flag base_flag all: clean s21_string.a clean: -rm -rf *.o *.gcno *.gcda *.info report/ s21_string.a ./test tests/*.o test: $(TEST_OBJS) s21_string.a $(CC) $(CFLAGS) $^ -o test -lcheck -lm -lsubunit -L. -l:s21_string.a -make run $(TEST_OBJS): $(TEST_SRC) tests/test_s21.h s21_string.a: $(OBJS) ar rc $@ *.o ranlib s21_string.a gcov_report: clean ext1_flag s21_string.a base_flag $(TEST_OBJS) ext2_flag test lcov -t "s21_string_report" -o s21_string_report.info -c -d . genhtml -o report s21_string_report.info control: -cppcheck --error-exitcode=1 --enable=all --suppress=missingIncludeSystem --error-exitcode=1 *.c *.h tests/*.c tests/*.h -clang-format --Werror -n *.c *.h tests/*.c tests/*.h -cd ../materials/build/ && ./run.sh debug_: $(OBJS) debug/test.o $(CC) $(CFLAGS) $^ -o $@ -lm valgrind --tool=memcheck --leak-check=yes ./debug_ debug/test.o: debug/test.c run: -./test ext1_flag: $(eval CFLAGS:=$(GCOV)) ext2_flag: $(eval CFLAGS:=$(GCOV)) base_flag: $(eval CFLAGS:=$(FLAGS)) common.o: common.c common.h s21_insert.o: s21_insert.c s21_string.h s21_memchr.o: s21_memchr.c s21_string.h s21_memcmp.o: s21_memcmp.c s21_string.h s21_memcpy.o: s21_memcpy.c s21_string.h s21_memset.o: s21_memset.c s21_string.h s21_sprintf.o: s21_sprintf.c s21_sprintf.h s21_string.h common.c #s21_sscanf.o: s21_sscanf.c s21_sscanf.h s21_string.h common.c s21_strchr.o: s21_strchr.c s21_string.h s21_strcspn.o: s21_strcspn.c s21_string.h s21_strerror.o: s21_strerror.c s21_string.h s21_strlen.o: s21_strlen.c s21_string.h s21_strncat.o: s21_strncat.c s21_string.h s21_strncmp.o: s21_strncmp.c s21_string.h s21_strncpy.o: s21_strncpy.c s21_string.h s21_strpbrk.o: s21_strpbrk.c s21_string.h s21_strrchr.o: s21_strrchr.c s21_string.h s21_strstr.o: s21_strstr.c s21_string.h s21_strtok.o: s21_strtok.c s21_string.h s21_to_lower.o: s21_to_lower.c s21_string.h s21_to_upper.o: s21_to_upper.c s21_string.h s21_trim.o: s21_trim.c s21_string.h