#
# Warning: the cpp used on this machine replaces
# all newlines and multiple tabs/spaces in a macro
# expansion with a single space.  Imake tries to
# compensate for this, but is not always
# successful.
#

#
# This makefile is automatically generated by imake... do not modify
# or you may lose your changes when imake generates makefiles again.
# Ignore this message if you are not using imake.
#

            TOP = ./../../../../..
             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
             AR = ar clq
             LS = ls
       LINTOPTS = -axz
    LINTLIBFLAG = -C
           MAKE = make
    STD_DEFINES =
    CDEBUGFLAGS = -O
        DESTDIR =

        PATHSEP = /
         DEPEND = $(DEPENDSRC)/makedepend
          IMAKE = $(IMAKESRC)/imake
            RGB = $(RGBSRC)/rgb
         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
   INSTUIDFLAGS = -m 4755
   INSTLIBFLAGS = -m 0664
   INSTINCFLAGS = -m 0444
   INSTMANFLAGS = -m 0444
   INSTAPPFLAGS = -m 0444

      USRLIBDIR = $(DESTDIR)/usr/lib
         BINDIR = $(DESTDIR)/usr/bin/X11
         LIBDIR = $(USRLIBDIR)/X11
     LINTLIBDIR = $(USRLIBDIR)/lint
         INCDIR = $(DESTDIR)/usr/include/X11
        FONTDIR = $(LIBDIR)/fonts
         UWMDIR = $(LIBDIR)/uwm
         MANDIR = $(DESTDIR)/usr/man/mann
    XAPPLOADDIR = $(LIBDIR)/app-defaults
         ADMDIR = $(DESTDIR)/usr/adm

      CLIENTSRC = $(TOP)/clients
        DEMOSRC = $(TOP)/demos
         LIBSRC = $(TOP)/lib
        FONTSRC = $(TOP)/fonts
     INCLUDESRC = $(TOP)/X11
      SERVERSRC = $(TOP)/server
        UTILSRC = $(TOP)/util
     EXAMPLESRC = $(TOP)/examples
     CONTRIBSRC = $(TOP)/contrib
         DOCSRC = $(TOP)/doc
      DEPENDSRC = $(UTILSRC)/makedepend
       IMAKESRC = $(UTILSRC)/imake
       IRULESRC = $(UTILSRC)/imake.includes
         RGBSRC = $(UTILSRC)/rgb
        XLIBSRC = $(LIBSRC)/X
     TOOLKITSRC = $(LIBSRC)/Xt
     AWIDGETSRC = $(LIBSRC)/Xaw
     OLDXLIBSRC = $(LIBSRC)/oldX
   EXTENSIONSRC = $(TOP)/extensions
        XMANSRC = $(DOCSRC)/Xlib/Xman
   EXTENSIONLIB = $(EXTENSIONSRC)/lib/libXext.a
           XLIB = $(XLIBSRC)/libX11.a
        OLDXLIB = $(OLDXLIBSRC)/liboldX.a
       XTOOLLIB = $(TOOLKITSRC)/libXt.a
         XAWLIB = $(AWIDGETSRC)/libXaw.a
       LINTXLIB = $(XLIBSRC)/llib-lX11.ln
      LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
        LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
       INCLUDES = -I$(TOP)
      MACROFILE = Sun.macros
      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl \
			-I$(NEWTOP)$(IRULESRC) \
			-s Makefile
         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
			tags TAGS make.log

DEFINES = -DDRAGONPIX=16 -DNPLANES=`cat ../NPLANESFILE`
DRIVERINCLUDES = -I/sys/vaxuba

TASM = tasm
TFILES = tltemplate.ta

SRCS = tlloadtemp.c \
	tlptobmask.c tlptob2color.c \
	tlpolytext.c tlimagetext.c \
	tlplanestip.c tlplanecopy.c \
	tloffscreen.c tlinit.c \
	tlbitblt.c tlspa.c tltranslate.c tlline.c tlqd.c \
	tlsetspan.c tlglobals.c tlconpolys.c \
	tlrotile.c tldrawshapes.c tloddsize.c tldma.c \
	tldstate.c tldchange.c tlgetimage.c
OBJS = tlloadtemp.o \
	tlptobmask.o tlptob2color.o \
	tlpolytext.o tlimagetext.o \
	tlplanestip.o tlplanecopy.o \
	tloffscreen.o tlinit.o \
	tlbitblt.o tlspa.o tltranslate.o tlline.o tlqd.o \
	tlsetspan.o tlglobals.o tlconpolys.o \
	tlrotile.o tldrawshapes.o tloddsize.o tldma.o \
	tldstate.o tldchange.o tlgetimage.o

CDEBUGFLAGS = -O
INCLUDES = -I. -I.. -I../../../../include -I$(INCLUDESRC) $(DRIVERINCLUDES)

.c.o:
	$(RM) $@
	$(CC) -c $(CFLAGS) $*.c

all:: libtl.a

libtl.a: $(OBJS)
	$(RM) $@
	$(AR) $@ $(OBJS)
	$(RANLIB) $@

#
# These next three each use a symbolic link to create two slightly
# different .o files
tlplanecopy.c: tlplanestip.c
	$(RM) tlplanecopy.c
	$(LN) tlplanestip.c tlplanecopy.c

tlplanecopy.o: tlplanecopy.c
	${CC} ${CFLAGS} -DTWOCOLOR -c $*.c

tlptob2color.c: tlptobmask.c
	$(RM) tlptob2color.c
	$(LN) tlptobmask.c tlptob2color.c

tlptob2color.o: tlptob2color.c
	${CC} ${CFLAGS} -DBICHROME -c $*.c

tlimagetext.c: tlpolytext.c
	$(RM) tlimagetext.c
	$(LN) tlpolytext.c tlimagetext.c

tlimagetext.o: tlimagetext.c
	${CC} ${CFLAGS} -DIMAGE -c $*.c

# tasm (template code assemsbler) not provided
#tlloadtemp.c: $(TFILES)
#	$(TASM) -i ${TFILES} -o tlloadtemp.c

#tltemplabels.h: $(TFILES)
#	$(TASM) -i ${TFILES} -x -l tltemplabels.h

depend:: $(DEPEND)

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

$(DEPEND):
	@echo "making $(DEPENDSRC)"; \
	cd $(DEPENDSRC); $(MAKE)

lint:
	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
lint1:
	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)

clean::
	$(RM) tlplanecopy.c
	$(RM) tlptob2color.c
	$(RM) tlimagetext.c

clean::
	$(RM_CMD) \#*

Makefile:: $(IMAKE)

Makefile:: Imakefile \
	$(IRULESRC)/Imake.tmpl \
	$(IRULESRC)/Imake.rules \
	$(IRULESRC)/$(MACROFILE)
	-$(RM) Makefile.bak; $(MV) Makefile Makefile.bak
	$(IMAKE_CMD) -DTOPDIR=$(TOP)

$(IMAKE):
	@echo "making $(IMAKESRC)"; \
	cd $(IMAKESRC); $(MAKE)

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

install::
	@echo "install done"

Makefiles::

