#
# Copyright (C) 2003 Mihai RUSU (dizzy@roedu.net)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#

prefix		= @prefix@
exec_prefix	= @exec_prefix@

bindir         	= @bindir@
sbindir         = @sbindir@

SRC_SRCDIR      = @srcdir@

INSTALL         = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DIRS	= @INSTALL@ -d -m 755
ECHO		= echo

RMF		= rm -f

CPPFLAGS	= @DEFS@ -I"${SRC_SRCDIR}" @CPPFLAGS@
COMPILE		= @CC@ @CFLAGS@ ${CPPFLAGS} -c
LINK		= @CC@ @CFLAGS@ @LDFLAGS@
LINK_LIBS	= @LIBS@

unix2tcp_SBIN	= ${SRC_SRCDIR}/unix2tcp
unix2tcp_OBJS	= ${SRC_SRCDIR}/unix2tcp.o \
${SRC_SRCDIR}/server.o \
${SRC_SRCDIR}/mylog.o \
${SRC_SRCDIR}/list.o

utelnet_BIN	= ${SRC_SRCDIR}/utelnet
utelnet_OBJS	= ${SRC_SRCDIR}/utelnet.o

OBJS		= ${unix2tcp_OBJS} ${utelnet_OBJS}
SBINS		= ${unix2tcp_SBIN}
BINS		= ${utelnet_BIN}

all: ${SBINS} ${BINS}

${unix2tcp_SBIN}: ${unix2tcp_OBJS}
	@${RMF} $@
	${LINK} ${unix2tcp_OBJS} ${LINK_LIBS} -o $@


${utelnet_BIN}: ${utelnet_OBJS}
	@${RMF} $@
	${LINK} ${utelnet_OBJS} ${LINK_LIBS} -o $@

.c.o:
	${COMPILE} $< -o $@

clean:
	-${RMF} core
	-${RMF} ${OBJS}
	-${RMF} ${SBINS}
	-${RMF} ${BINS}
	-${RMF} *~

distclean: clean
	-${RMF} ${SRC_SRCDIR}/config.cache ${SRC_SRCDIR}/config.log ${SRC_SRCDIR}/config.status
	-${RMF} ${SRC_SRCDIR}/Makefile ${SRC_SRCDIR}/config.h

cvsclean: distclean
	-${RMF} ${SRC_SRCDIR}/configure ${SRC_SRCDIR}/config.h.in

install: install-sbin install-bin

install-bin: ${BINS}
	${INSTALL_DIRS} ${DESTDIR}/${bindir}
	@list='${BINS}'; for p in $$list; do \
	    if test -f $$p; then \
		${ECHO} "  ${INSTALL_PROGRAM} $$p ${DESTDIR}/${bindir}"; \
		${INSTALL_PROGRAM} $$p ${DESTDIR}/${bindir}; \
	    else :; fi; \
	done

install-sbin: ${SBINS}
	${INSTALL_DIRS} ${DESTDIR}/${sbindir}
	@list='${SBINS}'; for p in $$list; do \
	    if test -f $$p; then \
		${ECHO} "  ${INSTALL_PROGRAM} $$p ${DESTDIR}/${sbindir}"; \
		${INSTALL_PROGRAM} $$p ${DESTDIR}/${sbindir}; \
	    else :; fi; \
	done


syntax highlighted by Code2HTML, v. 0.9.1