forked from OsnaCS/cg-14
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (33 loc) · 875 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
41
42
43
44
45
46
GAME_CPP := $(wildcard game/*.cpp)
GAME_HPP := $(wildcard game/*.hpp)
GAME_OBJ := $(GAME_CPP:game/%.cpp=obj/%.obj)
EXE_FILE := app
CXXFLAGS := -Wall -Wno-missing-braces -std=c++1y -I. -Ilibs/glfw/include
CXX := clang++
LDFLAGS := -Llibs -lglfw3 -lGLEW -lpthread -ljpeg -lpng
OS := $(shell uname -s)
ifeq ($(OS), Linux)
LDFLAGS += -lGL -lGLU -lX11 -lXxf86vm -lXi -lXrandr
endif
ifeq ($(OS), Darwin)
LDFLAGS += -framework Cocoa -framework OpenGL -framework CoreVideo -framework IOKit
endif
ifeq ($(RELEASE),1)
CXXFLAGS += -O3
else
CXXFLAGS += -g
endif
ifeq ($(ASAN), 1)
CXXFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
.PHONY: clean
$(EXE_FILE): $(GAME_OBJ)
$(CXX) -o $@ $(GAME_OBJ) lumina/lumina.a $(LDFLAGS)
obj/%.obj: game/%.cpp $(GAME_HPP) | obj
$(CXX) $(CXXFLAGS) -o $@ -c $<
obj:
mkdir obj
clean:
rm -rf obj/
rm -f $(EXE_FILE)