aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..230ae9e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+CXX = g++
+CXXFLAGS = -Wall -O2
+
+.PHONY: all clean remake
+
+all: graytrace
+
+clean:
+ rm -f graytrace graytrace.o lodepng.o
+
+remake: clean all
+
+
+graytrace: lodepng.o graytrace.cpp graytrace.o
+ $(CXX) $(CXXFLAGS) graytrace.o lodepng.o -o graytrace
+
+lodepng.o: lodepng.cpp lodepng.h
+ $(CXX) $(CXXFLAGS) -c -o lodepng.o lodepng.cpp
+
+lodepng.cpp:
+ @if ! test -e lodepng.cpp; then \
+ /bin/echo -n Downloading lodepng...\ ; \
+ curl -s 'https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.cpp' >lodepng.cpp; \
+ curl -s 'https://raw.githubusercontent.com/lvandeve/lodepng/master/lodepng.h' >lodepng.h; \
+ /bin/echo done.; \
+ fi