-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (41 loc) · 1.56 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
47
48
49
50
51
52
53
54
55
56
57
58
59
# IS_WINDOWS := yes # comment out when on linux
# building this doesn't work for windows yet, so if you wanna do that, ur on ur own rn
CXX = $(if $(IS_WINDOWS), clang-cl, clang++)
CC = $(if $(IS_WINDOWS), clang-cl, clang)
CFLAGS = -g -Wall
CXXFLAGS = -g -Wall
LIBS_LINUX := -l glfw
LIBS_WIN := /link "C:\Users\Chea Sextillion\include\glfw\lib-vc2022\glfw3.lib" /MD "C:\Users\Chea Sextillion\include\glfw\lib-vc2022\glfw3.dll"
LIBS = $(if $(IS_WINDOWS), $(LIBS_WIN), $(LIBS_LINUX))
O = build
OBJS = \
$(O)/glad.o \
$(O)/g_math.opp \
$(O)/r_common.opp \
$(O)/r_renderer.opp \
$(O)/g_actors.opp \
$(O)/g_spaces.opp
SRC_DIR := src
INCLUDES_WIN := -I "src\\include" -I "C:\\Users\\Chea Sextillion\\include" -I "C:\\Users\\Chea Sextillion\\include\\glfw\\include"
INCLUDES_LINUX := -I src/include #-I/usr/include/freetype2
INCLUDES = $(if $(IS_WINDOWS), $(INCLUDES_WIN), $(INCLUDES_LINUX))
# FPS limit for custom mangohud test run
FPS_LIMIT := 60
all: $(O)/graphx_linux
$(O)/graphx_linux: $(OBJS) $(O)/main.opp
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(O)/main.opp \
-o $(O)/graphx_linux $(LIBS)
$(O)/%.opp: src/%.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
$(O)/%.o: src/%.c
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
rm -f *.o *.opp
rm -f build/*
windows_clean:
move "build\\.gitignore" ".\\"
del /Q "build\\*"
move ".gitignore" "build\\"
test: $(O)/graphx_linux
~/bin/mangohudtest $(FPS_LIMIT) ./build/graphx_linux
# removed cleantest. edit the sublime-project on linux and make the pristine test build just call "make clean && make test && make clean"