Blame project/pycompile.mk

7a8b0c
PYCOMPILE_DIR		 = build.pycompile
04aa65
PYCOMPILE_CFGHOST	 = $(NATIVE_CC_CFGHOST)
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_TAGS		+= $(PYCOMPILE_DIR)/tree.tag
7a8b0c
PYCOMPILE_TAGS		+= $(PYCOMPILE_DIR)/config.tag
7a8b0c
3825e8
PYCOMPILE_CFLAGS	+= -std=c99
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)\"
2216cf
PYCOMPILE_CFLAGS	+= $(NATIVE_CC_CFLAGS)
7a8b0c
7cb4f6
PYCOMPILE_LDFLAGS	+= -lreadline -lm -lutil -lpthread
2216cf
PYCOMPILE_LDFLAGS	+= $(NATIVE_CC_LDFLAGS)
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
238bdc
		mkdir -p $(PYCOMPILE_DIR)/core
238bdc
		mkdir -p $(PYCOMPILE_DIR)/core/Modules
238bdc
		mkdir -p $(PYCOMPILE_DIR)/core/Objects
238bdc
		mkdir -p $(PYCOMPILE_DIR)/core/Parser
238bdc
		mkdir -p $(PYCOMPILE_DIR)/core/Python
eee989
		mkdir -p $(PYCOMPILE_DIR)/pyext
eee989
		mkdir -p $(PYCOMPILE_DIR)/pyext/obj
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
		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
17c5b4
	cp -p $(PROJECT_DIR)/config/$(CFGHOST)/config.c   $(PYCOMPILE_DIR)/build/
17c5b4
	cp -p $(PROJECT_DIR)/config/$(CFGHOST)/pyconfig.h $(PYCOMPILE_DIR)/build/
7a8b0c
	touch $(PYCOMPILE_DIR)/config.tag
17c5b4
	touch $(PYCOMPILE_DIR)/build/config.c
17c5b4
	touch $(PYCOMPILE_DIR)/build/pyconfig.h
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
238bdc
$(PYCOMPILE_DIR)/core/Modules/config.o:	$(PYCOMPILE_DIR)/build/config.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
7a8b0c
					$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
7a8b0c
238bdc
$(PYCOMPILE_DIR)/core/%.o:	$(SOURCE_DIR)/%.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
7a8b0c
				$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
7a8b0c
eee989
$(PYCOMPILE_DIR)/pyext/obj/%.o:	$(SOURCE_DIR)/Modules/%.c $(ALL_HEADERS) $(PYCOMPILE_TAGS)
eee989
				$(NATIVE_CC) -c -o $@ $< $(PYCOMPILE_CFLAGS)
eee989
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
238bdc
PYCOMPILE_SRCS =                    \
238bdc
	$(PYCOMPILE_APP_SRCS)       \
238bdc
	$(PYCOMPILE_CONFIG_SRCS)    \
238bdc
	$(PYCOMPILE_PYEXT_SRCS)     \
238bdc
	$(MODULE_SRCS)              \
238bdc
	$(OBJECT_SRCS)              \
238bdc
	$(PARSER_SRCS)              \
238bdc
	$(PYTHON_SRCS)
ec618c
238bdc
PYCOMPILE_OBJS = $(PYCOMPILE_SRCS:%.c=$(PYCOMPILE_DIR)/%.o)
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