# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $
#
# The cpp used on this machine replaces all newlines and multiple tabs and
# spaces in a macro expansion with a single space.  Imake tries to compensate
# for this, but is not always successful.
#

###########################################################################
# X Window System Makefile generated from template file Imake.tmpl
# $XConsortium: Imake.tmpl,v 1.91 88/10/23 22:37:10 jim Exp $
#
# Do not change the body of the imake template file.  Server-specific
# parameters may be set in the appropriate .macros file; site-specific
# parameters (but shared by all servers) may be set in site.def.  If you
# make any changes, you'll need to rebuild the makefiles using
# "make World" (at best) or "make Makefile; make Makefiles" (at least) in
# the top level directory.
#
# If your C preprocessor doesn't define any unique symbols, you'll need
# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
# "make Makefile", "make Makefiles", or "make World").
#
# If you absolutely can't get imake to work, you'll need to set the
# variables at the top of each Makefile as well as the dependencies at the
# bottom (makedepend will do this automatically).
#

###########################################################################
# platform-specific configuration parameters - edit Sun.macros to change

# platform:  $XConsortium: Sun.macros,v 1.52 88/10/23 11:00:55 jim Exp $
# operating system:  SunOS 4.0

BOOTSTRAPCFLAGS =
             AS = as
             CC = cc
            CPP = /lib/cpp
             LD = ld
           LINT = lint
        INSTALL = install
           TAGS = ctags
             RM = rm -f
             MV = mv
             LN = ln -s
         RANLIB = ranlib
RANLIBINSTFLAGS = -t
             AR = ar clq
             LS = ls
       LINTOPTS = -axz
    LINTLIBFLAG = -C
           MAKE = make
STD_CPP_DEFINES =
    STD_DEFINES =

###########################################################################
# site-specific configuration parameters - edit site.def to change

# site:  $XConsortium: site.def,v 1.16 88/10/12 10:30:24 jim Exp $

 XWSRC = $(CONTRIBSRC)/widgets/Xhp/Xw

 XWLIB = $(USRLIBDIR)/libXw.a

