Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/aux/mpage/Makefile

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#
# mpage:	A program to reduce pages of print so that several pages
# 	  	of output appear on one sheet of paper.
#
# Copyright (c) 1994-2004 Marcel J.E. Mol, The Netherlands
# Copyright (c) 1988 Mark P. Hahn, Herndon, Virginia
#     
#     Permission is granted to anyone to make or distribute verbatim
#     copies of this document as received, in any medium, provided
#     that this copyright notice is preserved, and that the
#     distributor grants the recipient permission for further
#     redistribution as permitted by this notice.
#
#     Marcel Mol                     MESA Consulting
#                                    P.o. box 112
#                                    2630 AC Nootdorp
#                                    The Netherlands
#                                    phone: +31-6-54724868
#     marcel@mesa.nl                 info@mesa.nl
#                                    http://www.mesa.nl/pub/mpage
#                                    ftp://ftp.mesa.nl/pub/mpage
#  

# Set this to an ANSI compatible C compiler (preferably gcc)
# See also system specific settings below
#CC=cc

############################################################################
#
#  MPAGE Configuration
#
############################################################################

#
# Define your favorite page size:
#          Letter for US letter
#          Legal for legal
#          A4 for European A4
#  See glob.c for all possibilities
#
# 
# PAGESIZE=A4
PAGESIZE=Letter

#
# Define your spooler type
#          ATT_SPOOLER for 'lp ...' type printing
#          BSD_SPOOLER for 'lpr ..' tpye printing
#
SPOOL_TYPE=ATT_SPOOLER

# PREFIX=e:/usr		# OS/2 type
PREFIX=/sys/lib
BINDIR=/tmp/bin/aux
LIBDIR=/sys/lib
MANDIR=/tmp/man

#
# A default encoding is given in encoding.h. Setting ENCODING=1 will
# activate this encoding by default. 0 switches default off.
# The -C option (without subargument) can be used to switch.
#
ENCODING=1

#
# Set the default sheet margin in 1/72 inches. 
#
SHEETMARGIN=18 

#
# Set intial duplex mode
#
DEFAULT_DUPLEX=0

DEFS = -DPAGE_DEF=\"${PAGESIZE}\" -DLIBDIR=\"${LIBDIR}/mpage\" -DDEFAULT_ENCODING=${ENCODING} -DDEFAULT_DUPLEX=${DEFAULT_DUPLEX} -DDEFAULTSMARGIN=${SHEETMARGIN} -DSPOOLER=${SPOOL_TYPE} # -DKANJI


############################################################################
#
#  OPERATING SYSTEM SETUP
#
############################################################################

# Unix extensions
E = 
O = .o


############################################################################
#
#  UNIXEN SPECIFICS
#
############################################################################

CFLAGS = -s $(DEFS) -D_BSD_EXTENSION -DPLAN9


############################################################################
#
# END OF CONFIGURATION OPTIONS
#

# pattern rules. Should we define these?
%$(O): %.c
	$(CC) $(CFLAGS) -c -o $@ $<


HEAD =  mpage.h
DENC =  encoding.h
SRCS =  mpage.c glob.c text.c post.c file.c page.c args.c util.c
MOBJ =  mpage$(O) glob$(O) text$(O) post$(O) file$(O) page$(O) args$(O) util$(O)
SMPL =  sample.c page.c glob.c args.c
SOBJ =  sample$(O) page$(O) glob$(O) args$(O)

default:	mpage$(E) msample$(E) mpage.1
	@echo Done!

mpage$(E):	$(MOBJ)
	$(CC) $(CFLAGS) -o mpage$(E) $(MOBJ) $(LIBS)

msample$(E):	$(SOBJ)
	$(CC) $(CFLAGS) -o msample$(E) $(SOBJ) $(LIBS)

mpage.1: mpage.1.in
	sed 's:PREFIX:${PREFIX}:' < mpage.1.in > mpage.1
clean:
	rm -rf $(MOBJ) mpage$(E) mpage.ps $(SOBJ) msample$(E) mpage.1 make.log core

mpage$(O):	$(HEAD) $(DENC) mpage.c
glob$(O):	$(HEAD) glob.c
text$(O):	$(HEAD) text.c
post$(O):	$(HEAD) post.c
file$(O):	$(HEAD) file.c
page$(O):	$(HEAD) page.c
args$(O):	$(HEAD) args.c
util$(O):	$(HEAD) util.c
sample$(O):	$(HEAD) sample.c

mpage.ps:	mpage.1
	psroff -t -man mpage.1 > mpage.ps


#
# add your proper install stuff
#
install:
	if [ ! -d $(LIBDIR)/mpage ] ; then mkdir -p $(LIBDIR)/mpage ; fi
	if [ ! -d $(BINDIR) ] ; then mkdir -p $(BINDIR) ; fi
	if [ ! -d $(MANDIR) ] ; then mkdir -p $(MANDIR) ; fi
	cp mpage$(E) $(BINDIR)
	cp mpage.1 $(MANDIR)
	-cp Encodings/* $(LIBDIR)/mpage
	-chmod 664 $(LIBDIR)/mpage/*

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.