# ------------------------------------------------------------------------
#
#	makefile for libvsi sample programs
#
#	This makefile will make the following programs:
#
#		vdnload		process user files
#		vfx		submit or image a fax request
#		vfxcancel	cancel a fax request
#		vfxilog		list the inbound fax log
#		vfxinfo		list a server resource
#		vfxolog		list the outbound fax log
#		vfxpb		manipulate person entries in a phone-book
#		vfxstat		get status of a fax request
#		vfxstatus	get pending changes to OLOG
#		vfxtry		modify a fax request
#
#	These programs are designed to provide the basic functionality
#	of the standard VSI clients and demonstrate the use of the
#	VSI API.
#
#	Targets:
#
#		all (default)	build all sample programs
#		usage		run all sample programs to get usage
#		clean		remove any built files
#
# ------------------------------------------------------------------------

# ------------------------------------------------------------------------
# names of sample programs
#
SAMPLE_SRC	= \
	tiffcopy.c \
	vdnload.c \
	vfx.c \
	vfxcvt.c \
	vfxcancel.c \
	vfxilog.c \
	vfxinfo.c \
	vfxolog.c \
	vfxpb.c \
	vfxstat.c \
	vfxstatus.c \
	vfxtry.c

SAMPLE_PGMS	= \
	${SAMPLE_SRC:.c=}

# ------------------------------------------------------------------------
# flags to be passed to various commands
#
CFLAGS	= $(COPTS)  $(OPTS)
LDFLAGS	= $(LDOPTS) $(OPTS)

# ------------------------------------------------------------------------
# libraries to link with
#
# note:	you have to set NETLIBS to any network libraries needed
#	(e.g., -lsocket -lnsl -lgen)
#
LIBS	= -lvsi $(NETLIBS)

# ------------------------------------------------------------------------
# targets to be built
#
all : $(SAMPLE_PGMS)

tiffcopy : tiffcopy.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vdnload : vdnload.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfx : vfx.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxcvt : vfxcvt.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxcancel : vfxcancel.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxilog : vfxilog.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxinfo : vfxinfo.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxolog : vfxolog.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxpb : vfxpb.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxstat : vfxstat.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxstatus : vfxstatus.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

vfxtry : vfxtry.o
	$(CC) $(LDFLAGS) $< $(LIBS) -o $@

# ------------------------------------------------------------------------
# maintenance targets
#
usage : all
	@for i in $(SAMPLE_PGMS); \
	do \
		echo "------ usage for $$i -----"; \
		$$i -?; \
	done

clean :
	rm -f *.o $(SAMPLE_PGMS)
