forked from scanberg/hbao
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 941 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
Sources = main.cpp Camera.cpp Shader.cpp Framebuffer2D.cpp Log.cpp Geometry.cpp ObjLoader.cpp Surface.cpp MtlLoader.cpp
CFlags = -c -Wall -g -O3
LDFlags =
ObjectDir = obj/
SourceDir = src/
Executable = Program
BinDir =
SYS := $(shell gcc -dumpmachine)
ifneq (, $(findstring linux, $(SYS)))
LDFlags += -lglfw -lGLEW
else ifneq (, $(findstring mingw, $(SYS)))
LDFlags += -lglfw -lglew32 -lopengl32
else ifneq (, $(findstring darwin, $(SYS)))
LDFlags += -framework Cocoa -framework OpenGL -lglfw -lGLEW
endif
CC = g++
RM = rm
Objects = $(Sources:.cpp=.o)
CSources = $(addprefix $(SourceDir),$(Sources))
CObjects = $(addprefix $(ObjectDir),$(Objects))
CExecutable = $(addprefix $(BinDir),$(Executable))
all: $(CSources) $(CExecutable)
$(CExecutable): $(CObjects)
$(CC) $(CObjects) $(LDFlags) -o $@
$(ObjectDir)%.o: $(SourceDir)%.cpp
$(CC) $(CFlags) $< -o $@
clean:
$(RM) $(CObjects)