# @configure_input@
#
# Makefile.in for Berzerk
# ./Makefile.in
#
# Copyright(c) 2008 by Dick Balaska and BuckoSoft, Corp.  dick@buckosoft.com
#

#SHELL	=	/bin/sh
DIRS	=	berzerk etc
#ExampleServer

prefix      =   @prefix@
sbindir		=	${prefix}/sbin
sysconfdir	=	${prefix}/etc

all: makeinclude ${datarootdir}
	@for dir in $(DIRS); do\
		echo "=== making $$dir ===";\
		(cd $$dir; $(MAKE) $(MFLAGS)) || exit 1;\
	done
	-@ echo "========================================================"
	-@echo "make all completed..."
	-@echo "now you should run make install"
	-@ echo "========================================================"

install: all
	@echo "================================================================="
	@echo "================================================================="
	@echo "===installing . to ${DESTDIR}${prefix} ==="
	@if [ ! -d ${DESTDIR}${prefix} ]; then \
		mkdir -p ${DESTDIR}${prefix} ;\
	fi
	@for dir in $(DIRS); do\
		echo "=== installing $$dir ===";\
		(cd $$dir; $(MAKE) $(MFLAGS) install )  || exit 1; \
	done
	@echo "================================================================="
	@echo "berzerk has been installed to ${DESTDIR}${prefix}"

depend: makeinclude
	@for dir in $(DIRS); do\
		echo "=== making dependencies in $$dir ===";\
		(cd $$dir; $(MAKE) $(MFLAGS) depend) || exit 1;\
	done

clean:
	-@ rm -f core config.cache *.o *.bck
	@for dir in $(DIRS); do\
		echo "=== cleaning $$dir ===";\
		(cd $$dir; $(MAKE) $(MFLAGS) clean) || exit 1;\
	done

# distclean the subdirectories first
distclean: clean
	@for dir in $(DIRS); do\
		echo "=== distcleaning $$dir ===";\
		(cd $$dir; $(MAKE) $(MFLAGS) distclean) || exit 1;\
	done
	@rm -f config.log config.h config.status makeinclude .serverpassword config.guess config.sub
	@rm -rf autom4te.cache
	@rm -f Makefile
	-@ echo "========================================================"
	-@ echo "= Note you will need to run ./configure before you can ="
	-@ echo "= build again                                          ="
	-@ echo "========================================================"

makeinclude: configure config.h.in makeinclude.in
	if test -f config.status; then \
		./config.status --recheck; \
		./config.status; \
	else \
		./configure; \
	fi

configure: configure.ac m4/ax_boost_base.m4 m4/ax_boost_program_options.m4 m4/ax_boost_regex.m4 m4/ax_with_prog.m4
	autoconf

# DIK We don't need this
# $(srcdir)/configure: configure.ac aclocal.m4
# 	cd $(srcdir) && autoconf

# DIK We don't need this
# autoheader might not change config.h.in, so touch a stamp file.
#$(srcdir)/config.h.in: stamp-h.in
#$(srcdir)/stamp-h.in: configure.ac aclocal.m4
#	cd $(srcdir) && autoheader
#	echo timestamp > $(srcdir)/stamp-h.in

config.h: stamp-h
stamp-h: config.h.in config.status
	./config.status

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

config.status: configure
	./config.status --recheck

#
# End of "$Id: Makefile.in,v 1.8 2009/10/13 02:22:53 dick Exp $".
#
