Skip to content
Snippets Groups Projects
Commit 29b254fe authored by dario.genga's avatar dario.genga
Browse files

Update makefile to correctly compile the project

The make command was running the tests but not compiling the project.
Also added a missing matrix destroy to free the memory.
parent 6bde0e06
No related branches found
No related tags found
No related merge requests found
......@@ -15,3 +15,8 @@ Use this command to compile the project.
> `make clean`
Use this command to clean the project.
### Run the tests
> `make run_tests`
Use this command to start the tests.
\ No newline at end of file
......@@ -18,6 +18,7 @@ int main() {
matrix_init(&mat, m, n, val);
printf("Empty matrix %dx%d\n", m, n);
matrix_print(mat);
matrix_destroy(&mat);
// Init from array
matrix_init_from_array(&mat, m, n, data, s);
printf("Matrix %dx%d from array\n", m, n);
......
LIB=-lm
CC=gcc -Wall -Wextra -g
run_tests: tests
./$<
matrix: matrix.o main.o
$(CC) $^ -fsanitize=address -fsanitize=leak -o $@ $(LIB)
run_tests: tests
./$<
tests: test.o matrix.o
$(CC) $^ -fsanitize=address -fsanitize=leak -o $@ $(LIB)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment