# # Makefile for mp, the PostScript pretty printer. # # @(#)Makefile.dist 1.4 93/08/01 # # Copyright (c) Steve Holden and Rich Burridge. # All rights reserved. # # Permission is given to distribute these sources, as long as the # copyright messages are not removed, and no monies are exchanged. # # No responsibility is taken for any errors inherent either # to the comments or the code of this program, but if reported # to me then an attempt will be made to fix them. # #===================================================================== # # It is possible to change the location of the mp prologue file # with the -p command line option. It can also be defined at compile # time, by uncommenting the macro definition below and setting # appropriately. If it's not present, then a sensible default value # is used. # PROLOGUE = -DPROLOGUE=\"$(MPLIBDIR)\" #--------------------------------------------------------------------- # Mp will extract the user's gecos field, and try to make sense of what # it finds. It applies various rules to do this. If this field is too long, # then it needs to truncate sensibly. If it's extracted N "words" or has # found a comma, then it stops extracting. If an ampersand is found, this # is expanded to the users name in capitals. # This option allows you to change the number of "words" that mp extracts # from the gecos field. By default this is 3. If needed, then it should # be uncommented, and set accordingly. # #GECOSFIELDS = -DGECOSFIELDS=3 #--------------------------------------------------------------------- # Mp will extract upto a certain number of characters from the user's # passwd gecos field. By default, this is 40. This option allows you to # set this to something different. If needed, then it should be uncommented, # and set accordingly. # #GECOSLENGTH = -DGECOSLENGTH=40 #===================================================================== # # Default locations where mp files will be installed. # You might wish to alter these values. # #MPPATH = /usr/local MPPATH = $(PREFIX) MPBINDIR = $(MPPATH)/bin #MPLIBDIR = $(MPPATH)/lib MPLIBDIR = $(MPPATH)/share/mp MPMANDIR = $(MPPATH)/man/man$(MPMANSECT) #MPMANSECT = l MPMANSECT = 1 #--------------------------------------------------------------------- # Alternate names for the mailp frontend # MAILPNAMES = mailp newsp digestp filep filofaxp franklinp timemanp timesysp #--------------------------------------------------------------------- # Compilation flags and standard macro definitions. # CDEFS = $(GECOSFIELDS) $(GECOSLENGTH) $(PROLOGUE) CXXFLAGS ?= $(CFLAGS) CCOMP := $(CXXFLAGS) CCFLAGS = $(CCOMP) $(CDEFS) LDFLAGS = CXXFLAGS = $(CCFLAGS) # needed for gmake's implicit rule CCC = $(CXX) #================================================================= .KEEPSTATE: BINARIES = mp SRCS = header.cc input.cc main.cc print.cc OBJS = header.o input.o main.o print.o HDRS = header.hh input.hh patchlevel.hh print.hh MPAGES = mp.man mp.man.text PROLOGS = mp.common.ps mp.pro.ps mp.pro.l.ps mp.pro.alt.ps mp.pro.altl.ps \ mp.pro.ff.ps mp.pro.fp.ps mp.pro.tm.ps mp.pro.ts.ps OTHERS = README Makefile.dist MANIFEST FILES CHANGES TODO \ mp.el mp.pro.old mp.pro.l.old Data SFILES1 = README Makefile.dist MANIFEST FILES Data SFILES2 = $(SRCS) $(HDRS) SFILES3 = $(PROLOGS) SFILES4 = TODO mp.el mp.pro.old mp.pro.l.old $(MPAGES) SFILES5 = CHANGES all: $(BINARIES) mp: $(OBJS) mp.man $(CCC) $(LDFLAGS) -o mp $(OBJS) -sed -e s,LIBDIR,$(MPLIBDIR),g \ -e s,BINDIR,$(MPBINDIR),g mp.man > mp.1 SHELL = /bin/sh install-a4: common-install @echo " Adjusting for A4 paper" -@cd $(MPLIBDIR); \ cp mp.common.ps /tmp/tmp-pro; \ sed < /tmp/tmp-pro > mp.common.ps \ -e 's|^/fullwidth 8.5 inch def|/fullwidth 595 def|' \ -e 's|^/fullheight 11 inch def|/fullheight 842 def|'; \ rm /tmp/tmp-pro install: common-install @echo @echo "**IMPORTANT NOTE**" @echo @echo "Mp is setup by default to work with US Letter sized paper." @echo "If you are using A4 sized paper, you should reinstall, by" @echo "doing a:" @echo @echo "make PAPERSIZE=a4 reinstall" @echo common-install: $(BINARIES) # mp -cp mp $(MPBINDIR) -chmod 751 $(MPBINDIR)/mp -strip $(MPBINDIR)/mp # mp.1 -cp mp.1 $(MPMANDIR)/mp.$(MPMANSECT) -chmod 644 $(MPMANDIR)/mp.$(MPMANSECT) # mp.common.ps -mkdir $(MPLIBDIR) # -cp mp.common.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.common.ps # mp.pro.ps -cp mp.pro.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.ps # mp.pro.l.ps -cp mp.pro.l.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.l.ps # mp.pro.alt.ps -cp mp.pro.alt.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.alt.ps # mp.pro.altl.ps -cp mp.pro.altl.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.altl.ps # mp.pro.ff.ps -cp mp.pro.ff.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.ff.ps # mp.pro.fp.ps -cp mp.pro.fp.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.fp.ps # mp.pro.tm.ps -cp mp.pro.tm.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.tm.ps # mp.pro.ts.ps -cp mp.pro.ts.ps $(MPLIBDIR) -chmod 644 $(MPLIBDIR)/mp.pro.ts.ps # # NOTE: If you don't want the mailp, newsp, filep ... symbolic links # installed, then you should comment out the following seven lines. # @echo Making mp links -@for name in $(MAILPNAMES); do \ echo -n $$name " "; \ rm -f $(MPBINDIR)/$$name; \ ln -s $(MPBINDIR)/mp $(MPBINDIR)/$$name; \ done @echo clean: rm -rf mp.part? Part? *.Z *.uu mp.1 mp *.o core create: SCCS -sccs create $(SRCS) $(OTHERS) lint: lint $(CDEFS) $(SRCS) saber: #load $(CDEFS) $(SRCS) shar: shar.script $(SFILES1) > Part1 shar.script $(SFILES2) > Part2 shar.script $(SFILES3) > Part3 shar.script $(SFILES4) > Part4 shar.script $(SFILES5) > Part5 SCCS: mkdir SCCS chmod 755 SCCS header.o: header.hh input.hh print.hh input.o: header.hh input.hh patchlevel.hh print.hh main.o: header.hh input.hh print.hh print.o: header.hh input.hh print.hh