blob: 978dc74711fcb30ba02bf307d64d8c341767ec2e (
plain)
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
|
# build info
CFLAGS_COMMON += -I$(PROJECT_DIR)/profiles
CFLAGS_COMMON += -I$(PROJECT_DIR)/project/variants/$(PYTHON_MAJOR).$(PYTHON_MINOR).$(PYTHON_MICRO)
CFLAGS_COMMON += -I$(SOURCE_DIR)/Include
CFLAGS_CONFIG += -DPLATFORM=\"$(PYTHON_PLATFORM)\"
CFLAGS_CONFIG += -DVERSION=\"$(PYTHON_VER)\"
CFLAGS_CONFIG += -DPREFIX=\"$(PREFIX)\"
CFLAGS_CONFIG += -DEXEC_PREFIX=\"$(EXEC_PREFIX)\"
CFLAGS_CONFIG += -DVPATH=\"$(SOURCE_DIR)\"
CFLAGS_CONFIG += -DPYTHONPATH=\"$(PYTHON_PATH)\"
CFLAGS_CONFIG += -DABIFLAGS=\"$(PYTHON_ABIFL)\"
CFLAGS_CONFIG += -D_PYTHONFRAMEWORK=\"\"
# python's front-end utility
LDFLAGS_DEPS += -Wl,--as-needed
LDFLAGS_DEPS += -lm -lpthread -lutil -ldl -lcrypt
LDFLAGS_DEPS += -Wl,--no-as-needed
LDFLAGS_CONFIG += $(LDFLAGS_DEPS)
LDFLAGS_CONFIG += -Wl,-rpath -Wl,$(LIBDIR)
ifeq ($(ALL_STATIC),yes)
CFLAGS_STATIC += -DPY_ALL_STATIC
CFLAGS_STATIC += -I$(PROJECT_DIR)/wrappers/dlfcn
CFLAGS_STATIC += --include=dlfake.h
DLFAKE_SRCS += $(PROJECT_DIR)/wrappers/dlfcn/dlfake.c
DLFAKE_OBJS += core/Objects/dlfake.o
STATIC_OBJS += $(DLFAKE_OBJS)
LDFLAGS_STATIC += $(PYEXT_STATIC)
LDFLAGS_STATIC += $(LDFLAGS_PYEXT_STATIC)
LDFLAGS_STATIC += $(LDFLAGS_NCURSES_STATIC)
LDFLAGS_STATIC += $(LDFLAGS_SQLITE_STATIC)
LDFLAGS_STATIC += $(LDFLAGS_EXPAT_STATIC)
LDFLAGS_STATIC += $(LDFLAGS_DBM_STATIC)
LDFLAGS_STATIC += $(LDFLAGS_PYEXT_STATIC)
else
COMMON_SRCS += $(DYNLOAD_SRCS)
CFLAGS_CONFIG += -DHAVE_DYNAMIC_LOADING -DSOABI=\"$(PYTHON_SOABI)\"
endif
# dlfake
core/Objects/dlfake.o: $(DLFAKE_SRCS) $(ALL_HEADERS) host.tag tree.tag config.tag
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
# extension objects
pyext/obj/%.lo: $(SOURCE_DIR)/Modules/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
pyext/obj/%.o: $(SOURCE_DIR)/Modules/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
# dynamically loaded extension module
pyext/%$(PYTHON_SOEXT): LDFLAGS_SONAME =
pyext/%$(PYTHON_SOEXT): LDFLAGS_DSOEXT = -Wl,-soname -Wl,$(subst pyext/,,$@)
pyext/%$(PYTHON_SOEXT): LDFLAGS_DYNEXT = $(LDFLAGS_DSOEXT) $(LDFLAGS_PYEXT)
pyext/%$(PYTHON_SOEXT): $(DSO_REF_SOLINK)
$(CC) -shared -o $@ $^ $(LDFLAGS_SHARED) $(LDFLAGS_DYNEXT) \
-l$(PACKAGE) $(LDFLAGS_DEPS)
# statically linked extensions
pyext/%$(OS_ARCHIVE_EXT):
rm -f $@
$(AR) rcs $@ $^
# build rules for python's extension modules
include $(PROJECT_DIR)/project/pyexts.mk
# shared extension modules: desired subset
$(SHARED_APP): $(PYEXT_SHARED)
$(STATIC_APP): $(PYEXT_STATIC)
# pycompile (core native python executable for .pyc generation)
include $(PROJECT_DIR)/project/pycompile.mk
# pydist (python's distributed .py scripts)
include $(PROJECT_DIR)/project/pydist.mk
# pycgen (python's distributed .pyc objects)
include $(PROJECT_DIR)/project/pycgen.mk
# pytools (python's {prefix}/bin script-based tools)
include $(PROJECT_DIR)/project/pytools.mk
# pyinst (python's custom install bits)
include $(PROJECT_DIR)/project/pyinst.mk
|