# $Id: Makefile.in 17051 2004-06-17 23:19:00Z androsyn $
CC		= gcc
INSTALL		= /usr/bin/install -c
INSTALL_BIN	= ${INSTALL}
INSTALL_DATA	= ${INSTALL} -m 644
INSTALL_SUID	= ${INSTALL} -o root -m 4755
RM		= /bin/rm
LEX		= flex
LEXLIB		= -lfl
CFLAGS		=  -O2 -Wall -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mcpu=ultrasparc -fPIC -DPIC -DIRCD_PREFIX=\"/usr\"
LDFLAGS		=  -Wl,-export-dynamic
MKDEP		= ${CC} -MM
MV		= /bin/mv
RM		= /bin/rm
CP		= /bin/cp
TOUCH		= /bin/touch

prefix		= /usr
exec_prefix	= /usr
exec_suffix	= @exec_suffix@
bindir		= /usr/bin
libexecdir	= /usr/libexec
confdir		= /etc/ircd
localstatedir	= /var
# Change this later! -- adrian
moduledir	= /usr/share/ircd/modules
automoduledir	= /usr/share/ircd/modules/autoload

# Local to the etc Makefile
mandir          = /usr/share/man/man8
MANPAGES        = ircd.8

CONFS		= example.conf example.efnet.conf
DEFAULTCONFS	= kline.conf dline.conf xline.conf resv.conf

SSL_LIBS	=  -lcrypto
SSL_INCLUDES	= 

IRCDLIBS	= -lcrypt  $(SSL_LIBS)

INCLUDES	= -I../include $(SSL_INCLUDES)
CPPFLAGS	= ${INCLUDES} 
 
install-mkdirs:
	-@if test ! -d $(DESTDIR)$(confdir); then \
		echo "mkdir $(confdir)"; \
		mkdir $(DESTDIR)$(confdir); \
	fi

	-@if test ! -d $(DESTDIR)$(mandir); then \
		echo "mkdir $(mandir)"; \
		mkdir $(DESTDIR)$(mandir); \
	fi

install: install-mkdirs build
	@echo "ircd: installing example config files ($(CONFS))"
	@for i in $(CONFS); do \
		if test -f $(DESTDIR)$(confdir)/$$i; then \
			$(MV) $(DESTDIR)$(confdir)/$$i $(DESTDIR)$(confdir)/$$i.old; \
		fi; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(confdir); \
	done

	@for i in $(DEFAULTCONFS); do \
		if test ! -f $(DESTDIR)$(confdir)/$$i; then \
			echo "ircd: creating config file ($$i)"; \
			${TOUCH} $(DESTDIR)$(confdir)/$$i; \
		fi; \
	done

	-@if test ! -f $(DESTDIR)$(confdir)/ircd.motd; then \
		echo "ircd: installing motd file (ircd.motd)"; \
		$(INSTALL_DATA) ircd.motd $(DESTDIR)$(confdir); \
	fi

	-@if test -f $(DESTDIR)$(confdir)/links.txt; then \
		$(RM) $(DESTDIR)$(confdir)/links.txt; \
	fi

	@echo "ircd: installing manpage"
	@for i in $(MANPAGES); do \
		if test ! -f $(DESTDIR)$(mandir)/$$i; then \
			$(INSTALL_DATA) $$i $(DESTDIR)$(mandir); \
		fi; \
	done

build:

clean:

depend:

lint:

distclean:
	${RM} -f Makefile
