Exercise on memory management analyzer
This commit is contained in:
29
exercises/mem_analyzer/Makefile
Normal file
29
exercises/mem_analyzer/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -Wpadded -g -fsanitize=address
|
||||
TARGET = mem_analyzer
|
||||
SRC = mem_utils.c main.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
|
||||
.PHONY: all build run test valgrind clean
|
||||
|
||||
all: build
|
||||
|
||||
build: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
run: build
|
||||
./$(TARGET)
|
||||
|
||||
test: build
|
||||
./$(TARGET) test
|
||||
|
||||
valgrind: build
|
||||
valgrind --leak-check=full --show-leak-kinds=all ./$(TARGET)
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJ)
|
||||
Reference in New Issue
Block a user