-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
46 lines (35 loc) · 1.28 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
# Object files to either reference or create
SOURCESENGINE=$(wildcard src/FireArrowEngine/*.cpp)
SOURCEFILESENGINE = $(SOURCESENGINE:src/FireArrowEngine/%=%)
SOURCESGAME=$(wildcard src/*.cpp)
SOURCEFILESGAME = $(SOURCESGAME:src/%=%)
# The executable file that will be created
EXEC = main
# The c++ flags to use for compilation
CXXFLAGS = -Wall
# The c++ compiler to use for compilation
CC = clang++
ENGINESDIR=src/FireArrowEngine/
GAMESDIR=src/
ODIR=build
ENGINEOBJECTS = $(addprefix $(ODIR)/, $(SOURCEFILESENGINE:.cpp=.o))
GAMEOBJECTS = $(addprefix $(ODIR)/, $(SOURCEFILESGAME:.cpp=.o))
lIBDIR=lib/
IDIR=include/
LIB=-lglfw3 -lIL -ltiff -lpng16 -lz -ljasper -ljpeg -llzma -lfreetype -lbz2 -lmng -llcms
#OSX frameworks
FRAMEWORKS=-framework IOKit -framework Cocoa -framework OpenGL -framework CoreVideo
# This section is called on 'make'
# Will call compile, and then call clean
all: $(GAMEOBJECTS) build/FireArrow.a
$(CC) -L $(lIBDIR) -std=c++11 -o $(EXEC) $^ $(FRAMEWORKS) $(LIB)
build/FireArrow.a: $(ENGINEOBJECTS)
ar rvs build/FireArrow.a $^
$(ODIR)/%.o: $(GAMESDIR)/%.cpp
$(CC) -I $(IDIR) -std=c++11 -Wno-c++11-long-long -Wall -c -o $@ $<
$(ODIR)/%.o: $(ENGINESDIR)/%.cpp
$(CC) -I $(IDIR) -std=c++11 -Wno-c++11-long-long -Wall -c -o $@ $<
clean:
rm -f $(ODIR)/*.o
rm -f $(ODIR)/*.a
rm $(EXEC)