-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1.25 KB
/
Makefile
File metadata and controls
50 lines (37 loc) · 1.25 KB
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
# directory definitions
output_dir := ./build
APPNAME := $(output_dir)/MP-APS
# collect all source files
SRC += $(wildcard ./MP-APS/*.cpp)
SRC += $(wildcard ./MP-APS/Core/*.cpp)
SRC += $(wildcard ./MP-APS/Demos/*.cpp)
SRC += $(wildcard ./MP-APS/Graphics/*.cpp)
SRC += ./MP-APS/3rdParty/fmt/src/format.cc
SRC += ./MP-APS/3rdParty/glad/src/glad.c
# Use implicit rules to build object files from source files.
# We have *.cpp *.cc *.c source files.
OBJ := $(SRC:.cpp=.o)
OBJ := $(OBJ:.cc=.o)
OBJ := $(OBJ:.c=.o)
CPPFLAGS += -I./MP-APS/3rdParty/glm
CPPFLAGS += -I./MP-APS/3rdParty/glad/include
CPPFLAGS += -I./MP-APS/3rdParty/stb
CPPFLAGS += -I./MP-APS/3rdParty/fmt/include
CPPFLAGS += -I./MP-APS/3rdParty/pugixml/include
CPPFLAGS += -I./MP-APS/3rdParty/nuklear/include
CXXFLAGS += -std=c++17 -Wall -Wextra -Wno-unused-variable -march=native -isystem -O3
LDFLAGS +=
LDLIBS += -lstdc++fs -lGL -lglfw -lpthread -lassimp -ltbb
# virtual targets
.PHONY : all clean
all: $(APPNAME) copydata
$(output_dir):
mkdir -p $(output_dir)
copydata: $(output_dir)
# only update (this is faster, if already copied once)
cp -r -u ./MP-APS/Data $(output_dir)
$(APPNAME): $(OBJ) $(output_dir)
$(CXX) $(OBJ) -o $(APPNAME) $(LDFLAGS) $(LDLIBS)
clean:
$(RM) $(OBJ)
$(RM) -r $(output_dir)