#
# Makefile.in for servlink/src
#
# $Id: Makefile.in 715 2006-07-14 21:01:55Z michael $
#

CC              = @CC@
INSTALL         = @INSTALL@
INSTALL_BIN     = @INSTALL_PROGRAM@
CFLAGS          = @IRC_CFLAGS@
LDFLAGS         = @LDFLAGS@
MKDEP           = @MKDEP@
STDOUT		= @STDOUT@
MV              = @MV@
RM              = @RM@
SED		= @SED@
prefix          = @prefix@
exec_prefix     = $(DESTDIR)@exec_prefix@
bindir          = $(DESTDIR)@bindir@
datarootdir	= $(DESTDIR)@datarootdir@

CLOBBER		= @CLOBBER@
SSL_LIBS	= @SSL_LIBS@
SSL_INCLUDES	= @SSL_INCLUDES@
ZIP_LIB		= @ZLIB_LD@
IRCDLIBS        = @LIBS@ $(SSL_LIBS) $(ZIP_LIB)

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

PROGS		= servlink

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

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

all: .depend servlink

build: all

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

install: build
	mkdir -p $(bindir)
	@for i in $(PROGS); do \
                if test -f $(bindir)/$$i -a -z "$(CLOBBER)"; 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 $<

.depend:
	${MKDEP} ${CPPFLAGS} ${SOURCES} ${STDOUT}
	@${SED} -e '/^# Autogenerated - do not delete/,$$d' <Makefile >Makefile.depend
	@echo '# Autogenerated - do not delete' >>Makefile.depend
	@echo 'include .depend' >> Makefile.depend
	@${MV} Makefile.depend Makefile

clean:
	${RM} -f $(OBJECTS) servlink

distclean: clean
	${RM} -f Makefile .depend

.PHONY: clean distclean install build
