# Don't edit Makefile!  Use conf-* for configuration.
#
# Generated by spac see http://untroubled.org/spac/

SHELL=/bin/sh

DEFAULT: all

all: programs python

auto_pwd.c: 
	echo 'const char auto_pwd[] = "'`pwd`'";' >auto_pwd.c

auto_python2.c: 
	( set -e; PATH="/bin:/usr/bin:/usr/local/bin:$$PATH"; export PATH; \
	  python2=`which python2`; \
	  echo 'const char auto_python2[] = "'$$python2'";' ) >auto_python2.c

clean: TARGETS
	rm -f `cat TARGETS`

clean-spac: clean AUTOFILES
	rm -f `cat AUTOFILES`

commands/author.pyc: commands/author.py
	python -c '__import__("commands/author")'

commands/configure.pyc: commands/configure.py
	python -c '__import__("commands/configure")'

commands/feed.pyc: commands/feed.py
	python -c '__import__("commands/feed")'

commands/lists.pyc: commands/lists.py
	python -c '__import__("commands/lists")'

commands/monthbydate.pyc: commands/monthbydate.py
	python -c '__import__("commands/monthbydate")'

commands/monthbythread.pyc: commands/monthbythread.py
	python -c '__import__("commands/monthbythread")'

commands/months.pyc: commands/months.py
	python -c '__import__("commands/months")'

commands/search.pyc: commands/search.py
	python -c '__import__("commands/search")'

commands/showmsg.pyc: commands/showmsg.py
	python -c '__import__("commands/showmsg")'

commands/showthread.pyc: commands/showthread.py
	python -c '__import__("commands/showthread")'

commands/threadindex.pyc: commands/threadindex.py
	python -c '__import__("commands/threadindex")'

compile: conf-cc conf-bgincs
	( bgincs=`head -n 1 conf-bgincs`; \
	  echo '#!/bin/sh'; \
	  echo 'source=$$1; shift'; \
	  echo 'base=`echo "$$source" | sed -e s:\\\\.c$$::`'; \
	  echo exec `head -n 1 conf-cc` -I. "-I'$${bgincs}'" '-o $${base}.o -c $$source $${1+"$$@"}'; \
	) >compile
	chmod 755 compile

config.pyc: config.py
	python -c '__import__("config")'

context.pyc: context.py
	python -c '__import__("context")'

ezmlm.pyc: ezmlm.py
	python -c '__import__("ezmlm")'

feedgen.pyc: feedgen.py
	python -c '__import__("feedgen")'

globalfns.pyc: globalfns.py
	python -c '__import__("globalfns")'

globals.pyc: globals.py
	python -c '__import__("globals")'

load: conf-ld conf-bglibs
	( bglibs=`head -n 1 conf-bglibs`; \
	  echo '#!/bin/sh';\
	  echo 'main="$$1"; shift';\
	  echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \
	) >load
	chmod 755 load

main.pyc: main.py
	python -c '__import__("main")'

makedist.pyc: makedist.py
	python -c '__import__("makedist")'

programs: wrapper

python: config.pyc ezmlm.pyc globalfns.pyc main.pyc context.pyc makedist.pyc globals.pyc timezones.pyc feedgen.pyc version.pyc commands/lists.pyc commands/months.pyc commands/monthbythread.pyc commands/configure.pyc commands/feed.pyc commands/threadindex.pyc commands/showmsg.pyc commands/author.pyc commands/search.pyc commands/showthread.pyc commands/monthbydate.pyc version.pyc

timezones.pyc: timezones.py
	python -c '__import__("timezones")'

version.py: VERSION
	( \
	  echo program = \"`head -n 1 VERSION | cut -d' ' -f1`\"; \
	  echo version = \"`head -n 1 VERSION | cut -d' ' -f2`\"; \
	  echo full = \"`head -n 1 VERSION`\"; \
	) >$@

version.pyc: version.py
	python -c '__import__("version")'

wrapper: load wrapper.o
	./load wrapper   

wrapper.o: compile wrapper.c auto_pwd.c auto_python2.c
	./compile wrapper.c

