From 0a7eb6104854dac63d0e3dc057d457f17b48e657 Mon Sep 17 00:00:00 2001 From: KELES CEMRENUR <cemrenur.keles@etu.unistra.fr> Date: Sun, 24 Nov 2024 04:30:30 +0000 Subject: [PATCH] Update makefile --- makefile | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index d31fb0b..80f26aa 100644 --- a/makefile +++ b/makefile @@ -4,6 +4,7 @@ CFLAGS = -Wall -Wextra -Werror # Source files SRC = treemap.c +OBJ = $(SRC:.c=.o) HDR = treemap.h place.h # Output executable @@ -15,27 +16,42 @@ TEST_TARGET = test-treemap # Default target all: $(TARGET) - $(CC) $(CFLAGS) $(SRC) -o $(TARGET) + $(CC) $(CFLAGS) $(OBJ) -o $(TARGET) ./$(TARGET) > whatever.vector chmod +x vector2tex.sh ./vector2tex.sh < whatever.vector > whatever.tex pdflatex whatever.tex - + doxygen -g doxygen Doxyfile -# Build the test suite +$(TARGET): $(OBJ) + $(CC) $(CFLAGS) $(OBJ) -o $(TARGET) + +%.o: %.c $(HDR) + $(CC) $(CFLAGS) -c $< -o $@ + test: $(TEST_SRC) $(HDR) $(CC) $(CFLAGS) $(TEST_SRC) $(SRC) -o $(TEST_TARGET) ./$(TEST_TARGET) memcheck: $(TARGET) valgrind --leak-check=full ./$(TARGET) plain.txt + +doc: + doxygen -g + doxygen Doxyfile + -# Clean generated files -clean: - rm -f $(TARGET) $(TEST_TARGET) *.o *.tex *.pdf *.aux *.log Doxyfile +vector: $(TARGET) + ./$(TARGET) > whatever.vector + chmod +x vector2tex.sh + ./vector2tex.sh < whatever.vector > whatever.tex + pdflatex whatever.tex -.PHONY: all test doc memcheck clean +clean: + rm -f $(TARGET) $(TEST_TARGET) $(OBJ) *.o *.tex *.pdf *.aux *.log Doxyfile whatever.vector + rm -rf latex html +.PHONY: all test doc memcheck clean vector -- GitLab