# Makefile for src/mod/
# $Id: Makefile.in,v 1.21 2004-08-28 06:43:22 wcc Exp $

SHELL = @SHELL@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
MOD_UPDIR = @MOD_UPDIR@

@SET_MAKE@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

CC = @CC@
LD = @CC@
STRIP = @STRIP@
CFLAGS = @CFLAGS@ -I../.. -I$(top_srcdir) @DEFS@ $(CFLGS)
CPPFLAGS = @CPPFLAGS@
MOD_CFLAGS = @CFLAGS@ -I. -I../../.. -I$(MOD_UPDIR)$(top_srcdir) \
  -I$(MOD_UPDIR)$(top_srcdir)/src/mod @DEFS@ $(CFLGS)
MOD_CPPFLAGS = @CPPFLAGS@
XLIBS = @XLIBS@
MOD_EXT = @MOD_EXT@

# Note: The following three lines are automatically adjusted by
#       misc/modconfig. They have to be present here.
mods =
mod_objs =
mod_libs =

modconfig = $(top_srcdir)/misc/modconfig --bindir=../.. \
  --top_srcdir=$(top_srcdir)
egg_ac_parameters = @egg_ac_parameters@

MAKE_MOD = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD)' \
'STRIP=$(STRIP)' 'CFLAGS=$(MOD_CFLAGS)' 'CPPFLAGS=$(MOD_CPPFLAGS)' \
'XLIBS=$(XLIBS)' 'MOD_EXT=$(MOD_EXT)' 'SHELL=$(SHELL)' \
'MODULE_XLIBS=$(MODULE_XLIBS)'

MAKE_MODDEPEND = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' \
'CFLAGS=-I../../.. -I../../../src/mod -DMAKING_DEPEND -DHAVE_CONFIG_H -DMAKING_MODS'

doofus:
	@echo ""
	@echo "Let's try this from the right directory..."
	@echo ""
	@cd ../.. && $(MAKE)

modules: $(mod_libs)
	@echo ""
	@echo "All modules compiled."

static: $(mod_objs)
	@$(modconfig) static.h

.SUFFIXES:
.SUFFIXES: .mod .mod_so .mod_o

.mod.mod_so:
	@if test ! -d $*.mod; then mkdir $*.mod; fi; \
	if test ! -r $*.mod/Makefile; then \
		cp $(srcdir)/$*.mod/Makefile $*.mod/Makefile; \
	fi; \
	cd $*.mod && $(MAKE_MOD) 'VPATH=$(MOD_UPDIR)$(srcdir)/$*.mod' 'srcdir=$(MOD_UPDIR)$(srcdir)/$*.mod' 'MAKE=$(MAKE)' modules;

.mod.mod_o:
	@if test ! -d $*.mod; then mkdir $*.mod; fi; \
	if test ! -r $*.mod/Makefile; then \
		cp $(srcdir)/$*.mod/Makefile $*.mod/Makefile; \
	fi; \
	cd $*.mod && $(MAKE_MOD) 'VPATH=$(MOD_UPDIR)$(srcdir)/$*.mod' 'srcdir=$(MOD_UPDIR)$(srcdir)/$*.mod' 'MAKE=$(MAKE)' static;

depend:
	@for i in $(mods); do \
		if test ! -d $$i; then mkdir $$i; fi; \
		if test ! -r $$i/Makefile; then \
			cp $(srcdir)/$$i/Makefile $$i/Makefile; \
		fi; \
		(cd $$i && $(MAKE_MODDEPEND) "VPATH=$(MOD_UPDIR)$(srcdir)/$$i" "srcdir=$(MOD_UPDIR)$(srcdir)/$$i" depend); \
	done

config:
	@for i in $(mods); do \
		if test -f $(srcdir)/$$i/configure; then \
			modname=`echo $$i | sed -e 's/.mod//'`; \
			echo ""; \
			echo "Configuring module '$${modname}'."; \
			if test ! -d $$i; then mkdir $$i; fi; \
			(cd $$i && $(MOD_UPDIR)$(srcdir)/$$i/configure $(egg_ac_parameters) --cache-file=../../../config.cache --srcdir=$(MOD_UPDIR)$(top_srcdir)/src/mod/$$i); \
		fi; \
	done; \
	echo ""

