summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..fad6a86
--- /dev/null
+++ b/makefile
@@ -0,0 +1,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)