-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile.uk
524 lines (491 loc) · 31.7 KB
/
Makefile.uk
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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# SPDX-License-Identifier: BSD-3-Clause
#
# python3 Makefile.uk
#
# Authors: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
# Costin Lupu <costin.lupu@cs.pub.ro>
# Andrei Tatar <andrei@unikraft.io>
#
# Copyright (c) 2019, University Politehnica of Bucharest. All rights reserved.
# Copyright (c) 2023, Unikraft GmbH and The Unikraft Authors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
################################################################################
# Library registration
################################################################################
ifeq ($(CONFIG_LIBPYTHON3),y)
ifeq ($(shell test $(CONFIG_STACK_SIZE_PAGE_ORDER) -lt 10; echo $$?),0)
$(error CONFIG_STACK_SIZE_PAGE_ORDER must be at least 10)
endif
endif
$(eval $(call addlib_s,libpython3,$(CONFIG_LIBPYTHON3)))
$(eval $(call addlib_s,libpython3_core,$(CONFIG_LIBPYTHON3)))
$(eval $(call addlib_s,libpython3_extensions,$(CONFIG_LIBPYTHON3)))
################################################################################
# Sources
################################################################################
LIBPYTHON3_VERSION=3.10
LIBPYTHON3_REVISION=11
LIBPYTHON3_VERSION_LONG=$(LIBPYTHON3_VERSION).$(LIBPYTHON3_REVISION)
LIBPYTHON3_BASENAME=Python-$(LIBPYTHON3_VERSION_LONG)
LIBPYTHON3_URL=https://www.python.org/ftp/python/$(LIBPYTHON3_VERSION_LONG)/$(LIBPYTHON3_BASENAME).tgz
LIBPYTHON3_PATCHDIR=$(LIBPYTHON3_BASE)/patches
$(eval $(call fetch,libpython3,$(LIBPYTHON3_URL)))
$(eval $(call patch,libpython3,$(LIBPYTHON3_PATCHDIR),$(LIBPYTHON3_BASENAME)))
################################################################################
# Helpers
################################################################################
LIBPYTHON3_SRC = $(LIBPYTHON3_ORIGIN)/$(LIBPYTHON3_BASENAME)
################################################################################
# Library includes
################################################################################
LIBPYTHON3_GLOBAL_INCLUDES-y += -I$(LIBPYTHON3_BASE)/include
LIBPYTHON3_GLOBAL_INCLUDES-y += -I$(LIBPYTHON3_SRC)/Include
LIBPYTHON3_COMMON_INCLUDES-y += -I$(LIBPYTHON3_SRC)/Include/internal
CINCLUDES-$(CONFIG_LIBPYTHON3) += $(LIBPYTHON3_GLOBAL_INCLUDES-y)
CXXINCLUDES-$(CONFIG_LIBPYTHON3) += $(LIBPYTHON3_GLOBAL_INCLUDES-y)
################################################################################
# Common flags
################################################################################
# Suppress flags
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-parameter
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-variable
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-value
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-function
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-missing-field-initializers
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-implicit-fallthrough
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-char-subscripts
LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-sign-compare
LIBPYTHON3_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-address
LIBPYTHON3_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-stringop-truncation
LIBPYTHON3_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-maybe-uninitialized
LIBPYTHON3_SUPPRESS_FLAGS-$(call have_clang) += -Wno-tautological-pointer-compare
LIBPYTHON3_SUPPRESS_FLAGS-$(call have_clang) += -Wno-documentation-unknown-command
LIBPYTHON3_SUPPRESS_FLAGS-$(call clang_version_ge,13,0) += -Wno-cast-function-type
LIBPYTHON3_SUPRESS_CFLAGS-y += $(LIBPYTHON3_SUPPRESS_FLAGS-y) \
-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
LIBPYTHON3_SUPRESS_CXXFLAGS-y += $(LIBPYTHON3_SUPPRESS_FLAGS-y)
# Common flags
LIBPYTHON3_COMMON_FLAGS-y += -fwrapv
LIBPYTHON3_COMMON_CFLAGS-y += $(LIBPYTHON3_COMMON_FLAGS-y)
LIBPYTHON3_COMMON_CXXFLAGS-y += $(LIBPYTHON3_COMMON_FLAGS-y)
# Common preprocessing symbols
LIBPYTHON3_COMMON_DEFINES-y += -DNDEBUG
LIBPYTHON3_COMMON_CFLAGS-y += $(LIBPYTHON3_COMMON_DEFINES-y)
LIBPYTHON3_COMMON_CXXFLAGS-y += $(LIBPYTHON3_COMMON_DEFINES-y)
################################################################################
# Glue code
################################################################################
# Include paths
LIBPYTHON3_CINCLUDES-y += $(LIBPYTHON3_COMMON_INCLUDES-y)
LIBPYTHON3_CXXINCLUDES-y += $(LIBPYTHON3_COMMON_INCLUDES-y)
LIBPYTHON3_SRCS-y += $(LIBPYTHON3_BASE)/init.c|unikraft
LIBPYTHON3_SRCS-y += $(LIBPYTHON3_BASE)/modules_config.c|unikraft
LIBPYTHON3_SRCS-y += $(LIBPYTHON3_BASE)/stubs.c|unikraft
LIBPYTHON3_SRCS-$(CONFIG_LIBPYTHON3_MAIN_FUNCTION) += $(LIBPYTHON3_BASE)/main.c|unikraft
################################################################################
# Python core
################################################################################
# Include paths
LIBPYTHON3_CORE_COMMON_INCLUDES-y += $(LIBPYTHON3_COMMON_INCLUDES-y)
LIBPYTHON3_CORE_CINCLUDES-y += $(LIBPYTHON3_CORE_COMMON_INCLUDES-y)
LIBPYTHON3_CORE_CXXINCLUDES-y += $(LIBPYTHON3_CORE_COMMON_INCLUDES-y)
# Supressed flags
LIBPYTHON3_CORE_CFLAGS-y += $(LIBPYTHON3_SUPRESS_CFLAGS-y)
LIBPYTHON3_CORE_CXXFLAGS-y += $(LIBPYTHON3_SUPRESS_CXXFLAGS-y)
# Preprocessing symbols
LIBPYTHON3_CORE_DEFINES-y += $(LIBPYTHON3_COMMON_DEFINES-y) -DPy_BUILD_CORE -DPy_BUILD_CORE_BUILTIN
LIBPYTHON3_CORE_CFLAGS-y += $(LIBPYTHON3_CORE_DEFINES-y)
LIBPYTHON3_CORE_CXXFLAGS-y += $(LIBPYTHON3_CORE_DEFINES-y)
#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Programs/python.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/myreadline.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/parser.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/peg_api.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/pegen.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/string_parser.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/token.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/tokenizer.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/abstract.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/accu.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/boolobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/bytearrayobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/bytes_methods.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/bytesobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/call.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/capsule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/cellobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/classobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/codeobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/complexobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/descrobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/dictobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/enumobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/exceptions.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/fileobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/floatobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/frameobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/funcobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/genericaliasobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/genobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/interpreteridobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/iterobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/listobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/longobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/memoryobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/methodobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/moduleobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/namespaceobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/object.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/obmalloc.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/odictobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/picklebufobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/rangeobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/setobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/sliceobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/structseq.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/tupleobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/typeobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/unicodectype.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/unicodeobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/unionobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/weakrefobject.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/asdl.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/ast.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/ast_opt.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/ast_unparse.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/bltinmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/bootstrap_hash.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/ceval.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/codecs.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/compile.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/context.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dtoa.c
#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dup2.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynamic_annotations.c
#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_hpux.c
#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_shlib.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_stub.c
#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_win.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/errors.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/fileutils.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/formatter_unicode.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/frozen.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/frozenmain.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/future.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getargs.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getcompiler.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getcopyright.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getopt.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getplatform.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getversion.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/hamt.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/hashtable.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/import.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/importdl.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/initconfig.c
LIBPYTHON3_CORE_INITCONFIG_FLAGS-y += -DPLATLIBDIR='"lib"'
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/marshal.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/modsupport.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/mysnprintf.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/mystrtoul.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pathconfig.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/preconfig.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pyarena.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pyctype.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pyfpe.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pyhash.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pylifecycle.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pymath.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pystate.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pystrcmp.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pystrhex.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pystrtod.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/Python-ast.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pythonrun.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pytime.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/structmember.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/suggestions.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/symtable.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/sysmodule.c
LIBPYTHON3_CORE_SYSMODULE_FLAGS-y += -DABIFLAGS='"m"' -DMULTIARCH=\"x86_64-linux-gnu\"
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/thread.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/traceback.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/_warnings.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_abc.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/atexitmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_codecsmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_collectionsmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/errnomodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/faulthandler.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_functoolsmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/gcmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/getbuildinfo.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/getpath.c
LIBPYTHON3_CORE_GETPATH_FLAGS-y += -DPYTHONPATH='"/lib/python$(LIBPYTHON3_VERSION)"' \
-DPREFIX='""' \
-DEXEC_PREFIX='""' \
-DVERSION='"$(LIBPYTHON3_VERSION)"' \
-DVPATH='""'
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/bufferedio.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/bytesio.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/fileio.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/iobase.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/_iomodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/stringio.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/textio.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/itertoolsmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_localemodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/main.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_math.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_operator.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/posixmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/pwdmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/signalmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sre.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_stat.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/symtablemodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_threadmodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/timemodule.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_tracemalloc.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_weakref.c
LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/xxsubtype.c
################################################################################
# Python extensions
################################################################################
# Include paths
LIBPYTHON3_EXTENSIONS_COMMON_INCLUDES-y += $(LIBPYTHON3_COMMON_INCLUDES-y)
LIBPYTHON3_EXTENSIONS_CINCLUDES-y += $(LIBPYTHON3_EXTENSIONS_COMMON_INCLUDES-y)
LIBPYTHON3_EXTENSIONS_CXXINCLUDES-y += $(LIBPYTHON3_EXTENSIONS_COMMON_INCLUDES-y)
# Supressed flags
LIBPYTHON3_EXTENSIONS_CFLAGS-y += $(LIBPYTHON3_SUPRESS_CFLAGS-y)
LIBPYTHON3_EXTENSIONS_CXXFLAGS-y += $(LIBPYTHON3_SUPRESS_CXXFLAGS-y)
# Preprocessing symbols
LIBPYTHON3_EXTENSIONS_DEFINES-y += $(LIBPYTHON3_COMMON_DEFINES-y) -DPy_BUILD_EXTENSIONS
LIBPYTHON3_EXTENSIONS_CFLAGS-y += $(LIBPYTHON3_EXTENSIONS_DEFINES-y)
LIBPYTHON3_EXTENSIONS_CXXFLAGS-y += $(LIBPYTHON3_EXTENSIONS_DEFINES-y)
LIBPYTHON3_EXTENSIONS_CFLAGS-y += -DPy_BUILD_CORE -DPy_BUILD_CORE_MODULE
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/arraymodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_asynciomodule.c
# Audio: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/audioop.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/binascii.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_bisectmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_blake2/blake2module.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_blake2/blake2b_impl.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_blake2/blake2s_impl.c
ifeq ($(CONFIG_LIBINTEL_INTRINSICS),y)
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_blake2/impl/blake2b.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_blake2/impl/blake2s.c
else
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_blake2/impl/blake2b-ref.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_blake2/impl/blake2s-ref.c
endif
LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_BZIP2) += $(LIBPYTHON3_SRC)/Modules/_bz2module.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cjkcodecs/_codecs_cn.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cjkcodecs/_codecs_hk.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cjkcodecs/_codecs_iso2022.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cjkcodecs/_codecs_jp.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cjkcodecs/_codecs_kr.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cjkcodecs/_codecs_tw.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cjkcodecs/multibytecodec.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/cmathmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_contextvarsmodule.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_cryptmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_csv.c
ifeq ($(CONFIG_LIBPYTHON3_EXTENSION_CTYPES),y)
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/callbacks.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/callproc.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/cfield.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/_ctypes.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/_ctypes_test.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/darwin/dlfcn_simple.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_msvc/ffi.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_msvc/prep_cif.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_msvc/types.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_msvc/win32.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_osx/ffi.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_osx/types.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/libffi_osx/x86/x86-ffi_darwin.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/malloc_closure.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_ctypes/stgdict.c
endif
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_cursesmodule.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_curses_panel.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_datetimemodule.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_dbmmodule.c
ifeq ($(CONFIG_LIBPYTHON3_EXTENSION_LIBMPDEC),y)
LIBPYTHON3_EXTENSIONS_CINCLUDES-y += -I$(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec
LIBPYTHON3_EXTENSIONS_CFLAGS-y += -DCONFIG_64 -DANSI
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/_decimal.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/basearith.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/bench.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/bench_full.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/constants.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/context.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/convolute.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/crt.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/difradix2.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/compare.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/div.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/divmod.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/multiply.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/pow.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/powmod.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/shift.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/sqrt.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/fnt.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/fourstep.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/io.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/mpalloc.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/mpdecimal.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/mpsignal.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/numbertheory.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/sixstep.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/transpose.c
endif
ifeq ($(CONFIG_LIBPYTHON3_EXTENSION_EXPAT),y)
LIBPYTHON3_EXTENSIONS_CINCLUDES-y += -I$(LIBPYTHON3_SRC)/Modules/expat
LIBPYTHON3_EXTENSIONS_CFLAGS-y += -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_elementtree.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmlparse.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmlrole.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmltok.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmltok_impl.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmltok_ns.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/pyexpat.c
endif
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/fcntlmodule.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_gdbmmodule.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/getaddrinfo.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/getnameinfo.c
# TODO enable LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/grpmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_SSL) += $(LIBPYTHON3_SRC)/Modules/_hashopenssl.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_heapqmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_json.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_lsprof.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_lzmamodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/mathmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/md5module.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/mmapmodule.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_multiprocessing/multiprocessing.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_multiprocessing/posixshmem.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_multiprocessing/semaphore.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/nismodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_opcode.c
# Audio: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/ossaudiodev.c
# Windows: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/overlapped.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_pickle.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_posixsubprocess.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_queuemodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_randommodule.c
# TODO enable LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/readline.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/resource.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/rotatingtree.c
# iOS: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_scproxy.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/selectmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/sha1module.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/sha256module.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sha3/kcp/KeccakHash.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sha3/kcp/KeccakP-1600-opt64.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sha3/kcp/KeccakSponge.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sha3/sha3module.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/sha512module.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/socketmodule.c
# TODO enable LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/spwdmodule.c
ifeq ($(CONFIG_LIBPYTHON3_EXTENSION_SQLITE),y)
LIBPYTHON3_EXTENSIONS_CACHE_FLAGS-$(CONFIG_LIBPYTHON3_EXTENSION_SQLITE) += -DMODULE_NAME='"sqlite3"' -DSQLITE_OMIT_LOAD_EXTENSION
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/cache.c
LIBPYTHON3_EXTENSIONS_CONNECTION_FLAGS-$(CONFIG_LIBPYTHON3_EXTENSION_SQLITE) += -DMODULE_NAME='"sqlite3"' -DSQLITE_OMIT_LOAD_EXTENSION
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/connection.c
LIBPYTHON3_EXTENSIONS_CURSOR_FLAGS-$(CONFIG_LIBPYTHON3_EXTENSION_SQLITE) += -DMODULE_NAME='"sqlite3"' -DSQLITE_OMIT_LOAD_EXTENSION
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/cursor.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/microprotocols.c
LIBPYTHON3_EXTENSIONS_MODULE_SQLITE_FLAGS-$(CONFIG_LIBPYTHON3_EXTENSION_SQLITE) += -DMODULE_NAME='"sqlite3"' -DSQLITE_OMIT_LOAD_EXTENSION
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/module.c|sqlite
LIBPYTHON3_EXTENSIONS_PREPARE_PROTOCOL_FLAGS-$(CONFIG_LIBPYTHON3_EXTENSION_SQLITE) += -DMODULE_NAME='"sqlite3"' -DSQLITE_OMIT_LOAD_EXTENSION
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/prepare_protocol.c
LIBPYTHON3_EXTENSIONS_ROW_FLAGS-$(CONFIG_LIBPYTHON3_EXTENSION_SQLITE) += -DMODULE_NAME='"sqlite3"' -DSQLITE_OMIT_LOAD_EXTENSION
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/row.c
LIBPYTHON3_EXTENSIONS_STATEMENT_FLAGS-$(CONFIG_LIBPYTHON3_EXTENSION_SQLITE) += -DMODULE_NAME='"sqlite3"' -DSQLITE_OMIT_LOAD_EXTENSION
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/statement.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/util.c|sqlite
endif
LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_SSL) += $(LIBPYTHON3_SRC)/Modules/_ssl.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_statisticsmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_struct.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/syslogmodule.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/termios.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testbuffer.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testcapimodule.c
LIBPYTHON3_EXTENSIONS__TESTCAPIMODULE_FLAGS-y += -UPy_BUILD_CORE -UPy_BUILD_CORE_MODULE
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testimportmultiple.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testinternalcapi.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testmultiphase.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/tkappinit.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_tkinter.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/unicodedata.c
LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_UUID) += $(LIBPYTHON3_SRC)/Modules/_uuidmodule.c
# Windows: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_winapi.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/xxlimited.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/xxmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_xxtestfuzz/fuzzer.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_xxtestfuzz/_xxtestfuzz.c
LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_ZLIB) += $(LIBPYTHON3_SRC)/Modules/zlibmodule.c
LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_zoneinfo.c
#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Misc/coverity_model.c
################################################################################
# Root filesystem
################################################################################
# Build root filesystem for Python interpreter
PYTHON_ROOTFS = $(APP_BASE)/$(path)
# Create virtual environment
$(PYTHON_ROOTFS)/.keep: $(LIBPYTHON3_BUILD)/.origin
@test $(LIBPYTHON3_VERSION) = `python -V | cut -d' ' -f2 | cut -d. -f1,2` || \
(echo -e "WARNING: creating virtualenv with wrong python version, pip might not work correctly\nPress return to continue" && read)
python -m venv $(PYTHON_ROOTFS)
find "$(PYTHON_ROOTFS)" -type d -name '__pycache__' | xargs rm -rf
touch $@
# Configure origin
$(PYTHON_ROOTFS)/.configured: $(PYTHON_ROOTFS)/.keep
cd $(LIBPYTHON3_SRC) && ./configure --prefix=$(shell realpath $(APP_BASE)/$(path))
rm -f $(LIBPYTHON3_SRC)/pyconfig.h
touch $@
# Install Python standard library into virtual environment
$(PYTHON_ROOTFS)/.done: $(PYTHON_ROOTFS)/.configured
cd $(LIBPYTHON3_SRC) && make libinstall
cp $(LIBPYTHON3_BASE)/_sysconfigdata.py $(PYTHON_ROOTFS)/lib/python$(LIBPYTHON3_VERSION)/
touch $@
$(PYTHON_ROOTFS)/.compiled: python-rootfs
test $(LIBPYTHON3_VERSION) = `python -V | cut -d' ' -f2 | cut -d. -f1,2` || \
(echo "ERROR: local Python version is not $(LIBPYTHON3_VERSION), cannot compile .py files" && false)
python -m compileall -x 'lib2to3/|test/bad' "$(PYTHON_ROOTFS)/lib"
touch $@
.PHONY: python-rootfs
python-rootfs: $(PYTHON_ROOTFS)/.done
python-rootfs-compiled: $(PYTHON_ROOTFS)/.compiled