###########################################################################
# definitions common to all Makefiles - do not edit

          SHELL = /bin/sh

        DESTDIR =
      USRLIBDIR = /local/lib/X11
         BINDIR = /local/bin/X11
         INCDIR = $(LIBDIR)/include
        INCROOT = $(DESTDIR)/usr/include
         ADMDIR = /var/scr/Xerrors
         LIBDIR = /local/share/X11
     LINTLIBDIR = $(LIBDIR)/lint
        FONTDIR = $(LIBDIR)/fonts
       XINITDIR = $(LIBDIR)/xinit
         XDMDIR = $(LIBDIR)/xdm
         UWMDIR = $(LIBDIR)/uwm
         AWMDIR = $(LIBDIR)/awm
         TWMDIR = $(LIBDIR)/twm
        MANPATH = /local/man
  MANSOURCEPATH = $(MANPATH)/man
         MANDIR = $(MANSOURCEPATH)x
      LIBMANDIR = $(MANSOURCEPATH)3
    XAPPLOADDIR = $(LIBDIR)/app-defaults

   INSTBINFLAGS = -m 0755
   INSTUIDFLAGS = -m 4755
   INSTLIBFLAGS = -m 0664
   INSTINCFLAGS = -m 0444
   INSTMANFLAGS = -m 0444
   INSTAPPFLAGS = -m 0444
  INSTKMEMFLAGS = -g kmem -m 2755
        FCFLAGS = -t
    CDEBUGFLAGS = -O

        PATHSEP = /
         DEPEND = $(DEPENDSRC)/makedepend
          IMAKE = $(BINDIR)/imake
            RGB = $(RGBSRC)/rgb
             FC = $(BDFTOSNFSRC)/bdftosnf
      MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
      MKDIRHIER = $(SCRIPTSSRC)/mkdirhier.sh

         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
            TOP = ../../../../../src/X.V11R3
      CLIENTSRC = $(TOP)/clients
        DEMOSRC = $(TOP)/demos
         LIBSRC = $(TOP)/lib
        FONTSRC = $(TOP)/fonts
     INCLUDESRC = $(TOP)/X11
      SERVERSRC = $(TOP)/server
        UTILSRC = $(TOP)/util
     SCRIPTSSRC = $(UTILSRC)/scripts
     EXAMPLESRC = $(TOP)/examples
     CONTRIBSRC = $(TOP)/contrib
         DOCSRC = $(TOP)/doc
         RGBSRC = $(TOP)/rgb
      DEPENDSRC = $(UTILSRC)/makedepend
       IMAKESRC = $(UTILSRC)/imake
       IRULESRC = $(UTILSRC)/imake.includes
        XLIBSRC = $(LIBSRC)/X
         XMUSRC = $(LIBSRC)/Xmu
     TOOLKITSRC = $(LIBSRC)/Xt
     AWIDGETSRC = $(LIBSRC)/Xaw
     OLDXLIBSRC = $(LIBSRC)/oldX
    BDFTOSNFSRC = $(FONTSRC)/bdftosnf
   MKFONTDIRSRC = $(FONTSRC)/mkfontdir
   EXTENSIONSRC = $(TOP)/extensions

   EXTENSIONLIB = $(USRLIBDIR)/lib/libXext.a

           XLIB = -L$(USRLIBDIR) -lX11

         XMULIB = $(USRLIBDIR)/libXmu.a
        OLDXLIB = $(USRLIBDIR)/liboldX.a
       XTOOLLIB = $(USRLIBDIR)/libXt.a
         XAWLIB = $(USRLIBDIR)/libXaw.a
       INCLUDES = -I$(INCDIR) -I$(INCROOT)

       LINTXLIB = $(XLIBSRC)/llib-lX11.ln
        LINTXMU = $(XMUSRC)/llib-lXmu.ln
      LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
        LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
      MACROFILE = Sun.macros
   ICONFIGFILES = $(IRULESRC)/Imake.tmpl \
			$(IRULESRC)/$(MACROFILE) $(IRULESRC)/site.def
  IMAKE_DEFINES =
      IMAKE_CMD = $(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
			-s Makefile $(IMAKE_DEFINES)
         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
			.emacs_* tags TAGS make.log MakeOut

###########################################################################
# rules:  $XConsortium: Imake.rules,v 1.71 88/10/23 22:46:34 jim Exp $

###########################################################################
# start of Imakefile

#
#	Xtroff ImakeFile
#
#	make [all]	compiles the programs in this directory, and the
#			relevant subdirectories - fontstuff are font
#			manipulation programs, xfonts has the stuff for
#			by piping the 75dpi bdf through awk scripts
#			to remap it to PostScript collation sequences,
#			and generating compressed snf.
#	make install	makes and installs the programs
#	make vfonts	makes and installs scaled and converted vfonts
#			for the devsun device. Not strictly necessary, but
#			useful for large fonts. xpic can use them too.
#	make imfonts	Scales and converts Imagen RST fonts if you have them
#			for the Imagen device. Good if you have them.
#	make devsun	Installs the devsun width info and runs makedev
#			Do this if you install the vfonts
#	make devpsc	Installs the devpsc width info and runs makedev
#			If you already have a devpsc device, from
#			Transcript(tm), or some other ditroff to
#			PostScript(tm) translation package,
#			then you probably don't need this.
#	make devX11	Installs the devX11 width info and runs makedev
#
#	If you want to generate a Makefile for Suntools suntroff instead
#	of xtroff, uncomment the following definition.
#

#
#	For lots of debugging info, especially FONTDEBUG.
#          DEBUG = -DFONTDEBUG -DWINDOWDEBUG -DTYPEDEBUG -DDEBUG
          DEBUG =
#    CDEBUGFLAGS = -g

# 	defining -DNOADJUST excludes some experimental code which tries to
#	adjust character positions to make the X font match the troff
#	font more closely. It may look better if you don't define it -
#	ligatures, especially 'fi' come out wrong at present if it is
#	undefined.
# 	-DFASTARCS does not use an ellipse drawing algorithm that approximates
# 	ellipses as polygons. Define it if your server draws arcs fast.
#	(Leave it undefined on Suns, uVaxen, anything using the R3 sample
#	server miarc.c code)
#	-DBEZERKELYISM allows the parser to understand the ditroff
#	sequences emitted by Berkeley ditroff. (May work, I don't have
#	Berkeley ditroff to test it)
# 	We have Menu/Menu.o, checkitem/CheckItem.o and menuitem/MenuItem.o
# 	installed as XtStuff - In fact, we keep all three (Menu. checkitem,
#	menuitem) in one directory to make matters simpler.
#	Window is adapted from the R2 version Chris Peterson's xman program.
        DEFINES = -DFONTDIR=\"${WIDTHDIR}\" -DBITDIR=\"${SUNTROFF_FONTS}\" \
		  $(DEBUG) -DNOADJUST $(SUNTOOLS)

       INCLUDES = -I./bitmaps $(DEV_INCLUDES) -I$(INCDIR) -I$(INCROOT)
        MATHLIB = -lm

       PROGRAMS = xtroff
      PREVIEWER = xtroff
             FC = bdftosnf
        WINDOWS = xwindows
        XTSTUFF = XtStuff/libXtStuff.a
LOCAL_LIBRARIES = $(XTSTUFF) $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
 SUNTROFF_FONTS = $(FONTDIR)/xtroff
   DEV_INCLUDES = -I./XtStuff
    DEV_SUBDIRS = XtStuff # devX11

  SYS_LIBRARIES = $(DEV_LIBS) $(MATHLIB)
           OBJS = $(WINDOWS).o suntroff.o parse.o font.o draw.o \
		  fixpoint.o curves.o arc.o xfont.o
           SRCS = $(WINDOWS).c suntroff.c parse.c font.c draw.c \
		  fixpoint.c curves.c arc.c xfont.c

.SUFFIXES: .manX .man

.manX.man:
	rm -f $*.man
	sed -e 's?WIDTHDIR?$(WIDTHDIR)?g' -e 's?XAPPLOADDIR?$(XAPPLOADDIR)?g' \
	    -e 's?FONTDIR?$(SUNTROFF_FONTS)?g' $*.manX > $*.man

SUBDIRS = $(DEV_SUBDIRS)

all::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "making all in $$i"; \
	$(MAKE) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' $(MFLAGS)); \
	done

depend::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "depending in $$i"; \
	$(MAKE) $(MFLAGS) depend ); \
	done

 PROGRAM = $(PREVIEWER)

