summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKonstantin Käfer <github@kkaefer.com>2014-01-07 16:52:23 +0100
committerKonstantin Käfer <github@kkaefer.com>2014-01-07 16:52:23 +0100
commit528eaf475e084508cb2d2d26df7d4136f1eb5e04 (patch)
tree87f9a7ecec23cb7cc37450e7cd5f34fa6248f750 /Makefile
parent044a7b5dcd92b1ba095f0768d24aa504fdf71a16 (diff)
downloadqtlocation-mapboxgl-528eaf475e084508cb2d2d26df7d4136f1eb5e04.tar.gz
emscripten support
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 14 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index a43f4f5f6c..3c3269d791 100644
--- a/Makefile
+++ b/Makefile
@@ -12,17 +12,17 @@ SRCS += src/renderer/painter.cpp
SRCS += src/renderer/shader.cpp
SRCS += src/renderer/shader-fill.cpp
SRCS += src/renderer/shader-line.cpp
+SRCS += src/shader/shaders.c
SRCS += src/util/mat4.c
-OBJS = $(patsubst %.mm,%.o,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRCS))))
+# OBJS = $(patsubst %.mm,%.o,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRCS))))
main: macosx
-library: $(OBJS)
-
macosx: SRCS += macosx/main.mm
-macosx: library
- $(CXX) $(OBJS) $(INCLUDE) -lglfw3 -framework OpenGL -framework Foundation -o macosx/main
+emscripten: SRCS += emscripten/main.cpp
+
+macosx emscripten: OBJS = $(patsubst %.mm,%.o,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRCS))))
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(INCLUDE) -c -o $@ $^
@@ -33,8 +33,16 @@ macosx: library
%.o: %.c
$(CC) $(CPPFLAGS) $(INCLUDE) -c -o $@ $^
+
+.SECONDEXPANSION:
+macosx: $$(OBJS)
+ $(CXX) $(OBJS) $(INCLUDE) -lglfw3 -framework OpenGL -framework Foundation -o macosx/main
+
+emscripten: $$(OBJS)
+ $(CXX) $(OBJS) $(INCLUDE) -o emscripten/main.js
+
clean:
rm -rf src/*/*.o
rm -rf macosx/main
-.PHONY: macosx
+.PHONY: macosx emscripten