Blame project/extras.mk

80140a
# build info
80140a
CFLAGS_COMMON += -I$(PROJECT_DIR)/profiles
80140a
CFLAGS_COMMON += -I$(SOURCE_DIR)/Include
80140a
80140a
CFLAGS_CONFIG += -DPLATFORM=\"$(PYTHON_PLATFORM)\"
80140a
CFLAGS_CONFIG += -DVERSION=\"$(PYTHON_VER)\"
80140a
CFLAGS_CONFIG += -DPREFIX=\"$(PREFIX)\"
80140a
CFLAGS_CONFIG += -DEXEC_PREFIX=\"$(EXEC_PREFIX)\"
80140a
CFLAGS_CONFIG += -DVPATH=\"$(SOURCE_DIR)\"
80140a
CFLAGS_CONFIG += -DPYTHONPATH=\"$(PYTHON_PATH)\"
f8777f
f8777f
# python's front-end utility
f8777f
LDFLAGS_DEPS    += -Wl,--as-needed
f8777f
LDFLAGS_DEPS    += -lm -lpthread -lutil -ldl -lcrypt
f8777f
LDFLAGS_DEPS    += -Wl,--no-as-needed
f8777f
f8777f
LDFLAGS_CONFIG  += $(LDFLAGS_DEPS)
f8777f
LDFLAGS_CONFIG  += -Wl,-rpath -Wl,$(LIBDIR)
f8777f
f8777f
ifeq ($(ALL_STATIC),yes)
f8777f
	CFLAGS_STATIC	+= -DPY_ALL_STATIC
f8777f
else
f8777f
	COMMON_SRCS	+= $(DYNLOAD_SRCS)
f8777f
	CFLAGS_CONFIG	+= -DHAVE_DYNAMIC_LOADING -DSOABI=\"$(PYTHON_SOABI)\"
f8777f
endif
6dc580
6dc580
# extension objects
6dc580
pyext/obj/%.lo:	$(SOURCE_DIR)/Modules/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
6dc580
		$(CC) -c -o $@ $< $(CFLAGS_SHARED)
6dc580
6dc580
pyext/obj/%.o:	$(SOURCE_DIR)/Modules/%.c $(ALL_HEADERS) host.tag tree.tag config.tag
6dc580
		$(CC) -c -o $@ $< $(CFLAGS_STATIC)
6dc580
6dc580
# dynamically loaded extension module
6dc580
pyext/%$(PYTHON_SOEXT): LDFLAGS_SONAME =
6dc580
pyext/%$(PYTHON_SOEXT): LDFLAGS_DSOEXT = -Wl,-soname -Wl,$(subst pyext/,,$@)
6dc580
pyext/%$(PYTHON_SOEXT): LDFLAGS_DYNEXT = $(LDFLAGS_DSOEXT) $(LDFLAGS_PYEXT)
6dc580
6dc580
pyext/%$(PYTHON_SOEXT): $(DSO_REF_SOLINK)
6dc580
	$(CC) -shared -o $@ $^ $(LDFLAGS_SHARED) $(LDFLAGS_DYNEXT) \
6dc580
		-l$(PACKAGE) $(LDFLAGS_DEPS)
6dc580
6dc580
# statically linked extensions
6dc580
pyext/%$(OS_ARCHIVE_EXT):
6dc580
	rm -f $@
6dc580
	$(AR) rcs $@ $^
6dc580
6dc580
# build rules for python's extension modules
6dc580
include $(PROJECT_DIR)/project/pyexts.mk
11abc8
11abc8
# shared extension modules: desired subset
11abc8
$(SHARED_APP): $(PYEXT_SHARED)
11abc8
$(STATIC_APP): $(PYEXT_STATIC)