This repository has been archived by the owner on Jul 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
GNUmakefile.Flags
278 lines (235 loc) · 17.7 KB
/
GNUmakefile.Flags
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
## @file
# SPDM library.
#
# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
#
# Build Configuration Macro Definition
#
ARCH = X64
TOOLCHAIN = GCC
TARGET = DEBUG
CRYPTO = MbedTls
ifeq ("$(ARCH)","X64")
$(info ARCH=X64)
else ifeq ("$(ARCH)","Ia32")
$(echo ARCH=Ia32)
else ifeq ("$(ARCH)","ARM")
$(echo ARCH=ARM)
else ifeq ("$(ARCH)","AArch64")
$(echo ARCH=AArch64)
else ifeq ("$(ARCH)","RiscV32")
$(echo ARCH=RiscV32)
else ifeq ("$(ARCH)","RiscV64")
$(echo ARCH=RiscV64)
else ifeq ("$(ARCH)","ARC")
$(echo ARCH=ARC)
else
$(error unknown ARCH)
endif
ifeq ("$(TOOLCHAIN)","GCC")
$(info TOOLCHAIN=GCC)
else ifeq ("$(TOOLCHAIN)","CLANG")
$(info TOOLCHAIN=CLANG)
else ifeq ("$(TOOLCHAIN)","ARM_GCC")
$(info TOOLCHAIN=ARM_GCC)
else ifeq ("$(TOOLCHAIN)","AARCH64_GCC")
$(info TOOLCHAIN=AARCH64_GCC)
else ifeq ("$(TOOLCHAIN)","RISCV32_GCC")
$(info TOOLCHAIN=RISCV32_GCC)
else ifeq ("$(TOOLCHAIN)","RISCV64_GCC")
$(info TOOLCHAIN=RISCV64_GCC)
else ifeq ("$(TOOLCHAIN)","ARC_GCC")
$(info TOOLCHAIN=ARC_GCC)
else ifeq ("$(TOOLCHAIN)","CBMC")
$(info TOOLCHAIN=CBMC)
else ifeq ("$(TOOLCHAIN)","AFL")
$(info TOOLCHAIN=AFL)
else ifeq ("$(TOOLCHAIN)","KLEE")
$(info TOOLCHAIN=KLEE)
else ifeq ("$(TOOLCHAIN)","LIBFUZZER")
$(info TOOLCHAIN=LIBFUZZER)
else
$(error unknown TOOLCHAIN)
endif
ifeq ("$(TARGET)","DEBUG")
$(info TARGET=DEBUG)
else ifeq ("$(TARGET)","RELEASE")
$(info TARGET=RELEASE)
else
$(error unknown TARGET)
endif
ifeq ("$(CRYPTO)","MbedTls")
$(info CRYPTO=MbedTls)
else ifeq ("$(CRYPTO)","Openssl")
$(info CRYPTO=Openssl)
else
$(error unknown CRYPTO)
endif
#
# Shell Command Macro
#
CP = cp -r -f
MD = mkdir -p
MV = mv -f
RD = rm -r -f
RM = rm -f
#
# Tools definitions specific to this module
#
MAKE = make
MAKEFILE = GNUmakefile
ifeq ("$(TOOLCHAIN)","CBMC")
CC = goto-cc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -maccumulate-outgoing-args -mno-red-zone -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare -DCBMC -DDEBUG_ASSERT_CHOICE=0
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
SLINK = echo
SLINK_FLAGS2 = >$@
DLINK = goto-cc
DLINK_OBJECT_FILES = $(STATIC_LIBRARY_OBJECT_FILES)
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error
else ifeq ("$(TOOLCHAIN)","GCC")
CC = gcc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -maccumulate-outgoing-args -mno-red-zone -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare
CC_FLAGS += -fstack-protector-all
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
CC_FLAGS += --coverage -fprofile-arcs -ftest-coverage
SLINK = gcc-ar
DLINK = gcc
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
DLINK_FLAGS += --coverage -lgcov -fprofile-arcs -ftest-coverage
else ifeq ("$(TOOLCHAIN)","ARM_GCC")
CC = arm-linux-gnueabi-gcc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
CC_FLAGS += --coverage -fprofile-arcs -ftest-coverage
SLINK = arm-linux-gnueabi-gcc-ar
DLINK = arm-linux-gnueabi-gcc
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
DLINK_FLAGS += --coverage -lgcov -fprofile-arcs -ftest-coverage
else ifeq ("$(TOOLCHAIN)","AARCH64_GCC")
CC = aarch64-linux-gnu-gcc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
CC_FLAGS += --coverage -fprofile-arcs -ftest-coverage
SLINK = aarch64-linux-gnu-gcc-ar
DLINK = aarch64-linux-gnu-gcc
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
DLINK_FLAGS += --coverage -lgcov -fprofile-arcs -ftest-coverage
else ifeq ("$(TOOLCHAIN)","RISCV32_GCC")
CC = riscv32-unknown-linux-gnu-gcc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
CC_FLAGS += --coverage -fprofile-arcs -ftest-coverage
SLINK = riscv32-unknown-linux-gnu-gcc-ar
DLINK = riscv32-unknown-linux-gnu-gcc
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
DLINK_FLAGS += --coverage -lgcov -fprofile-arcs -ftest-coverage
else ifeq ("$(TOOLCHAIN)","RISCV64_GCC")
CC = riscv64-linux-gnu-gcc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
CC_FLAGS += --coverage -fprofile-arcs -ftest-coverage
SLINK = riscv64-linux-gnu-gcc-ar
DLINK = riscv64-linux-gnu-gcc
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
DLINK_FLAGS += --coverage -lgcov -fprofile-arcs -ftest-coverage
else ifeq ("$(TOOLCHAIN)","ARC_GCC")
CC = arc-linux-gcc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
CC_FLAGS += --coverage -fprofile-arcs -ftest-coverage
SLINK = arc-linux-gcc-ar
DLINK = arc-linux-gcc
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
DLINK_FLAGS += --coverage -lgcov -fprofile-arcs -ftest-coverage
else ifeq ("$(TOOLCHAIN)","AFL")
CC = afl-gcc
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -maccumulate-outgoing-args -mno-red-zone -Wno-address -fpie -fno-asynchronous-unwind-tables -DUSING_LTO -Wno-switch -Wno-maybe-uninitialized -Wno-uninitialized -Wno-builtin-declaration-mismatch -Wno-nonnull-compare
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
SLINK = gcc-ar
DLINK = gcc
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
else ifeq ("$(TOOLCHAIN)","CLANG")
CC = clang
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -mno-red-zone -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
SLINK = llvm-ar
DLINK = clang
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie
else ifeq ("$(TOOLCHAIN)","KLEE")
CC = clang
CC_FLAGS = -c -g -fno-strict-aliasing -Wall -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -mno-red-zone -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -emit-llvm -DTEST_WITH_KLEE=TRUE -DDEBUG_ASSERT_CHOICE=0
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
SLINK = llvm-ar
DLINK = llvm-link
DLINK_OBJECT_FILES = $(STATIC_LIBRARY_OBJECT_FILES)
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME)
else ifeq ("$(TOOLCHAIN)","LIBFUZZER")
CC = clang
CC_FLAGS = -c -g -fshort-wchar -fno-strict-aliasing -Wall -Wno-array-bounds -ffunction-sections -fdata-sections -fno-common -mno-red-zone -Wno-address -fpie -fno-asynchronous-unwind-tables -flto -DUSING_LTO -Wno-switch -DTEST_WITH_LIBFUZZER=TRUE -O1 -fsanitize=fuzzer,address
MBEDTLS_FLAGS =
OPENSSL_FLAGS = -include Base.h -Wno-error=maybe-uninitialized -Wno-error=format -Wno-format -Wno-error=unused-but-set-variable
CMOCKA_FLAGS = -std=gnu99 -Wpedantic -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Werror=address -Wstrict-prototypes -Werror=strict-prototypes -Wwrite-strings -Werror=write-strings -Werror-implicit-function-declaration -Wpointer-arith -Werror=pointer-arith -Wdeclaration-after-statement -Werror=declaration-after-statement -Wreturn-type -Werror=return-type -Wuninitialized -Werror=uninitialized -Werror=strict-overflow -Wstrict-overflow=2 -Wno-format-zero-length -Wmissing-field-initializers -Wformat-security -Werror=format-security -fno-common -Wformat -fno-common -fstack-protector-strong
SLINK = llvm-ar
DLINK = clang
DLINK_OBJECT_FILES = -Wl,--start-group,@$(OUTPUT_DIR)/tmp.list,--end-group
DLINK_FLAGS = -o $(BIN_DIR)/$(BASE_NAME) -flto -L/usr/X11R6/lib
DLINK_FLAGS2 = -Wno-error -no-pie -fsanitize=fuzzer,address
endif
ifeq ("$(ARCH)","X64")
CC_FLAGS += -m64 -DNO_MSABI_VA_FUNCS -mcmodel=small
DLINK_FLAGS += -m64
else ifeq ("$(ARCH)","Ia32")
CC_FLAGS += -m32
DLINK_FLAGS += -m32
else ifeq ("$(ARCH)","ARM")
CC_FLAGS +=
endif
ifeq ("$(TARGET)","DEBUG")
CC_FLAGS += -O0
DLINK_FLAGS += -O0
else ifeq ("$(TARGET)","RELEASE")
CC_FLAGS += -Os
DLINK_FLAGS += -Os
endif