Blame project/pycompile.mk

7a8b0c
PYCOMPILE_DIR		 = build.pycompile
7a8b0c
PYCOMPILE_PREFIX	 = $(CURDIR)/$(PYCOMPILE_DIR)
7a8b0c
PYCOMPILE_PATH		 =
7a8b0c
PYCOMPILE		 = $(PYCOMPILE_DIR)/bin/pycompile
7a8b0c
7a8b0c
PYCOMPILE_APP_SRCS	 = $(APP_SRCS)
7a8b0c
PYCOMPILE_CONFIG_SRCS	 = $(CONFIG_DEFAULT_SRCS)
7a8b0c
7a8b0c
PYCOMPILE_CFGHOST	?= $(NATIVE_CC_HOST)
7a8b0c
PYCOMPILE_CFGSTEP	?=
7a8b0c
7a8b0c
PYCOMPILE_TAGS		+= $(PYCOMPILE_DIR)/tree.tag
7a8b0c
PYCOMPILE_TAGS		+= $(PYCOMPILE_DIR)/config.tag
7a8b0c
7a8b0c
PYCOMPILE_CFLAGS	+= -I$(PYCOMPILE_DIR)/build
7a8b0c
PYCOMPILE_CFLAGS	+= -I$(PROJECT_DIR)/profiles
7a8b0c
PYCOMPILE_CFLAGS	+= -I$(SOURCE_DIR)/Include
ec618c
PYCOMPILE_CFLAGS	+= -DPY_FOR_PYCOMPILE
7a8b0c
PYCOMPILE_CFLAGS	+= -DVPATH=\"$(SOURCE_DIR)\"
7a8b0c
PYCOMPILE_CFLAGS	+= -DVERSION=\"$(PYTHON_VER)\"
7a8b0c
PYCOMPILE_CFLAGS	+= -DPLATFORM=\"$(NATIVE_OS)\"
7a8b0c
PYCOMPILE_CFLAGS	+= -DPREFIX=\"$(PYCOMPILE_PREFIX)\"
7a8b0c
PYCOMPILE_CFLAGS	+= -DEXEC_PREFIX=\"$(PYCOMPILE_PREFIX)\"
7a8b0c
PYCOMPILE_CFLAGS	+= -DPYTHONPATH=\"$(PYCOMPILE_PATH)\"
7a8b0c
7cb4f6
PYCOMPILE_LDFLAGS	+= -lreadline -lm -lutil -lpthread
ec618c
PYCOMPILE_LDFLAGS	+= $(LDFLAGS_NCURSES_STATIC)
7cb4f6
PYCOMPILE_LDFLAGS	+= -lreadline -lm -lutil -lpthread
ec618c
7a8b0c
$(PYCOMPILE_DIR)/tree.tag:
7a8b0c
		mkdir -p $(PYCOMPILE_DIR)/bin
7a8b0c
		mkdir -p $(PYCOMPILE_DIR)/lib
ec618c
		mkdir -p $(PYCOMPILE_DIR)/lib/$(NICKNAME)
ec618c
		mkdir -p $(PYCOMPILE_DIR)/lib/$(NICKNAME)/encodings
ec618c
		mkdir -p $(PYCOMPILE_DIR)/lib/$(NICKNAME)/lib-dynload
7a8b0c
		mkdir -p $(PYCOMPILE_DIR)/build
7a8b0c
		mkdir -p $(PYCOMPILE_DIR)/Modules
7a8b0c
		mkdir -p $(PYCOMPILE_DIR)/Objects
7a8b0c
		mkdir -p $(PYCOMPILE_DIR)/Parser
7a8b0c
		mkdir -p $(PYCOMPILE_DIR)/Python
7a8b0c
		touch $(PYCOMPILE_DIR)/tree.tag
7a8b0c
7a8b0c
ifeq ($(PYCOMPILE_CFGSTEP),)
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/config.tag:
7a8b0c
	$(MAKE) PYCOMPILE_CFGSTEP=yes                  \
7a8b0c
		PYCOMPILE_CFGHOST=$(PYCOMPILE_CFGHOST) \
7a8b0c
		CFGHOST=$(PYCOMPILE_CFGHOST)           \
7a8b0c
		$(PYCOMPILE_DIR)/config.tag
7a8b0c
else
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/config.tag:
7a8b0c
	mkdir -p $(PYCOMPILE_DIR)/build
7a8b0c
	cp -a $(PROJECT_DIR)/config/$(CFGHOST_SYNONYM)/config.c   $(PYCOMPILE_DIR)/build/
7a8b0c
	cp -a $(PROJECT_DIR)/config/$(CFGHOST_SYNONYM)/pyconfig.h $(PYCOMPILE_DIR)/build/
7a8b0c
	touch $(PYCOMPILE_DIR)/config.tag
7a8b0c
7a8b0c
endif
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/build/config.c:	$(PYCOMPILE_DIR)/config.tag
7a8b0c
$(PYCOMPILE_DIR)/build/pyconfig.h:	$(PYCOMPILE_DIR)/config.tag
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/Modules/config.o:	$(PYCOMPILE_DIR)/build/config.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
7a8b0c
					$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/Modules/%.o:	$(SOURCE_DIR)/Modules/%.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
7a8b0c
				$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/Objects/%.o:	$(SOURCE_DIR)/Objects/%.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
