-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
40 lines (28 loc) · 961 Bytes
/
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
CXX=g++
CFLAGS=-std=c++11 -g -Wall
EGL_INCLUDE=-I.
EGL_LDFLAGS=-lEGL -lGLESv2
GLFW_INCLUDE=-I. -I include -I $(HOME)/work/glfw-3.2.1/include
GLFW_LDFLAGS=-L $(HOME)/work/glfw-3.2.1/build/src -lglfw -ldl
all: get_image_egl get_image_glfw
# EGL
get_image_egl: main.cpp lodepng.o context_egl.o json.hpp timer.o
$(CXX) $(CFLAGS) -DGETIMAGE_CONTEXT=CONTEXT_EGL -o $@ $(EGL_INCLUDE) $+ $(EGL_LDFLAGS)
context_egl.o: context_egl.cpp
$(CXX) $(CFLAGS) -c $(EGL_INCLUDE) $?
# GLFW
get_image_glfw: main.cpp lodepng.o context_glfw.o glad.o json.hpp timer.o
$(CXX) $(CFLAGS) -DGETIMAGE_CONTEXT=CONTEXT_GLFW -o $@ $(GLFW_INCLUDE) $+ $(GLFW_LDFLAGS)
context_glfw.o: context_glfw.cpp
$(CXX) $(CFLAGS) -c $(GLFW_INCLUDE) $?
glad.o: glad.c
$(CXX) $(CFLAGS) -c $(GLFW_INCLUDE) $?
# PNG library
lodepng.o: lodepng.cpp
$(CXX) $(CFLAGS) -c $(INCLUDE) $?
# Timer
timer.o: timer.cpp
$(CXX) $(CFLAGS) -c $(INCLUDE) $?
PHONY: clean
clean:
rm -f get_image *.o *.h.gch