# DSTART
#                      getpop3 - a POP3 client for Linux.
# 
#                    Copyright 1996, Double Precision, Inc.
# 
# THE SOFTWARE IS PROVIDED FREE OF CHARGE, "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
# EVENT SHALL DOUBLE PRECISION, INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, ARISING FROM, OUT OF, OR IN CONNECTION WITH, OR USE OF THIS
# SOFTWARE.
# 
# Permission is granted to copy and distribute this software provided:
# 
#   1. The original getpop3 *.tgz is distributed by itself, or as a component
#      of another distribution, without any modifications, or changes.
#      You may not charge for copying or distributing the original, unaltered,
#      program, except for a nominal fee to cover duplication costs only.
# 
#   2. If you distribute a modified version of getpop3 by itself, or as a
#      component of another distribution, you must clearly identify your
#      changes or alterations, and acknowledge that you are responsible for
#      supporting any changes, and, identify the author of the original version
#      of this product.
# 
# Please see the included documentation for further information.
# 
# DEND
#$Id: Makefile,v 1.10 1997/03/28 16:49:05 mrsam Exp $

AFXINCLUDE=afx
AFXLIB=afx/afx.a
AFXDIR=afx
AFXINCLUDE=afx
VERSION=getpop3_1.08
SHELL=/bin/bash
include Makefile.debug

CXXFLAGS=$(DODEBUG) -fno-strength-reduce -fhandle-exceptions -g -I$(AFXINCLUDE)
OBJ=main.o config.o ask.o suck.o asocket.o sigtrap.o $(AFXLIB)
SRC=main.C config.C ask.C suck.C asocket.C sigtrap.C
INCLUDE=ask.h config.h suck.h asocket.h sigtrap.h debug.h

ARFLAGS=rcs

ifndef	INCLUDE_DEPENDS
all:
	@$(MAKE) -$(MAKEFLAGS) Makefile.checkout
	@$(MAKE) -$(MAKEFLAGS) Makefile.depend
	cd $(AFXDIR) && $(MAKE)
	export INCLUDE_DEPENDS=1 ; $(MAKE) -$(MAKEFLAGS) getpop3
endif

getpop3: $(OBJ)
	$(CXX) -o getpop3 $(CXXFLAGS) $(OBJ)

ifdef INCLUDE_DEPENDS
include Makefile.depend
include Makefile.checkout
endif

Makefile.checkout: $(SRC) $(INCLUDE) Makefile Makefile.debug getpop3.8
	@for f in $(SRC) $(INCLUDE) Makefile Makefile.debug getpop3.8; do \
		if [ -f RCS/$$f",v" ] ; then \
		   echo "$$f: RCS/$$f"",v" ; echo "	co $$f" ; echo "" ;\
		fi ; done >Makefile.checkout

Makefile.depend: $(SRC) $(INCLUDE) Makefile
	@for f in $(SRC) $(AFXSRC) ; do echo -n $$f | sed "s/.$$/o: Makefile.debug $$f/" ; \
		$(CXX) -E $(CXXFLAGS) $$f | sed -n '/^# *[0-9]/p' | \
		sed 's/.*"\(.*\)".*/\1/;/\.C$$/d;s/\(.*\)/	\1 \\/' | sort | uniq; \
		echo "" ; echo ""; done > Makefile.depend

