collision done
This commit is contained in:
parent
15703b5f28
commit
c4171dc5d5
7 changed files with 436 additions and 266 deletions
44
src/Makefile
44
src/Makefile
|
|
@ -1,14 +1,32 @@
|
|||
.PHONY: all clean valgrind test style format gcov_report all install uninstall
|
||||
|
||||
# Автоопределение компилятора и флагов
|
||||
CC ?= gcc
|
||||
CFLAGS ?= -Wall -Wextra -std=c11 -g
|
||||
CHECK_CFLAGS ?= -I/usr/include/check
|
||||
|
||||
# Проверяем наличие библиотек
|
||||
CHECK_LIBS_AVAILABLE := $(shell ldconfig -p 2>/dev/null | grep -q libsubunit && echo yes || echo no)
|
||||
|
||||
ifeq ($(CHECK_LIBS_AVAILABLE),yes)
|
||||
LDFLAGS ?= -lcheck -lrt -lpthread -lm -lncurses -lsubunit
|
||||
else
|
||||
LDFLAGS ?= -lcheck -lrt -lpthread -lm -lncurses
|
||||
endif
|
||||
|
||||
SRCDIR = .
|
||||
TESTDIR = test
|
||||
BUILDDIR = build
|
||||
|
||||
# src/Makefile
|
||||
CC = gcc
|
||||
CFLAGS = -std=c11 -Wall -Wextra -Werror -g
|
||||
LDFLAGS = -lncurses
|
||||
TETRISDIR = brick_game/tetris
|
||||
CLIDIR = gui/cli
|
||||
|
||||
# Файлы
|
||||
TETRIS_SRC = $(TETRISDIR)/tetris.c
|
||||
CLI_SRC = $(CLIDIR)/main.c $(CLIDIR)/display.c
|
||||
OBJ = $(TETRIS_SRC:.c=.o) $(CLI_SRC:.c=.o)
|
||||
TETRIS_SRC = $(shell find $(TETRISDIR) -name "*.c")
|
||||
CLI_SRC = $(shell find $(CLIDIR) -name "*.c")
|
||||
ALL_SRC = $(TETRIS_SRC) $(CLI_SRC)
|
||||
OBJ = $(ALL_SRC:.c=.o)
|
||||
|
||||
# Имя исполняемого файла
|
||||
TARGET = tetris_bin
|
||||
|
|
@ -17,8 +35,6 @@ TARGET = tetris_bin
|
|||
PREFIX ?= /usr/local
|
||||
BINDIR = $(PREFIX)/bin
|
||||
|
||||
.PHONY: all install uninstall clean test gcov_report
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJ)
|
||||
|
|
@ -46,4 +62,14 @@ gcov_report: clean $(TARGET)
|
|||
gcov $(TETRIS_SRC)
|
||||
lcov --capture --directory . --output-file coverage.info
|
||||
genhtml coverage.info --output-directory coverage_report
|
||||
@echo "Coverage report generated in coverage_report/index.html"
|
||||
@echo "Coverage report generated in coverage_report/index.html"
|
||||
|
||||
style:
|
||||
@cp ../materials/linters/.clang-format .
|
||||
@clang-format -n *.c *.h
|
||||
@rm .clang-format
|
||||
|
||||
format:
|
||||
cp ../materials/linters/.clang-format .
|
||||
clang-format -i *.c *.h
|
||||
rm .clang-format
|
||||
Loading…
Add table
Add a link
Reference in a new issue