-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
52 lines (40 loc) · 1.24 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
ifdef CXX
clang := $(CXX)
else
clang := clang++
endif
ifdef WASMTIMEAPI
wasmtimeapi := $(WASMTIMEAPI)
else
wasmtimeapi := ../../wasmtime
endif
libwasmtime := $(wasmtimeapi)/lib/libwasmtime.a
ifdef GLFWLIB
libglfw := $(GLFWLIB)/libglfw3.a
else
libglfw := glfw/lib-arm64/libglfw3.a
endif
options := -std=c++17 -fms-extensions \
-Wno-error=extra-tokens -Wno-quoted-include-in-framework-header -O3
includes := -I$(wasmtimeapi)/include -I../../ -I../
link := $(libglfw) $(libwasmtime)
# extras for non-linux platform build
optionsextra := -stdlib=libc++
includesextra := -I -Iglm -Iglfw/include -I../../libs/rive-renderer/include \
-I../../libs/rive-renderer/submodules/rive-cpp/include
linkextra := -framework Foundation -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo
sources = demo.cpp ../../wander.cpp bmpread.c
objects = $(sources:.cpp=.o)
target = opengl
# clang wants this on lnx
CXXFLAGS = $(includes) $(options)
buildlinux: $(objects)
$(clang) $(objects) `pkg-config --libs glx` $(link) -o $(target)
build:
$(clang) $(includes) $(includesextra) \
$(options) $(optionsextra) \
$(link) $(linkextra) -o $(target) $(sources)
clean:
rm -f $(target) $(objects)
run: build
./opengl