diff --git a/makefile b/makefile
index 8d2484642077a31bd3892a6faa825889273b58c5..98cf0967f6271e64d5291bf8604be3c0920ffbff 100644
--- a/makefile
+++ b/makefile
@@ -3,7 +3,7 @@ CC = gcc
 CFLAGS = -Wall -Wextra -Werror
 
 # Source files
-SRC = treemap.c split-binary.c place.c paint.c
+SRC = treemap.c
 HDR = treemap.h place.h
 
 # Output executable
@@ -15,10 +15,11 @@ TEST_TARGET = test-treemap
 
 # Default target
 all: $(TARGET)
-
-# Build the main executable
-$(TARGET): $(SRC) $(HDR)
 	$(CC) $(CFLAGS) $(SRC) -o $(TARGET)
+	./$(TARGET) > whatever.vector
+	chmod +x vector2tex.sh
+	./vector2tex.sh < whatever.vector > whatever.tex
+	pdflatex whatever.tex
 
 # Build the test suite
 test: $(TEST_SRC) $(HDR)
@@ -27,6 +28,7 @@ test: $(TEST_SRC) $(HDR)
 
 
 doc:
+	doxygen -g
 	doxygen Doxyfile
 
 
@@ -35,13 +37,11 @@ memcheck: $(TARGET)
 
 # Run vector2tex.sh and generate PDF
 vector2tex: $(TARGET)
-	./$(TARGET) > whatever.vector
-	chmod +x vector2tex.sh
-	./vector2tex.sh < whatever.vector > whatever.tex
-	pdflatex whatever.tex
+	
 
 # Clean generated files
 clean:
-	rm -f $(TARGET) $(TEST_TARGET) *.o *.tex *.pdf *.aux *.log	
+	rm -f $(TARGET) $(TEST_TARGET) *.o *.tex *.pdf *.aux *.log Doxyfile
 
 .PHONY: all test doc memcheck clean
+