-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 742 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
CC = g++
CFLAGS = -Wall -Werror -Wextra -std=c++17
TFLAGS = -lgtest -lstdc++
OBJECTS = s21_matrix_oop.o
SOURCE_DEC = s21_matrix_oop.cpp
# Проверка на mac m1
ifeq ($(shell uname -p), i386)
CFLAGS = -arch arm64 -Wall -Werror -Wextra -std=c++17 $(shell pkg-config --cflags gtest)
TFLAGS = $(shell pkg-config --libs gtest)
endif
LIB = s21_matrix_oop.a
all: s21_matrix_oop.a test
s21_matrix_oop.a:
$(CC) $(CFLAGS) -c $(SOURCE_DEC)
ar rcs $(LIB) $(OBJECTS)
ranlib $(LIB)
rm *.o
test: s21_matrix_oop.cpp test.cpp s21_matrix_oop.h
@$(CC) $(CFLAGS) s21_matrix_oop.cpp test.cpp $(TFLAGS) -o test
@./test
clean:
rm -rf *.o *.gcno *.a *.gcda test test_output
rebuild:
$(MAKE) clean
$(MAKE) all
leaks:
leaks -atExit -- ./test