CCOPTS=-ggdb -O0 -Wall -lpng -pthread
OUTFILE=mandelbrot

SRCFILES := $(wildcard *.cpp)

OBJFILES := $(patsubst %.cpp,build/%.o,$(SRCFILES))

all: $(OBJFILES)
	g++ $(CCOPTS) -o $(OUTFILE) $(OBJFILES)

build/%.o: %.cpp
	if [ ! -d "build" ]; then mkdir -p build; fi
	g++ $(CCOPTS) -c -o $@ $<

clean:
	rm -f build/*.o
	rm -f *.out
	rm -f compile_commands.json

run:
	./$(OUTFILE)
