Reicher82 / python / sbpython3

Forked from python/sbpython3 3 years ago
Clone

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)\"
fee85f
CFLAGS_CONFIG += -DABIFLAGS=\"\"
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
1fbb0e
1fbb0e
	LDFLAGS_STATIC	+= $(PYEXT_STATIC)
1fbb0e
1fbb0e
	LDFLAGS_STATIC	+= $(LDFLAGS_PYEXT_STATIC)
1fbb0e
1fbb0e
	LDFLAGS_STATIC	+= $(LDFLAGS_NCURSES_STATIC)
1fbb0e
	LDFLAGS_STATIC	+= $(LDFLAGS_SQLITE_STATIC)
1fbb0e
	LDFLAGS_STATIC	+= $(LDFLAGS_EXPAT_STATIC)
1fbb0e
	LDFLAGS_STATIC	+= $(LDFLAGS_DBM_STATIC)
1fbb0e
1fbb0e
	LDFLAGS_STATIC	+= $(LDFLAGS_PYEXT_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)
ca0fc2
ca0fc2
# pycompile (core native python executable for .pyc generation)
ca0fc2
include $(PROJECT_DIR)/project/pycompile.mk
f54c9d
f54c9d
# pydist (python's distributed .py scripts)
f54c9d
include $(PROJECT_DIR)/project/pydist.mk
9ef55b
9ef55b
# pycgen (python's distributed .pyc objects)
9ef55b
include $(PROJECT_DIR)/project/pycgen.mk
c7965a
c7965a
# pytools (python's {prefix}/bin script-based tools)
c7965a
include $(PROJECT_DIR)/project/pytools.mk
ab560c
ab560c
# pyinst  (python's custom install bits)
ab560c
include $(PROJECT_DIR)/project/pyinst.mk