XCOMM To customize the xmotd build, uncomment the #define statments
XCOMM
XCOMM If you wish to build with Motif, then uncomment the following line:
XCOMM #define MOTIF

XCOMM If compiling MOTIF under SOLARIS 2.x, uncomment the following line:
XCOMM #define SOLARIS2

#ifdef MOTIF

#ifdef SOLARIS2 

XCOMM Set these if you are building on Solaris 2.x. You will need to set
XCOMM LD_LIBRARY_PATH when you run it. I'm working on a fix for this.

 MOTIF_SOLARIS_LD_FLAG = -R/usr/dt/lib
         MOTIF_LIB_DIR = -L/usr/dt/lib 
         MOTIF_INCLUDE = -I/usr/dt/include
#else

XCOMM On other systems, if the Motif libs & includes are not installed
XCOMM in /usr/lib and /usr/include then uncomment and fill-in the following
XCOMM paths appropriately.

XCOMM         MOTIF_LIB_DIR = -L
XCOMM         MOTIF_INCLUDE = -I

#endif
#endif

XCOMM If you wish to use an HTML widget instead of an ASCII text widget,
XCOMM then uncomment the following line: (also see NOTE below)
XCOMM #define HAVE_HTML

XCOMM If you wish to use colour xpm pixmaps for the icon and have the
XCOMM Xpm library installed, then uncomment the following line: 
XCOMM #define HAVE_XPM

XCOMM INSTRUCTIONS:
XCOMM ------------
XCOMM 1. xmkmf -a
XCOMM 2. make all 
XCOMM -----
XCOMM NOTES
XCOMM ----- 
XCOMM If using /usr/openwin/bin/xmkmf, replace step 1 with:
XCOMM 1. xmkmf; make makefiles; make includes; make depend
XCOMM
XCOMM If building with Motif and HTML replace step 2 with:
XCOMM 2. make all EXTRA_DEFINES="-DMOTIF -DHAVE_HTML"
XCOMM
XCOMM Don't touch anything past this point unless you know what you're doing.
XCOMM --x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--

XCOMM          CC = purify gcc

             SRCS = main.c xmotd.c changed.c textmode.c usage.c browser.c logo.c
             OBJS = main.o xmotd.o changed.o textmode.o usage.o browser.o logo.o
            INCLS = maindefs.h patchlevel.h appdefs.h main.h

      CDEBUGFLAGS = -g
        MANSUFFIX = 8

         MANIFEST = README GNU ACKNOWLEDGEMENTS Imakefile browser\
					Makefile XMotd XMotd_motif xmotd.8 xlogo.bm xlogo.xpm\
					$(SRCS) $(INCLUDES)

XCOMM No space after the equals-sign
              VER =1.15
             LITE =1.15

.PRECIOUS: distrib

#ifdef HPArchitecture
        CCOPTIONS = -Aa -D_HPUX_SOURCE
#endif

#ifdef HAVE_XPM
          XPM_LIB = -lXpm
       XPM_DEFINE = -DHAVE_XPM
#endif

#ifdef HAVE_HTML
      HTML_DEFINE = -DHAVE_HTML
     HTML_SUB_DIR = ./libhtmlw
     HTML_DEP_LIB = htmlw
     HTML_LIB_DIR = -L$(HTML_SUB_DIR)
     HTML_INCLUDE = -I$(HTML_SUB_DIR)
         HTML_LIB = -lhtmlw

         MAKELIST = $(HTML_SUB_DIR)           

#endif

#ifdef MOTIF
    MOTIF_DEFINE = -DMOTIF
       MOTIF_LIB = -lXm
 LD_LIBRARY_PATH = $(MOTIF_SOLARIS_LD_FLAG)
#endif

    EXTRA_DEFINES = $(XPM_DEFINE) $(HTML_DEFINE) $(MOTIF_DEFINE)
   MOTD_LIBRARIES = $(XPM_LIB)  $(HTML_LIB_DIR) $(HTML_LIB) $(MOTIF_LIB_DIR) $(MOTIF_LIB) 
   EXTRA_INCLUDES = $(HTML_INCLUDE) $(MOTIF_INCLUDE)

XCOMM This is what the final link looks like:
XCOMM LOCAL_LIBRARIES = -lXm -lXmu -lXt -lXext -lX11 -lsocket -lgen -lucb  -L/usr/ucblib -R/usr/ucblib -R/usr/X11R6/lib

  LOCAL_LIBRARIES = $(MOTD_LIBRARIES) XawClientLibs
          DEPLIBS = $(HTML_DEP_LIB) 

ComplexProgramTarget(xmotd)
InstallAppDefaults(XMotd)

#ifdef HAVE_HTML
MakefileSubdirs($(HTML_SUB_DIR))

NormalLibraryObjectRule()
	NamedTargetSubdirs(htmlw, $(HTML_SUB_DIR), , , )
#endif

distrib: $(MANIFEST)
	./distrib

lite: $(MANIFEST)
	./distrib lite
