# Generated automatically from Makefile.in by configure.
# -*-Makefile-*-

DESTDIR =

prefix = /mit/pilot/share/python
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin

XGETTEXT = /usr/bin/xgettext
USE_NLS = no

PYTHON = python
INSTALL = /usr/athena/bin/install -c
SO = .so

MODULE_PATH = $(DESTDIR)/mit/python/arch/sun4x_57/lib/python2.0/site-packages
MODULE_DIR = $(MODULE_PATH)/Pyrite

INSTALL_DIRS = glue Application Conduit Connector Filter Platform Store test util

BINARIES = glue/*$(SO)

MAKE_SYMLINKS = no
COMPILE_PYTHON = yes
INSTALL_SULFUR = yes
INSTALL_BINARIES = yes

EXE = util/install.py util/sync.py util/info.py util/fetchusa.py util/runapp.py

APPLICATIONS = run sync install user product

all:
	cd glue; $(MAKE)
	if [ "$(INSTALL_SULFUR)" = "yes" ]; then \
	    cd Sulfur; ./configure; $(MAKE) ;\
	fi ;


install:
	if [ "$(INSTALL_SULFUR)" = "yes" ]; then \
	    cd Sulfur; $(MAKE) install ;\
	fi ;

	$(INSTALL) -m 755 -d $(MODULE_DIR)
	for i in $(INSTALL_DIRS) ; do \
	    if [ ! -d $(MODULE_DIR)/$$i ]; then \
	        mkdir $(MODULE_DIR)/$$i ; \
	    fi ; \
	done ;

	for i in `find . -path './Sulfur' -prune -o -name '*.py' -print` ; do \
	    cp $$i $(MODULE_DIR)/$$i ; \
	    chmod 644 $(MODULE_DIR)/$$i ; \
	done ;

	for i in `ls $(BINARIES)` ; do \
	    cp $$i $(MODULE_DIR)/$$i ; \
	    chmod 755 $(MODULE_DIR)/$$i ; \
	done ;

	for i in $(EXE) ; do \
	    chmod 755 $(MODULE_DIR)/$$i ; \
	done;

	if [ "$(COMPILE_PYTHON)" = "yes" ]; then \
	    $(PYTHON)    /mit/python/lib/python2.0/compileall.py $(MODULE_DIR) ; \
	    $(PYTHON) -O /mit/python/lib/python2.0/compileall.py $(MODULE_DIR) ; \
	fi ;

	cd i18n ; $(MAKE) install DESTDIR=$(DESTDIR)

	if [ "$(INSTALL_BINARIES)" = "yes" ]; then \
	  for i in $(APPLICATIONS) ; do \
	    ln -s $(MODULE_DIR)/util/runapp.py $(bindir)/pyrite-$$i ; \
	  done ; \
	fi ;

uninstall:
	@echo "***"
	@echo "Warning: uninstallation is not yet complete."
	@echo "***"
	if [ "$(INSTALL_SULFUR)" = "yes" ]; then \
	    cd Sulfur; $(MAKE) uninstall ;\
	fi ;

	rm -rf $(MODULE_DIR)

	if [ "$(INSTALL_BINARIES)" = "yes" ]; then \
	  for i in $(APPLICATIONS) ; do \
	    rm -f $(bindir)/pyrite-$$i ; \
	  done ; \
	fi ;

messages:
	if [ "$(USE_NLS)" = "yes" ]; then \
	    $(XGETTEXT) -L c -d pyrite --keyword=_ -o i18n/pyrite.pox \
	      *.py Application/*.py Conduit/*.py Connector/*.py Filter/*.py \
	      Platform/*.py Store/*.py util/*.py ; \
	fi ;

test:
	cd test; python regrtest.py

clean:
	rm -f config.cache config.log config.status
	cd glue; $(MAKE) clean
	cd i18n; $(MAKE) clean
	rm -f __init__.py Makefile glue/Makefile i18n/Makefile

.PHONY: test
