home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume26
/
port-lpr
/
part01
/
Makefile
< prev
next >
Wrap
Makefile
|
1993-04-09
|
3KB
|
123 lines
# fix SysV brain-damage
SHELL=/bin/sh
#
DEFAULT_SERVER=
#
# pick a back-end driver from one of the following:
#
DRIVER=unix-tcp.o # UNIX w/BSD-style sockets
# (others to follow...maybe)
#
# This program was originally developed with GCC, but it doesn't always
# use the same calling sequence as the system libraries (particularly
# inet_ntoa()), so I don't use it for this anymore.
# If your C compiler runs on UNIX, but doesn't define "unix" as a macro,
# define it on the CFLAGS line with -Dunix
# Don't get nervous, I always compile with -g.
#
#CC=gcc -ansi -g -Dunix
CFLAGS=-g -Dunix
#
# nroff (or some facsimile thereof) is used to format the man pages.
# I used groff because that way I don't end up with man pages that say
# "SunOS" or "Ultrix" or some such.
#
#NROFF=nroff
NROFF=groff -Tascii
#
# Set BINDIR to the directory where the program will be installed.
# This doesn't affect the compilation, so you can set this after
# compiling.
#
BINDIR=/usr/local/bin
#
# Set GWDIR to where the (optional) dnet-to-tcp lpr gateway will
# be installed. This doesn't affect compilation either.
#
GWDIR=/usr/sunlink/dni
#
# List of sources, for bundling together in a package
#
SRCS=lpr.c config.h common.h patchlevel.h \
unix-tcp.c Makefile \
vms-ucx-tcp.c vms-decnet.c vms-win-tcp.c descrip.mms \
dnet-lpd-gw.c \
lpr.man lpr.cat
#
# other stuff that goes with the package
#
PKG=BLURB README MANIFEST LICENSE ChangeLog $(SRCS)
#
# The -lsocket stuff is an attempt to get this to work on machines
# that have a BSD socket library built on top of STREAMS-based tcp
# without having to have a hairy configuration program just to compile
# this.
#
lpr: lpr.c config.h $(DRIVER)
-if [ -f /usr/lib/libsocket.a ] ; then \
$(CC) $(CFLAGS) -o lpr lpr.c $(DRIVER) -lsocket ; \
else \
$(CC) $(CFLAGS) -o lpr lpr.c $(DRIVER) ; \
fi
dnet-lpd-gw: dnet-lpd-gw.c unix-tcp.o
$(CC) $(CFLAGS) -o dnet-lpd-gw dnet-lpd-gw.c unix-tcp.o
#
# preformatted man page, in case someone doesn't have nroff
#
lpr.cat: lpr.man
$(NROFF) -man lpr.man > lpr.cat
#
# The wierd "rm || mv" stuff is an attempt to work around SysV brain
# damage that won't let you rm a program that is running.
#
install: lpr
cp lpr $(BINDIR)/lpr.new
chown root $(BINDIR)/lpr.new
chmod 4711 $(BINDIR)/lpr.new
-rm $(BINDIR)/lpr || mv $(BINDIR)/lpr $(BINDIR)/lpr.old
mv $(BINDIR)/lpr.new $(BINDIR)/lpr
-rm $(BINDIR)/lprm || mv $(BINDIR)/lprm $(BINDIR)/lprm.old
ln $(BINDIR)/lpr $(BINDIR)/lprm
-rm $(BINDIR)/lpq || mv $(BINDIR)/lpq $(BINDIR)/lpq.old
ln $(BINDIR)/lpr $(BINDIR)/lpq
install-gw: dnet-lpd-gw
rm -f $(GWDIR)/dnet-lpd-gw
cp dnet-lpd-gw $(GWDIR)
chown root $(GWDIR)/dnet-lpd-gw
chmod 4711 $(GWDIR)/dnet-lpd-gw
clean:
rm -f lpr dnet-lpd-gw *.o
#
# various packaging routines.
#
port-lpr.vms: $(PKG)
/bin/true > port-lpr.vms
for i in $(PKG) ; do \
echo '$$ write sys$$output "creating' $$i'"' ; \
echo '$$ CREATE' $$i ; \
cat $$i ; \
done >> port-lpr.vms
echo '$$ exit' >> port-lpr.vms
port-lpr.tar: $(PKG)
tar cf port-lpr.tar $(PKG)
port-lpr.tar.Z.uu: $(PKG)
tar cf - $(PKG) | compress | uuencode port-lpr.tar.Z > port-lpr.tar.Z.uu
port-lpr.uushar: $(PKG)
for i in $(PKG) ; do uuencode $$i < $$i ; done > port-lpr.uushar
port-lpr.shar: $(PKG)
shar $(PKG) > port-lpr.shar
print:
enscript -2r `ls $(SRCS) | grep '.*\.[ch]'`