|
|
a9733e |
# build info
|
|
|
50bd76 |
PYTHON_VER = 2.7
|
|
|
50bd76 |
|
|
|
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 |
|
|
|
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
|
|
|
91d171 |
ifeq ($(ALL_STATIC),yes)
|
|
|
91d171 |
all: $(PYEXT_SUBSET_STATIC)
|
|
|
91d171 |
else
|
|
|
91d171 |
all: $(PYEXT_SUBSET_SHARED)
|
|
|
91d171 |
endif
|