/**/###########################################################################
/**/#                                                                         #
/**/#                         Attention xterm porters                         #
/**/#                                                                         #
/**/#                                                                         #
/**/# Xterm assumes that bcopy can handle overlapping arguments.  If your     #
/**/# bcopy (or memcpy) can't, write a routine called bcopy and link it in    #
/**/# or add -Dbcopy=mybcopy to the DEFINES list below.                       #
/**/#                                                                         #
/**/###########################################################################

#ifdef BandAidCompiler
#include BandAidCompiler
#endif

/*
 * add -DWTMP and -DLASTLOG if you want them; make sure that bcopy can
 * handle overlapping copies before using it.
 */
#ifdef SetTtyGroup			/* turn on in config/machine.cf */
   TTYGROUPDEF = -DUSE_TTY_GROUP
#endif
/*
 *	[PUCC = Purdue University Computer Center]
 *	If you use PUCC's ptyd, add "-DPUCC_PTYD" to the DEFINES
 *	and dink the -DUTMP (also don't define WTMP or LASTLOG - since
 *	ptyd does all that logging for you)  You will need to add
 *	the right library load line (we use -lpucc) to the 
 *	ComplexProgramTarget (right next to -ltermcap)
 */
#ifdef UsePUCCPtyd			/* turn on in config/site.def */
    PUCCPTYDDEF = -DPUCC_PTYD		/* does not need to be setuid */
         PTYLIB = -lpucc
#endif

   MAIN_DEFINES = -DUTMP $(TTYGROUPDEF) $(PUCCPTYDDEF)
   MISC_DEFINES = /* -DALLOWLOGFILEEXEC */

          SRCS1 = button.c charproc.c cursor.c data.c input.c \
		  main.c menu.c misc.c screen.c scrollbar.c tabs.c \
		  TekPrsTbl.c Tekproc.c util.c VTPrsTbl.c
          OBJS1 = main.o input.o charproc.o cursor.o util.o tabs.o \
		  screen.o scrollbar.o button.o Tekproc.o misc.o \
		  VTPrsTbl.o TekPrsTbl.o data.o menu.o
          SRCS2 = resize.c
          OBJS2 = resize.o
           SRCS = $(SRCS1) $(SRCS2)
           OBJS = $(OBJS1) $(OBJS2)
       PROGRAMS = resize xterm
       DEPLIBS1 = XawClientDepLibs
       DEPLIBS2 = 
       PROGRAMS = xterm resize

#ifndef TermcapLibrary
#if SystemV && !defined(MacIIArchitecture)
#ifdef CrayArchitecture
#define TermcapLibrary -lcurses		/* special case of system v */
#else
#define TermcapLibrary -ltermlib	/* usually in here */
#endif
#else
#define TermcapLibrary -ltermcap	/* bsd puts it here */
#endif
#endif

     TERMCAPLIB = TermcapLibrary

AllTarget($(PROGRAMS))

SpecialObjectRule(main.o, ,$(MAIN_DEFINES))
SpecialObjectRule(misc.o, ,$(MISC_DEFINES))
SpecialObjectRule(charproc.o, ,$(MISC_DEFINES))

NormalProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
#ifdef MacMachArchitecture
InstallProgram(xterm, $(BINDIR))
#else
InstallProgramWithFlags(xterm, $(BINDIR), $(INSTUIDFLAGS))
#endif

NormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2), ,$(TERMCAPLIB))
InstallProgramWithFlags(resize, $(BINDIR), )

InstallAppDefaults(XTerm)
InstallManPage(xterm,$(MANDIR))
InstallManPage(resize,$(MANDIR))
DependTarget()
