## This is a -*- makefile -*-

# What the Python binary is called on your system
PYTHON = @PYTHON@


# Prefix for constructing installation directory paths
prefix = @prefix@
exec_prefix = $(prefix)

# Installation command
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

# Various auxiliary programs
tar=tar
grep=grep
sed=sed
rm=rm
ln=ln
mkdir=mkdir
tar=tar

srcdir = @srcdir@
VPATH = @srcdir@
ERLC = @ERLC@

SOURCES = erl_node.py \
          erl_node_conn.py \
          erl_async_conn.py \
          erl_opts.py \
          erl_common.py \
          erl_epmd.py \
          erl_eventhandler.py \
          erl_term.py

TESTPROGRAMS = test_erl_epmd.py \
               test_erl_node.py \
               test_erl_node_conn.py \
               test_erl_node_tk_1.py \
               test_erl_node_pingpong.py \
               test_erl_node_pingpong.erl \
               run_test_erl_node_pingpong.sh

OBJECTS = test_erl_node_pingpong.beam


DISTFILES = $(SOURCES) $(TESTPROGRAMS) COPYING.LIB README \
	__init__.py \
        py_interface.pub \
        Makefile.in configure configure.in \
        mkinstalldirs install-sh


SHELL = /bin/sh
#.PHONY: all clean dist distclean install \
#	installdirs ps uninstall
.SUFFIXES: .beam .erl .py

%.beam:	%.erl
	$(ERLC) $*.erl

all: $(OBJECTS)

__init__.py: __init__.py.src
	version=`$(grep) vsn py_interface.pub | \
		 $(sed) 's/^.*\([0-9][0-9]*\),\([0-9][0-9]*\).*$$/\1.\2/'`;\
	$(sed) -e "s/@VSN@/$$version/g" <__init__.py.src >__init__.py



install: all installdirs

# Make sure all installation directories actually exist
# by making them if necessary.
installdirs: mkinstalldirs

#	$(srcdir)/mkinstalldirs $(pythondir)

uninstall:

#	-cd $(pythondir) && rm -f $(SOURCES) $(OBJECTS)

TAGS: $(SOURCES)
	cd $(srcdir) && etags $(SOURCES)

clean:
	rm -f $(OBJECTS)
	-rm -f *.aux *.cp *.cps *.fn *.ky *.log *.pg *.toc *.tp *.vr
	-rm -f *.html
	rm -f TAGS
	rm -f erl_crash.dump
	rm -f *.beam
	rm -f __init__.py

distclean: clean
	-rm -f *~ *.tar.gz
	rm -f Makefile config.status config.cache config.log

${srcdir}/configure: configure.in
	cd ${srcdir} && autoconf

Makefile: Makefile.in config.status
	./config.status

config.status: ${srcdir}/configure
	./config.status --recheck


dist: $(DISTFILES)
	version=`$(grep) vsn py_interface.pub | \
		 $(sed) 's/^.*\([0-9][0-9]*\),\([0-9][0-9]*\).*$$/\1.\2/'`;\
	distname=py_interface-$$version; \
	$(rm) -rf $$distname; \
	$(mkdir) $$distname; \
	for file in $(DISTFILES); do \
	  $(ln) $$file $$distname/$$file; \
	done; \
	$(tar) -chz -f $$distname.tar.gz $$distname; \
	$(tar) -chz -f $$distname.tgz $$distname; \
	$(rm) -rf $$distname


syntax highlighted by Code2HTML, v. 0.9.1