|
|
a9733e |
# build info
|
|
|
50bd76 |
PYTHON_VER = 2.7
|
|
|
50bd76 |
|
|
|
bb84fe |
CFLAGS_COMMON += -I$(PROJECT_DIR)/profiles
|
|
|
2a1a31 |
CFLAGS_COMMON += -I$(SOURCE_DIR)/Include
|
|
|
50bd76 |
|
|
|
c3000a |
CFLAGS_CONFIG += -DPLATFORM=\"$(PYTHON_PLATFORM)\"
|
|
|
50bd76 |
CFLAGS_CONFIG += -DVERSION=\"$(PYTHON_VER)\"
|
|
|
50bd76 |
CFLAGS_CONFIG += -DPREFIX=\"$(PREFIX)\"
|
|
|
50bd76 |
CFLAGS_CONFIG += -DEXEC_PREFIX=\"$(EXEC_PREFIX)\"
|
|
|
50bd76 |
CFLAGS_CONFIG += -DVPATH=\"$(SOURCE_DIR)\"
|
|
|
50bd76 |
CFLAGS_CONFIG += -DPYTHONPATH=\"$(PYTHON_PATH)\"
|
|
|
a9733e |
|
|
|
3d0b33 |
ifeq ($(ALL_STATIC),yes)
|
|
|
3d0b33 |
CFLAGS_STATIC += -DPY_ALL_STATIC
|
|
|
3d0b33 |
|
|
|
860c31 |
LDFLAGS_STATIC += $(PYEXT_STATIC)
|
|
|
3d0b33 |
|
|
|
3d0b33 |
LDFLAGS_STATIC += $(LDFLAGS_PYEXT_STATIC)
|
|
|
3d0b33 |
|
|
|
3d0b33 |
LDFLAGS_STATIC += $(LDFLAGS_NCURSES_STATIC)
|
|
|
3d0b33 |
LDFLAGS_STATIC += $(LDFLAGS_SQLITE_STATIC)
|
|
|
3d0b33 |
LDFLAGS_STATIC += $(LDFLAGS_EXPAT_STATIC)
|
|
|
3d0b33 |
LDFLAGS_STATIC += $(LDFLAGS_DBM_STATIC)
|
|
|
3d0b33 |
|
|
|
3d0b33 |
LDFLAGS_STATIC += $(LDFLAGS_PYEXT_STATIC)
|
|
|
3d0b33 |
else
|
|
|
3d0b33 |
COMMON_SRCS += $(DYNLOAD_SRCS)
|
|
|
3d0b33 |
CFLAGS_CONFIG += -DHAVE_DYNAMIC_LOADING
|
|
|
3d0b33 |
endif
|
|
|
a9733e |
|
|
|
a9733e |
# dynamically loaded extension module
|
|
|
a9733e |
pyext/%$(OS_LIB_SUFFIX): LDFLAGS_SONAME =
|
|
|
a9733e |
pyext/%$(OS_LIB_SUFFIX): LDFLAGS_DSOEXT = -Wl,-soname -Wl,$(subst pyext/,,$@)
|
|
|
a9733e |
pyext/%$(OS_LIB_SUFFIX): LDFLAGS_DYNEXT = $(LDFLAGS_DSOEXT) $(LDFLAGS_PYEXT)
|
|
|
a9733e |
|
|
|
f74581 |
pyext/%$(OS_LIB_SUFFIX): $(DSO_REF_SOLINK)
|
|
|
a9733e |
$(CC) -shared -o $@ $^ $(LDFLAGS_SHARED) $(LDFLAGS_DYNEXT) -l$(PACKAGE)
|
|
|
a9733e |
|
|
|
a9733e |
|
|
|
a9733e |
# statically linked extension
|
|
|
a9733e |
pyext/%$(OS_ARCHIVE_EXT):
|
|
|
a9733e |
rm -f $@
|
|
|
a9733e |
$(AR) rcs $@ $^
|
|
|
a9733e |
|
|
|
a9733e |
|
|
|
a9733e |
# compile rules for python's extension modules
|
|
|
a9733e |
Modules/cjkcodecs/%.lo: $(SOURCE_DIR)/Modules/cjkcodecs/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/cjkcodecs/%.o: $(SOURCE_DIR)/Modules/cjkcodecs/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/expat/%.lo: $(SOURCE_DIR)/Modules/expat/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/expat/%.o: $(SOURCE_DIR)/Modules/expat/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/zlib/%.lo: $(SOURCE_DIR)/Modules/zlib/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/zlib/%.o: $(SOURCE_DIR)/Modules/zlib/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_ctypes/%.lo: $(SOURCE_DIR)/Modules/_ctypes/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_ctypes/%.o: $(SOURCE_DIR)/Modules/_ctypes/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_io/%.lo: $(SOURCE_DIR)/Modules/_io/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_io/%.o: $(SOURCE_DIR)/Modules/_io/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_multiprocessing/%.lo: $(SOURCE_DIR)/Modules/_multiprocessing/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_multiprocessing/%.o: $(SOURCE_DIR)/Modules/_multiprocessing/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_sqlite/%.lo: $(SOURCE_DIR)/Modules/_sqlite/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
|
|
|
a9733e |
|
|
|
a9733e |
Modules/_sqlite/%.o: $(SOURCE_DIR)/Modules/_sqlite/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
|
|
|
a9733e |
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
|
|
|
a9733e |
|
|
|
a9733e |
# build rules for python's extension modules
|
|
|
a9733e |
include $(PROJECT_DIR)/project/pyexts.mk
|
|
|
91d171 |
|
|
|
91d171 |
|
|
|
91d171 |
# shared extension modules: desired subset
|
|
|
860c31 |
$(SHARED_APP): $(PYEXT_SHARED)
|
|
|
860c31 |
$(STATIC_APP): $(PYEXT_STATIC)
|