#
# Makefile.in for servlink/src
#
# $Id: Makefile.in,v 1.13.14.2 2003/11/25 18:37:57 androsyn Exp $
#

CC              = @CC@
INSTALL         = @INSTALL@
INSTALL_BIN     = @INSTALL_PROGRAM@
INSTALL_DATA    = @INSTALL_DATA@
INSTALL_SUID    = @INSTALL_PROGRAM@ -o root -m 4755
RM              = @RM@
LEX             = @LEX@
LEXLIB          = @LEXLIB@
CFLAGS          = @IRC_CFLAGS@ -DIRCD_PREFIX=\"@prefix@\" -O2
LDFLAGS         = @LDFLAGS@
MKDEP           = @MKDEP@ -DIRCD_PREFIX=\"@prefix@\"
MV              = @MV@
RM              = @RM@
prefix          = @prefix@
exec_prefix     = @exec_prefix@
bindir          = @bindir@
libexecdir      = @libexecdir@
sysconfdir      = @sysconfdir@
localstatedir   = @localstatedir@

SSL_LIBS	= @SSL_LIBS@
SSL_INCLUDES	= @SSL_INCLUDES@

IRCDLIBS        = @LIBS@ $(SSL_LIBS)

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

PROGS		= servlink

SOURCES =     \
  servlink.c  \
  io.c        \
  control.c
  

OBJECTS = ${SOURCES:.c=.o}

all: servlink

build: all

servlink: ${OBJECTS}
	${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJECTS} ${IRCDLIBS}

install: build
	@for i in $(PROGS); do \
                if test -f $(bindir)/$$i; then \
                        echo $(MV) $(bindir)/$$i $(bindir)/$$i.old; \
                        $(MV) $(bindir)/$$i $(bindir)/$$i.old; \
                fi; \
                echo $(INSTALL_BIN) $$i $(bindir); \
                $(INSTALL_BIN) $$i $(bindir); \
        done

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

.PHONY: depend clean distclean
depend:
	@${MKDEP} ${CPPFLAGS} ${SOURCES} > .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

clean:
	${RM} -f *.o *~ *.core core servlink

lint:
	lint -aacgprxhH $(CPPFLAGS) -DIRCD_PREFIX=\"@prefix@\" $(SOURCES) >>../lint.out

distclean: clean
	${RM} -f Makefile setup.h

# End of Makefile