all:: $(PREVIEWER)

$(PREVIEWER): $(OBJS) $(LOCAL_LIBRARIES)
	$(RM) $@
	$(CC) -o $@ $(OBJS) $(LOCAL_LIBRARIES) $(LDFLAGS) $(SYSLAST_LIBRARIES)

relink::
	$(RM) $(PROGRAM)
	$(MAKE) $(MFLAGS) $(PROGRAM)

install:: $(PREVIEWER)
	$(INSTALL) -c $(INSTALLFLAGS) $(PREVIEWER) $(BINDIR)

install.man:: $(PREVIEWER).man
	$(INSTALL) -c $(INSTMANFLAGS) $(PREVIEWER).man $(MANDIR)/$(PREVIEWER).x

depend:: $(DEPEND)

depend::
	$(DEPEND) -s "# DO NOT DELETE" -- $(CFLAGS) -- $(SRCS)

$(DEPEND)::
clean::
	$(RM) $(PROGRAM)

XtStuff/libXtStuff.a::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in XtStuff ;\
	do \
	(cd $$i ; echo "making XtStuff/libXtStuff.a in $$i"; \
	$(MAKE) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' $(MFLAGS)); \
	done

install:: XTroff.ad
	$(INSTALL) -c $(INSTAPPFLAGS) XTroff.ad $(XAPPLOADDIR)/XTroff

#	Xtroff doesn't need (more important, doesn't use properly) the
#	devsun fonts, which are still here for the Suntools version.
#	You may want to do a 'make vfonts devsun' if you use xpic, which
#	can use those fonts too. (They are nice and large, for making slides)

#	The following defines might need to be changed for suntroff
#	or if you're making the devsun fonts anyway.  The VFONTS
#	definition points towards the directory containing the Sun
#	Berkeley versatec font catalog.  These bits of these fonts are used
#	as the default screen font.  See the file fontstuff/MakeSunFonts for
#	more details.
#
#	The RSTFONTS definition points to the RST (Imagen) font
#	files.  If you don't have an Imagen printer then you won't need to
#	worry about these bits.  If you do have an Imagen printer then you
#	may want to see the file fontstuff/MakeImagenFonts for a way of getting
#	more accurate bits on the screen.  If you don't want to worry about
#	the fonts (and I don't blame you) then xtroff will use the
#	X fonts described above for.
#
#	The SUNTROFF_FONTS points to the directory where the fonts
#	sit. It has subdirectories of the form 'dev'$DEVICE for each
#	typesetter's fonts - devsun is the default for the scaled
#	versatec fonts, devimp is for imagen, etc.

         VFONTS = /usr/lib/vfont
       RSTFONTS = /local/lib/imagen/fonts/rst
      RSTDEVICE = imp	#imagen
      SUNDEVICE = sun	#versatec - other printers like lw.

       WIDTHDIR = $(LIBDIR)/troff

        MAKEDEV = makedev

#	Percent MUST be two digits
#	For the imagen, percent is 120 / 300, i.e 40.
     RSTPERCENT = 40

#	For versatec fonts, which we use for laserwriters etc.,
#	percent should be 120/200. i.e. 66. We use 50 for a better
#	error margin.
     SUNPERCENT = 50

vfonts::
		-mkdir $(SUNTROFF_FONTS)
		cd fontstuff; make $(MFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" \
			VFONTS=$(VFONTS) \
			RSTFONTS=$(RSTFONTS) PREVIEWER=$(PREVIEWER) \
			FC=$(FC) SUNPERCENT=$(SUNPERCENT) \
			RSTPERCENT=$(RSTPERCENT) \
			SUNTROFF_FONTS=$(SUNTROFF_FONTS)/dev$(SUNDEVICE) \
			RSTDEVICE=dev$(RSTDEVICE) SUNDEVICE=dev$(SUNDEVICE) \
			sunfonts

imfonts::
		-mkdir $(SUNTROFF_FONTS)
		cd fontstuff; make $(MFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" \
			VFONTS=$(VFONTS) \
			RSTFONTS=$(RSTFONTS) PREVIEWER=$(PREVIEWER) \
			FC=$(FC) SUNPERCENT=$(SUNPERCENT) \
			RSTPERCENT=$(RSTPERCENT) \
			SUNTROFF_FONTS=$(SUNTROFF_FONTS)/dev$(RSTDEVICE) \
			RSTDEVICE=dev$(RSTDEVICE) SUNDEVICE=dev$(SUNDEVICE) \
			rstfonts

devsun::
		-mkdir ${WIDTHDIR}/dev$(SUNDEVICE) ;\
		cp devsun/DESC devsun/? devsun/?? ${WIDTHDIR}/dev$(SUNDEVICE); \
		cd ${WIDTHDIR}/dev$(SUNDEVICE);  \
		${MAKEDEV} DESC;	\
		rm -f [a-zA-Z] [a-zA-Z][a-zA-Z]

Makefiles::
	@echo 'Making Makefiles in devpsc...' ; \
	$(MAKE) subdirMakefiles NEWTOP=../ MAKEFILE_SUBDIR=devpsc

devpsc::
		cd devpsc; make $(MFLAGS) MAKEDEV=$(MAKEDEV) \
			WIDTHDIR=$(WIDTHDIR) install

clean::
		rm -f xtroff.man
		cd devpsc; make clean

tar:
		make clean
		-rm /tmp/xtroff.tar.Z
		cd ..; tar cvfX - xtroff/ExcludeFiles ./xtroff \
			| compress > /tmp/xtroff.tar.Z

#lint:
#	cd XtStuff; make llib-lXtStuff.ln
#	lint -abz $(SRCS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES) \
#		XtStuff/llib-lXtStuff.ln -lXaw -lXt -lX11 -lm $(LINTFLAGS)

###########################################################################
# Imake.tmpl common rules for all Makefiles - do not edit

emptyrule::

clean::
	$(RM_CMD) \#*

Makefile:: $(IMAKE)

Makefile:: Imakefile \
	$(IRULESRC)/Imake.tmpl \
	$(IRULESRC)/Imake.rules \
	$(IRULESRC)/site.def \
	$(IRULESRC)/$(MACROFILE)
	-@if [ -f Makefile ]; then \
	echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
	else exit 0; fi
	$(IMAKE_CMD) -DTOPDIR=$(TOP)

$(IMAKE):

tags::
	$(TAGS) -w *.[ch]
	$(TAGS) -xw *.[ch] > TAGS

$(XLIB)::;
-L$(USRLIBDIR)::;
-L$(LIBSRC)/Xpic::;

###########################################################################
# rules for building in SUBDIRS - do not edit

install::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "installing in $$i"; \
	$(MAKE) $(MFLAGS) \
	DESTDIR='$(DESTDIR)' install ); \
	done

install.man::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "installing man pages in $$i"; \
	$(MAKE) $(MFLAGS) \
	DESTDIR='$(DESTDIR)' install.man ); \
	done

clean::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "cleaning in $$i"; \
	$(MAKE) $(MFLAGS) RM_CMD='$(RM_CMD)' clean ); \
	done

