-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
132 lines (108 loc) · 3.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
MAKE_DIR = $(PWD)
BUILD_DIR := $(MAKE_DIR)/builds
INT_DIR := $(MAKE_DIR)/obj
EXTERNALS_DIR := $(MAKE_DIR)/linuxext
INC_PATH :=
INC_PATH += -I$(MAKE_DIR)
INC_PATH += -I$(EXTERNALS_DIR)/include
LIB_PATH :=
LIB_PATH += -L$(INT_DIR)
LIB_PATH += -L$(EXTERNALS_DIR)/libs
CC = clang
CXX = clang++
LD = ld
RM = rm -f
AR = ar
WFLAGS :=
WFLAGS += -Wall -Werror -Wextra
WFLAGS += -Wno-unknown-pragmas -Wno-unused-parameter
WFLAGS += -Wno-unused-private-field
CXXFLAGS :=
CXXFLAGS += $(INC_PATH)
CXXFLAGS += $(WFLAGS) -ggdb -std=c++17 -fms-extensions -pthread
CXXFLAGS += -DTS_BUILD_DEBUG -DDEBUG
# CXXFLAGS += -DSFML_STATIC
CCFLAGS :=
CCFLAGS += $(INC_PATH)
CCFLAGS += $(WFLAGS) -ggdb -std=c11 -pthread
CCFLAGS += -DTS_BUILD_DEBUG -DDEBUG
MODULES :=
# MODULES += -Wl,--whole-archive
MODULES += -Wl,-Bstatic
MODULES += -lts-container -lts-lang -lts-math -lts-string
# MODULES += -lts-file -lts-sys -lts-thread
MODULES += -lts-file -lts-thread
MODULES += -lts-renderer
MODULES += -lts-engine -lts-input -lts-profiling -lts-resource
MODULES += -Wl,-Bdynamic
# MODULES += -Wl,--no-whole-archive
LDFLAGS :=
LDFLAGS += $(LIB_PATH)
LDFLAGS += $(MODULES)
LDFLAGS += -lstdc++fs
LDFLAGS += -lX11 -lXcursor -lXrandr
LDFLAGS += -lsfml-graphics -lsfml-window -lsfml-audio -lsfml-system
LDFLAGS += -lfreeimage
LDFLAGS += -lfmt -lvpx -lnestegg -lsiphash -llz4
# LDFLAGS += -Wl,--verbose
export MAKE_DIR CC CXX LD RM AR CCFLAGS CXXFLAGS LDFLAGS INC_PATH BUILD_DIR INT_DIR
all:
# Level 0
@$(MAKE) -C ts/container -f container.mk
@$(MAKE) -C ts/lang -f lang.mk
@$(MAKE) -C ts/math -f math.mk
@$(MAKE) -C ts/string -f string.mk
# Level 1
@$(MAKE) -C ts/file -f file.mk
# @$(MAKE) -C ts/sys -f sys.mk
@$(MAKE) -C ts/thread -f thread.mk
# Level 2
@$(MAKE) -C ts/renderer -f renderer.mk
# Level 3
@$(MAKE) -C ts/engine -f engine.mk
@$(MAKE) -C ts/input -f input.mk
@$(MAKE) -C ts/profiling -f profiling.mk
@$(MAKE) -C ts/resource -f resource.mk
# Level 4
@$(MAKE) -C ts/ivie -f ivie.mk
.PHONY: clean
clean:
# Level 0
@$(MAKE) -C ts/container -f container.mk clean
@$(MAKE) -C ts/lang -f lang.mk clean
@$(MAKE) -C ts/math -f math.mk clean
@$(MAKE) -C ts/string -f string.mk clean
# Level 1
@$(MAKE) -C ts/file -f file.mk clean
@$(MAKE) -C ts/sys -f sys.mk clean
@$(MAKE) -C ts/thread -f thread.mk clean
# Level 2
@$(MAKE) -C ts/renderer -f renderer.mk clean
# Level 3
@$(MAKE) -C ts/engine -f engine.mk clean
@$(MAKE) -C ts/input -f input.mk clean
@$(MAKE) -C ts/profiling -f profiling.mk clean
@$(MAKE) -C ts/resource -f resource.mk clean
# Level 4
@$(MAKE) -C ts/ivie -f ivie.mk clean
# Foreground colors
FBLACK :=$(shell tput setaf 0)
FRED :=$(shell tput setaf 1)
FGREEN :=$(shell tput setaf 2)
FYELLOW :=$(shell tput setaf 3)
FBLUE :=$(shell tput setaf 4)
FMAGENTA :=$(shell tput setaf 5)
FCYAN :=$(shell tput setaf 6)
FGRAY :=$(shell tput setaf 7)
# Background colors
BBLACK :=$(shell tput setab 0)
BRED :=$(shell tput setab 1)
BGREEN :=$(shell tput setab 2)
BYELLOW :=$(shell tput setab 3)
BBLUE :=$(shell tput setab 4)
BMAGENTA :=$(shell tput setab 5)
BCYAN :=$(shell tput setab 6)
BGRAY :=$(shell tput setab 7)
# Reset colors
NC :=$(shell tput sgr0)
export FBLACK FRED FGREEN FYELLOW FBLUE FMAGENTA FCYAN FGRAY BBLACK BRED BGREEN BYELLOW BBLUE BMAGENTA BCYAN BGRAY NC