# $Id: Makefile.in,v 1.5 2002/04/14 00:36:17 darren Exp $
#
# @WARNING@
#
# HylaFAX Facsimile Software
#

# VERSION:	@VERSION@
# DATE:		@DATE@
# TARGET:	@TARGET@
# CCOMPILER:	@CCOMPILER@
# CXXCOMPILER:	@CXXCOMPILER@
#
DEPTH=..

SRCDIR	= ${DEPTH}/${TOPSRCDIR}/pkg
VPATH	= ../@SRCDIR@/pkg
#
SHELL	= @SCRIPT_SH@
NULL	=
ECHO	= echo

all default:
	if [ ! -f copyright ]; then \
		cp $(VPATH)/../COPYRIGHT copyright ; \
	fi ; \
	for i in README depend make.links preremove proto.local ; do	\
		[ -f $$i ]  ||  cp $(VPATH)/$$i . ;			\
	done 

BINARIES=\
	../etc/lockname			\
	../etc/ondelay			\
	../faxalter/faxalter		\
	../faxcover/faxcover		\
	../faxd/choptest		\
	../faxd/cqtest			\
	../faxd/faxgetty		\
	../faxd/faxq			\
	../faxd/faxqclean		\
	../faxd/faxsend			\
	../faxd/mkhash			\
	../faxd/pagesend		\
	../faxd/tagtest			\
	../faxd/tsitest			\
	../faxmail/faxmail		\
	../faxrm/faxrm			\
	../faxstat/faxstat		\
	../hfaxd/hfaxd			\
	../sendfax/sendfax		\
	../sendpage/sendpage		\
	../util/dialtest		\
	../util/faxadduser		\
	../util/faxconfig		\
	../util/faxdeluser		\
	../util/faxinfo			\
	../util/faxmodem		\
	../util/faxmsg			\
	../util/faxstate		\
	../util/faxwatch		\
	../util/textfmt			\
	../util/tiffcheck		\
	../util/typetest		\
	${NULL}

package: cproto sproto all
	[ -d HylaFAX ]  &&  @RM@ -fr HylaFAX ;	\
	${ECHO} stripping the binaries ;		\
	for i in ${BINARIES} ; do			\
		strip ${SRCDIR}/$$i ;			\
	done ;						\
	if [ "@HTML@" = yes ]; then			\
		strip ${SRCDIR}/../html/tools/man2html;	\
		strip ${SRCDIR}/../html/tools/unquote;	\
	fi;						\
	@RM@ -f pkginfo 2>/dev/null;			\
	@RM@ -f request 2>/dev/null;			\
	cp cpkginfo pkginfo ;				\
	cp crequest request ;				\
	pkgmk -d `pwd` -f cproto ;			\
	pkgtrans -s `pwd` `pwd`/HylaFAX-client-@VERSION@-@PKG_ARCH@.pkg HylaFAX ; \
	@RM@ -fr HylaFAX ;				\
	@RM@ -f pkginfo 2>/dev/null;			\
	@RM@ -f request 2>/dev/null;			\
	cp spkginfo pkginfo ;				\
	cp srequest request ;				\
	pkgmk -d `pwd` -f sproto ;			\
	pkgtrans -s `pwd` `pwd`/HylaFAX-@VERSION@-@PKG_ARCH@.pkg HylaFAX

cproto: cproto.stub
	${SHELL} ./make_proto.sh client

sproto: sproto.stub
	${SHELL} ./make_proto.sh server

clean:
	@RM@ -f cproto sproto
	@RM@ -fr HylaFAX
	@RM@ -f HylaFAX-client-@VERSION@-@PKG_ARCH@.pkg
	@RM@ -f HylaFAX-@VERSION@-@PKG_ARCH@.pkg
	@RM@ -f pkginfo
	@RM@ -f request
	@RM@ -f core*

clobber distclean: clean
	@RM@ -f copyright
	@RM@ -f cpkginfo
	@RM@ -f cproto.stub
	@RM@ -f crequest
	@RM@ -f make_proto.sh
	@RM@ -f postinstall
	@RM@ -f postremove
	@RM@ -f spkginfo
	@RM@ -f sproto.stub
	@RM@ -f srequest
	@RM@ -f Makefile