tags::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	(cd $$i ; echo "tagging in $$i"; \
	$(MAKE) $(MFLAGS) TAGS='$(TAGS)' tags ); \
	done

Makefiles:: $(IMAKE)

Makefiles::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SUBDIRS) ;\
	do \
	echo "Making Makefiles in $$i..."; \
	case "$$i" in \
	./?*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
	./?*/?*/?*) newtop=../../../ sub=subsubsub;; \
	./?*/?*) newtop=../../ sub=subsub;; \
	./?*) newtop=../ sub=sub;; \
	*/?*/?*/?*) newtop=../../../../ sub=subsubsubsub;; \
	*/?*/?*) newtop=../../../ sub=subsubsub;; \
	*/?*) newtop=../../ sub=subsub;; \
	*) newtop=../ sub=sub;; \
	esac; \
	$(MAKE) $${sub}dirMakefiles NEWTOP=$$newtop \
	MAKEFILE_SUBDIR=$$i;\
	done

subdirMakefiles:
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
	else exit 0; fi
	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../$(TOP); \
	$(MAKE) $(MFLAGS) Makefiles

subsubdirMakefiles:
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
	else exit 0; fi
	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../$(TOP); \
	$(MAKE) $(MFLAGS) Makefiles

subsubsubdirMakefiles:
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
	else exit 0; fi
	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../../$(TOP); \
	$(MAKE) $(MFLAGS) Makefiles

subsubsubsubdirMakefiles:
	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak
	-@if [ -f $(MAKEFILE_SUBDIR)/Makefile ]; then \
	echo "$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak"; \
	$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak; \
	else exit 0; fi
	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../../../$(TOP); \
	$(MAKE) $(MFLAGS) Makefiles

###########################################################################
# dependencies generated by makedepend