clean:
	@rm -f *.o *.$(MOD_EXT) *~ static.h mod.xlibs
	@for i in *.mod; do \
		if test ! -d $$i; then mkdir $$i; fi; \
		if (test ! -r $$i/Makefile) && \
		   (test -r $(srcdir)/$$i/Makefile); then \
			cp $(srcdir)/$$i/Makefile $$i/Makefile; \
		fi; \
		if (test -r $$i/Makefile); then \
			(cd $$i; $(MAKE) "VPATH=$(MOD_UPDIR)$(srcdir)/$$i" "srcdir=$(MOD_UPDIR)$(srcdir)/$$i" 'MAKE=$(MAKE)' clean); \
		fi; \
	done

distclean:
	@rm -f *.o *.$(MOD_EXT) *~ static.h mod.xlibs
	@for i in *.mod; do \
		if test ! -d $$i; then mkdir $$i; fi; \
		if (test ! -r $$i/Makefile) && \
		   (test -r $(srcdir)/$$i/Makefile); then \
			cp $(srcdir)/$$i/Makefile $$i/Makefile; \
		fi; \
		if (test -r $$i/Makefile); then \
			(cd $$i; $(MAKE) "VPATH=$(MOD_UPDIR)$(srcdir)/$$i" "srcdir=$(MOD_UPDIR)$(srcdir)/$$i" 'MAKE=$(MAKE)' distclean); \
		fi; \
	done

install: install-help install-language

install-help:
	@echo "Copying module help files."
	@if test ! -d $(DEST)/help; then \
		echo "Creating 'help' subdirectory."; \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/help >/dev/null; \
	fi; \
	for i in $(mods); do \
		if test ! "x`echo $(srcdir)/$$i/help/*.help`" = "x$(srcdir)/$$i/help/*.help"; then \
			for h in $(srcdir)/$$i/help/*.help; do \
				$(INSTALL_DATA) $$h $(DEST)/help/; \
			done; \
		fi; \
	done;
	@if test ! -d $(DEST)/help/msg; then \
		echo "Creating 'help/msg' subdirectory."; \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/help/msg >/dev/null; \
	fi; \
	for i in $(mods); do \
		if test ! "x`echo $(srcdir)/$$i/help/msg/*.help`" = "x$(srcdir)/$$i/help/msg/*.help"; then \
			for h in $(srcdir)/$$i/help/msg/*.help; do \
				$(INSTALL_DATA) $$h $(DEST)/help/msg/; \
			done; \
		fi; \
	done;
	@if test ! -d $(DEST)/help/set; then \
		echo "Creating 'help/set' subdirectory."; \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/help/set >/dev/null; \
	fi; \
	for i in $(mods); do \
		if test ! "x`echo $(srcdir)/$$i/help/set/*.help`" = "x$(srcdir)/$$i/help/set/*.help"; then \
			for h in $(srcdir)/$$i/help/set/*.help; do \
				$(INSTALL_DATA) $$h $(DEST)/help/set/; \
			done; \
		fi; \
	done;

install-language:
	@echo "Copying module language files."
	@if test ! -d $(DEST)/language; then \
		echo "Creating 'language' subdirectory."; \
		$(top_srcdir)/misc/mkinstalldirs $(DEST)/language >/dev/null; \
	fi; \
	for i in $(mods); do \
		if test ! "x`echo $(srcdir)/$$i/language/*.lang`" = "x$(srcdir)/$$i/language/*.lang"; then \
			for h in $(srcdir)/$$i/language/*.lang; do \
				$(INSTALL_DATA) $$h $(DEST)/language/; \
			done; \
		fi; \
	done;

#safety hash


syntax highlighted by Code2HTML, v. 0.9.1