#!gmake -f $APCLIB/make/gmakeinclude		# APC Makefile

# $Header: /usr/local/cvsroot/apc/cmd/updown/Makefile,v 1.20 1993/08/30 00:56:43 scott Exp $

# $Log: Makefile,v $
# Revision 1.20  1993/08/30  00:56:43  scott
# Certain targets need APCLDFLAGSAFE on Interactive: conflicts between -lc_s
#    and other libraries when setlocale in multi-lingual software is used.
# Add cleanexe rule to delete executables but not *.o files, to force relink.
#
# Revision 1.19  1993/04/11  00:18:26  scott
# Link rz to rx and rb, and sz to sx and sb
#
# Revision 1.18  1993/04/10  22:50:20  scott
# Link kermit to lkermit and skermit.  As soon as we modify pupload.c and
#    pdnload to use C-Kermit version 5, remove this install2 -l command.
#
# Revision 1.17  1993/01/04  04:58:32  scott
# Use gmake feature that -lapc can be a dependent, so libapc.a can be anywhere
#
# Revision 1.16  1992/06/21  22:10:00  scott
# Don't need X25LIB in here.
# Make sure links to rx and sx are installed.
#
# Revision 1.15  1992/04/01  01:10:51  steve
# Remove VPATH stuff
#
# Revision 1.14  1992/01/21  20:32:57  scott
# Clean commands we don't install.
#
# Revision 1.13  1992/01/21  00:04:31  scott
# Only use $? if single dependent or archive.
#
# Revision 1.12  1991/12/05  03:45:08  scott
# Add mkdepend: target, and generate .o: targets with it.
# Relink if -lapc changes.
#
# Revision 1.11  1991/12/04  23:09:29  scott
# Use new install2/lginstall semantics
#
# Revision 1.10  1991/12/03  07:39:16  scott
# APCify.
# Install man pages.
#
# Revision 1.9  1991/11/30  20:58:16  scott
# *Really* added #!gmake line for new make
#
# Revision 1.8  1991/11/30  08:24:02  scott
# Added #!gmake line for new make.sh
#
# Revision 1.7  1991/10/10  23:34:45  brian
# add in updated lint tests
#

CFLAGS = -DPN -g -DCdP -DGLAS
# -I/src/lib/liblocal
LIBS = -ltermcap

APCMDS = sz rz

APCLINGS =# pdnload.t pupload.t

APCMANS = minirb.1 rz.1 sz.1

all: $(APCMDS) $(APCLINGS)
	@touch /tmp

install: all
	@install2 $(APCMDS) $(APCMANS)
	@install2 -l rz rx rb
	@install2 -l sz sx sb
	# get rid of this as soon as modify p*load.c to use c-kermit version 5:
	install2 -l kermit skermit lkermit
	@lginstall $(APCLINGS)

sz.o: sz.c rbsb.c			# rbsb.c is an include file (no rbsb.o)
	$(CC) $(CFLAGS) -DSV -DTXBSIZE=32768 -DNFGVMIN -c $<

rz.o: rz.c rbsb.c			# rbsb.c is an include file (no rbsb.o)
	$(CC) $(CFLAGS) -DSV -DMD=2 -c $<

sz: sz.o # -lapc
	$(CC) $(CFLAGS) $@.o -o $@ ${LIBS} $(APCLDFLAGS)
	@ln -f sz sb 2>/dev/null ; ln -f sz sx 2>/dev/null ; :

rz: rz.o # -lapc
	$(CC) $(CFLAGS) $@.o -o $@ ${LIBS} $(APCLDFLAGS)
	@ln -f rz rb 2>/dev/null ; ln -f rz rx 2>/dev/null ; :

pdnload: pdnload.o pdnload.t.o -lapc
	$(CC) $(CFLAGS) $@.o -o $@ ${LIBS} $(APCLDFLAGSAFE) 	

pupload: pupload.o pupload.t.o -lapc
	$(CC) $(CFLAGS) $@.o -o $@ ${LIBS} $(APCLDFLAGSAFE)

lint: lpdnload lpupload
lpdnload: pdnload.c
	$(LINT) -abuxh $(CFLAGS) pdnload.c
lpupload:
	$(LINT) -abuxh $(CFLAGS) pupload.c

cleanexe:
	-rm -f $(APCMDS) a.out core

clean:
	-rm -f $(APCMDS) rb rx sb sx *.o core a.out all install clean

mkdepend:
	mkdep $(APCFLAGS) $(CFLAGS) *.c

# the following are automatically generated by mkdepend: above

crc.o: crc.c
crctab.o: crctab.c
minirb.o: minirb.c
noioctl.o: noioctl.c
#pdnload.o: pdnload.c /usr/include/local/userio.h
#pdnload.o: /usr/include/local/uio_intrfc.h
#pupload.o: pupload.c /usr/include/local/userio.h
#pupload.o: /usr/include/local/uio_intrfc.h
rbsb.o: rbsb.c
rz.o: rz.c rbsb.c crctab.c zm.c zmodem.h zmr.c
sz.o: sz.c rbsb.c crctab.c zm.c zmodem.h zmr.c
zm.o: zm.c zmodem.h
zmr.o: zmr.c
