/* $Header: /src/X11/uw/xproof/RCS/Imakefile,v 3.15 90/07/17 16:17:14 tim Exp $ */

/* SITE-DEPENDENT PARAMETERS */

/* If some of your servers do not adequately support Pixmaps include some
 * version of the following lines (see README for explanation).
 * I you don't have this problem with any of your servers, you can use
#define UsePixmap -DUSEPIXMAP=\"true\"
 * If you have this problem with some of your servers, you should use:
#define UsePixmap -DUSEPIXMAP=\"false\"
 */
#if defined(VaxArchitecture) || defined(BobcatArchitecture)
#define UsePixmap -DUSEPIXMAP=\"false\"
#else
#define UsePixmap -DUSEPIXMAP=\"true\"
#endif

/* The location of the ditroff font-description files */
#define DescDir -DDESCDIR=\"/usr/lib/font\"

/* Name of the target device */
#define Device -DDEVICE=\"psc\"

/* Place to install new fonts */
#define FontInstDir $(FONTDIR)

/* The following command should run ditroff on standard input and produce
 * its results on standard output.
 */
DITROFF = ditroff -t

/* END OF SITE-DEPENDENT PARAMETERS */

# Things needed to build xproof
           SRCS = getdevinfo.c showpage.c draw.c Proof.c xfontinfo.c \
                  index.c main.c version.c
           OBJS = getdevinfo.o showpage.o draw.o Proof.o xfontinfo.o \
                  index.o main.o version.o
         HFILES = Proof.h ProofP.h adobe.h bdfheader.h dev.h xproof.h \
                  patchlevel.h
       BDFFONTS = $(FONTSRC)/bdf
#    FONTINSTDIR = FontInstDir
    FONTINSTDIR = ./fonts
        DEFINES = DescDir Device UsePixmap

LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
  SYS_LIBRARIES = -lm
       INCLUDES = -I$(TOP)


# Faces that need fixing.  The Symbol font is already ok.  Other fonts are
# not (currently) used by xproof.  See fixfont.c for more comments.
#
FACES = courB courBO courO courR helvB helvBO helvO helvR \
	ncenB ncenBI ncenI ncenR timB timBI timI timR
 
# Assume each of these faces comes in all of the following point sizes
#
SIZES = 08 10 12 14 18 24

RESOLUTIONS = 75 100

#ifndef UsePixmap
#define UsePixmap
#endif

ComplexProgramTarget(xproof)
NormalLintTarget($(SRCS))
SingleProgramTarget(fixfont,fixfont.o,,)
SingleProgramTarget(drawhacks,drawhacks.o,,)

test: $(PROGRAM).prf $(PROGRAM)
	$(PROGRAM) $(PROGRAM).prf

$(PROGRAM).prf: $(PROGRAM).man
	$(DITROFF) -man $(PROGRAM).man >$(PROGRAM).prf

install-fonts: fixfont drawhacks
	for resolution in $(RESOLUTIONS) ; do \
	    for face in $(FACES) ; do \
		for size in $(SIZES) ; do \
		    echo $${resolution}dpi/$$face$${size}prf.snf ; \
		    ./fixfont <$(BDFFONTS)/$${resolution}dpi/$$face$$size.bdf |\
		    $(FONTC) > $(FONTINSTDIR)/$${resolution}dpi/$$face$${size}prf.snf; \
		done; \
	    done; \
	    for size in $(SIZES) ; do \
		echo $${resolution}dpi/dithack$$size.snf ; \
		./drawhacks $$size $$resolution | \
		$(FONTC) >$(FONTINSTDIR)/$${resolution}dpi/dithack$$size.snf ; \
	    done; \
	    $(MKFONTDIR) $(FONTINSTDIR)/$${resolution}dpi; \
	done