7a8b0c
				$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/Parser/%.o:	$(SOURCE_DIR)/Parser/%.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
7a8b0c
				$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
7a8b0c
7a8b0c
$(PYCOMPILE_DIR)/Python/%.o:	$(SOURCE_DIR)/Python/%.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
7a8b0c
				$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
7a8b0c
7a8b0c
ec618c
PYCOMPILE_PYEXT_SRCS = \
ec618c
	$(PYEXT_COLLECTIONS_SRCS)	\
ec618c
	$(PYEXT_FUNCTOOLS_SRCS)		\
ec618c
	$(PYEXT_HEAPQ_SRCS)		\
ec618c
	$(PYEXT_LOCALE_SRCS)		\
ec618c
	$(PYEXT_ITERTOOLS_SRCS)		\
ec618c
	$(PYEXT_OPERATOR_SRCS)		\
ec618c
	$(PYEXT_READLINE_SRCS)		\
ec618c
	$(PYEXT_STROP_SRCS)		\
ec618c
	$(PYEXT_UNICODEDATA_SRCS)	\
ec618c
ec618c
7a8b0c
PYCOMPILE_APP_OBJS	= $(PYCOMPILE_APP_SRCS:Modules/%.c=$(PYCOMPILE_DIR)/Modules/%.o)
7a8b0c
PYCOMPILE_CONFIG_OBJS	= $(PYCOMPILE_CONFIG_SRCS:Modules/%.c=$(PYCOMPILE_DIR)/Modules/%.o)
ec618c
PYCOMPILE_PYEXT_OBJS	= $(PYCOMPILE_PYEXT_SRCS:Modules/%.c=$(PYCOMPILE_DIR)/Modules/%.o)
7a8b0c
PYCOMPILE_MODULE_OBJS	= $(MODULE_SRCS:Modules/%.c=$(PYCOMPILE_DIR)/Modules/%.o)
7a8b0c
PYCOMPILE_OBJECT_OBJS	= $(OBJECT_SRCS:Objects/%.c=$(PYCOMPILE_DIR)/Objects/%.o)
7a8b0c
PYCOMPILE_PARSER_OBJS	= $(PARSER_SRCS:Parser/%.c=$(PYCOMPILE_DIR)/Parser/%.o)
7a8b0c
PYCOMPILE_PYTHON_OBJS	= $(PYTHON_SRCS:Python/%.c=$(PYCOMPILE_DIR)/Python/%.o)
7a8b0c
7a8b0c
PYCOMPILE_OBJS = \
7a8b0c
	$(PYCOMPILE_APP_OBJS)		\
7a8b0c
	$(PYCOMPILE_CONFIG_OBJS)	\
7a8b0c
	$(PYCOMPILE_MODULE_OBJS)	\
7a8b0c
	$(PYCOMPILE_OBJECT_OBJS)	\
7a8b0c
	$(PYCOMPILE_PARSER_OBJS)	\
7a8b0c
	$(PYCOMPILE_PYTHON_OBJS)	\
ec618c
	$(PYCOMPILE_PYEXT_OBJS)		\
ec618c
ec618c
ec618c
ifeq ($(PYCOMPILE_CFGSTEP),)
ec618c
ec618c
$(PYCOMPILE):	$(PYCOMPILE_OBJS)
ec618c
	$(MAKE) PYCOMPILE_CFGSTEP=yes                  \
ec618c
		PYCOMPILE_CFGHOST=$(PYCOMPILE_CFGHOST) \
ec618c
		CFGHOST=$(PYCOMPILE_CFGHOST)           \
ec618c
		pycompile
ec618c
else
7a8b0c
7a8b0c
$(PYCOMPILE):	$(PYCOMPILE_OBJS)
7a8b0c
		$(NATIVE_CC) -o $@ $^ $(PYCOMPILE_LDFLAGS)
7a8b0c
ec618c
endif
ec618c
ec618c
7a8b0c
pycompile:	$(PYCOMPILE)
7a8b0c
7a8b0c
pycompile-objs:	$(PYCOMPILE_OBJS)
7a8b0c
7a8b0c
pycompile-clean-config:
7a8b0c
	rm -f $(PYCOMPILE_DIR)/tree.tag
7a8b0c
	rm -f $(PYCOMPILE_DIR)/config.tag
7a8b0c
	rm -f $(PYCOMPILE_DIR)/build/config.c
7a8b0c
	rm -f $(PYCOMPILE_DIR)/build/pyconfig.h
7a8b0c
7a8b0c
pycompile-clean-objs:
7a8b0c
	rm -f $(PYCOMPILE_OBJS)
7a8b0c
7a8b0c
pycompile-clean-pycompile:
7a8b0c
	rm -f $(PYCOMPILE)
7a8b0c
7a8b0c
pycompile-clean:pycompile-clean-objs
7a8b0c
pycompile-clean:pycompile-clean-config
7a8b0c
pycompile-clean:pycompile-clean-pycompile
7a8b0c
7a8b0c
clean:		pycompile-clean-objs
7a8b0c
clean:		pycompile-clean-config
7a8b0c
clean:		pycompile-clean-pycompile
7a8b0c
7a8b0c
.PHONY:		pycompile               pycompile-objs
7a8b0c
		pycompile-clean         pycompile-clean-objs
7a8b0c
		pycompile-clean-config  pycompile-clean-pycompile