#
# Makefile.in for ircd/contrib
#
# $Id: Makefile.in,v 1.4 2003/01/30 08:02:12 strtok Exp $
#
CC		= @CC@
RM		= @RM@
SED             = @SED@
LEX		= @LEX@
LEXLIB		= @LEXLIB@
CFLAGS		= @IRC_CFLAGS@ -DIRCD_PREFIX=\"@prefix@\"
PICFLAGS	= @PICFLAGS@
MKDEP		= @MKDEP@
INSTALL		= @INSTALL@
INSTALL_PROGRAM	= @INSTALL_PROGRAM@
INSTALL_DATA	= @INSTALL_DATA@
INSTALL_SUID    = @INSTALL_PROGRAM@ -o root -m 4755
SHELL		= /bin/sh
AUTOMODULEDIR	= @prefix@/modules

SSL_LIBS	= @SSL_LIBS@
SSL_INCLUDES	= @SSL_INCLUDES@

IRCDLIBS	= @LIBS@ $(SSL_LIBS)

INCLUDES	= -I../include -I../adns $(SSL_INCLUDES)
CPPFLAGS	= ${INCLUDES} @CPPFLAGS@

SRCS =                          \
  m_clearchan.c			\
  m_flags.c                     \
  m_force.c			\
  m_jupe.c			\
  m_ltrace.c			\
  m_map.c			\
  m_mkpasswd.c                  \
  m_ojoin.c			\
  m_operspy.c			\
  m_opme.c			\
  m_tburst.c			\
  m_whois.c			\
  spy_admin_notice.c		\
  spy_info_notice.c		\
  spy_links_notice.c		\
  spy_motd_notice.c		\
  spy_stats_notice.c            \
  spy_stats_p_notice.c		\
  spy_trace_notice.c		\
  spy_whois_notice.c            \
  example_module.c

OBJS = ${SRCS:.c=.so}

default:	build
build: all
all: $(OBJS)

install: all
	@echo "Installing modules into $(AUTOMODULEDIR) .."
	@for file in $(OBJS); do \
		$(INSTALL_DATA) $$file $(AUTOMODULEDIR); \
	done

.SUFFIXES: .so

.c.so:
	${CC} ${PICFLAGS}  ${CPPFLAGS} ${CFLAGS} $< -o $@

.PHONY: depend clean distclean
depend:
	@${MKDEP} ${CPPFLAGS} ${SRCS} > .depend
	@sed s/\\\.o/\\\.so/ < .depend > .depend.tmp
	@sed -e '/^# DO NOT DELETE THIS LINE/,$$d' <Makefile >Makefile.depend
	@echo '# DO NOT DELETE THIS LINE!!!' >>Makefile.depend
	@echo '# make depend needs it.' >>Makefile.depend
	@cat .depend.tmp >>Makefile.depend
	@mv Makefile.depend Makefile
	@rm -f .depend.tmp .depend

clean:
	${RM} -f *.so *~ 

distclean: clean
	${RM} -f Makefile

