summaryrefslogtreecommitdiff
path: root/makefile
blob: fad6a868c6e64e24bc05959febbac9249a488241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)