#ifndef XCOMM
#define XCOMM #
#endif

#ifndef NullParameter
#define NullParameter
#endif

XCOMM 
XCOMM  Author:      William Chia-Wei Cheng (william@cs.ucla.edu)
XCOMM 
XCOMM  Copyright (C) 1990-1996, William Chia-Wei Cheng.
XCOMM 
XCOMM  Permission limited to the use, copy, display, distribute without
XCOMM  charging for a fee, and produce derivative works of "tgif" and
XCOMM  its documentation for not-for-profit purpose is hereby granted by
XCOMM  the Author, provided that the above copyright notice appears in
XCOMM  all copies made of "tgif" and that both the copyright notice
XCOMM  and this permission notice appear in supporting documentation,
XCOMM  and that the name of the Author not be used in advertising or
XCOMM  publicity pertaining to distribution of the software without
XCOMM  specific, written prior permission.  The Author makes no
XCOMM  representations about the suitability of this software for any
XCOMM  purpose.  It is provided "as is" without express or implied
XCOMM  warranty.  All other rights (including, but not limited to, the
XCOMM  right to sell "tgif", the right to sell derivative works of
XCOMM  "tgif", and the right to distribute "tgif" for a fee) are
XCOMM  reserved by the Author.
XCOMM 
XCOMM  THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
XCOMM  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
XCOMM  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
XCOMM  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
XCOMM  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
XCOMM  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
XCOMM  PERFORMANCE OF THIS SOFTWARE.
XCOMM 
XCOMM  @(#)$Header: /n/opus/u/guest/william/src/tgif/v3/RCS/Imakefile,v 3.1 1996/05/10 06:33:22 william Exp $
XCOMM 

XCOMM On Solaris, you probably need to uncomment the next few lines:
XCOMM 
XCOMM CC		= cc
XCOMM PREPROCESSCMD	= cc -E $(STD_CPP_DEFINES)
XCOMM EXTRA_LDOPTIONS	=

TGIFVERSION	= 3.0-p1
PROGRAMS	= tgif prtgif XCOMM frontend11.o testdrive
XCOMM CDEBUGFLAGS= -g
XCOMM INSTPGMFLAGS= -s
XCOMM BINDIR	= /u/halfmoon/$(MACHINE)/bin
XCOMM MANPATH	= /u/halfmoon/man
XCOMM TGIFDIR	= /u/halfmoon/lib/X11/tgif
TGIFDIR		= $(LIBDIR)/tgif
DEFINES		= -DTGIF_PATH=\"$(TGIFDIR)\" -DPSFILE_MOD=0664 \@@\
                  -DEPSF_FILE_EXT=\"eps\" -DPS_FILE_EXT=\"ps\" \@@\
                  -DXBM_FILE_EXT=\"xbm\" -DXPM_FILE_EXT=\"xpm\" \@@\
                  -DOBJ_FILE_EXT=\"obj\" -DSYM_FILE_EXT=\"sym\" \@@\
                  -DTEXT_FILE_EXT=\"txt\" \@@\
                  -DTELEPORT_ATTR=\"warp_to=\" -DTMP_DIR=\"/tmp/\" \@@\
                  -DLAUNCH_ATTR=\"launch=\" -DEXEC_ATTR=\"exec=\" \@@\
                  -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT

XCOMM Things to try to add to the DEFINES line above:
XCOMM
XCOMM    RS6000:  -D_BSD
XCOMM    Solaris: 
XCOMM    Irix:    -D_NO_EXTERN -D_NO_PROTO -D_USE_XDRAWPOINT_TO_PUT_A_POINT
XCOMM    SunOS:   -D_BACKGROUND_DONT_FORK
XCOMM    HP-UX:   -D_USE_XDRAWPOINT_TO_PUT_A_POINT
XCOMM    VMS:     -D_NO_GETTIMEOFDAY
XCOMM    Linux:   -D_BACKGROUND_DONT_FORK -D_USE_XDRAWPOINT_TO_PUT_A_POINT
XCOMM    FreeBSD: -D_USE_XDRAWPOINT_TO_PUT_A_POINT

LOCAL_LIBRARIES	= $(XLIB)
XCOMM LOCAL_LIBRARIES	= $(XMULIB) $(XTOOLLIB) $(XLIB)
DEPLIBS		= $(DEPXLIB)
SYS_LIBRARIES	= -lm

XCOMM -D_NO_GETTIMEOFDAY
XCOMM    Include the above line if you do not have the gettimeofday()
XCOMM    function but have the ftime() function.
XCOMM -D_TGIF_WB
XCOMM    Include the above line if you want to include the whiteboard feature
XCOMM    by Renato Santana <renato@nce.ufrj.br>.
XCOMM -DBSD_COMP
XCOMM    Include the above line if you are compiling on a Solaris (or
XCOMM    possibly an SGI) machine which requires it in <sys/ioctl.h>.
XCOMM    (If you see the error that FIONBIO is not defined when compiling
XCOMM    tcp.c, then you probably need this.)
XCOMM -D_BACKGROUND_DONT_FORK
XCOMM    Try the above line if there are defunct tgif child processes.
XCOMM -D_NO_LSTAT
XCOMM    Include the above line if lstat() is not available.  In this case,
XCOMM    using BrowseXBitmap and BrowseXPixmap under the File Menu may cause
XCOMM    infinite loop if the directory structure is infinitely recursive.
XCOMM -D_USE_XDRAWPOINT_TO_PUT_A_POINT
XCOMM    Include the above line if the grid points are not visible.  This can
XCOMM    be used to bypass some X server bugs (such as certain Linux X server
XCOMM    using VGA16 screen) where the XDrawLine() Xlib call does not work
XCOMM    properly.
XCOMM -D_NO_EXTERN
XCOMM    Include the above line in the DEFINES if you don't want to include
XCOMM    the extern definition for functions defined in a module.  For example,
XCOMM    if this option is set, then file "foo.c" will not include "foo.e",
XCOMM    and certain other extern definition in "foo.c" will be omitted.
XCOMM -D_NO_PROTO
XCOMM    Include the above line in the DEFINES if checking for function
XCOMM    prototypes is not desired.  Checking for function prototypes
XCOMM    are automatically enabled if you are using an ANSI or C++ compilor.
XCOMM    However, not all ANSI/C++ compilors are created equal.
XCOMM -D_BSD
XCOMM    Include the above line in the DEFINES if the select() function can
XCOMM    does not be found for AIX systems (such as RS6000).  Also, on AIX
XCOMM    systems, if you see garbage file names when you try to open files,
XCOMM    try this flag to make direct and dirent equivalent (in <sys/dir.h>).
XCOMM -DNO_STRSTR
XCOMM    Include the above line in the DEFINES if you do not have the strstr()
XCOMM    function in your system's string library.
XCOMM -DINVERT_CTM_BUG
XCOMM    Include the above line in the DEFINES if you are using PostScript
XCOMM    utilities which fails when trying to invert non-invertible CTM
XCOMM    (e.g., muluti.ps from ftp.ucc.su.oz.au:/pub/ps_printing/multi).
XCOMM -DHP_LINE_BUG
XCOMM    Include the above line in the DEFINES if two-vertices horizontal and
XCOMM    verticle line segments don't draw properly on a buggy HP server.
XCOMM -DDONTFREECOLORS
XCOMM    Include the above line in the DEFINES if you don't want the black and
XCOMM    the white colors to be freed when tgif initializes itself.  You should
XCOMM    not need to do this unless you need to get around some server bugs.
XCOMM -DUSE_XAPPLRESDIR
XCOMM    Include the above line in the DEFINES if $XAPPLRESDIR/Tgif is used to
XCOMM    specify the resource file.  If your system does not have putenv()
XCOMM    (such as IBM-RT), then this won't work.
XCOMM -DXAPPLOADDIR_DEF
XCOMM    If you define USE_XAPPLRESDIR, define this to a default directory
XCOMM    to use in case $XAPPLRESDIR isn't set.
XCOMM -DUSE_XT_INITIALIZE
XCOMM    This will cause the XToolkit to be initialized so that the X defaults
XCOMM    are obtained from the Xt directories.  This should only be used when
XCOMM    USE_XAPPLRESDIR option is NOT used.  Please remember to use the
XCOMM    LOCAL_LIBRARIES with $(XTOOLLIB) $(XMULIB) above.
XCOMM -DNO_THIN_LINE
XCOMM    Include the above line in the DEFINES if a line width of 0 causes
XCOMM    your server to crash.  This is to get around a bug in some X servers.
XCOMM -DTHIN_OVAL_AND_ARC
XCOMM    Include the above line in the DEFINES if you want 0 width arcs to
XCOMM    be used when the width of an arc is less than or equal to 1.
XCOMM    (Sun3 server has a bug that makes drawing ovals and arcs with
XCOMM    width other than 0 VERY slow).
XCOMM -DKEEP_WHEN_PRINT
XCOMM    Include the above line in the DEFINES if you don't want the temp
XCOMM    file to be deleted after sending the print job to the printer.
XCOMM    (Some VMS systems might require this flag to be used.)
XCOMM -DPRINT_CMD=\"lpr\"
XCOMM    Include the above line in the DEFINES if you want to configure tgif
XCOMM    to use a default print command.
XCOMM -DNOTR4MODE
XCOMM    Include the above line in the DEFINES if you are running X11R3.
XCOMM    This will cause tgif NOT to use some X11R4 window manager related
XCOMM    functions that's not present in R3.
XCOMM -DMAPBEFORESELECT
XCOMM    Include the above line in the DEFINES to call XMapWindow() before
XCOMM    calling XSelectInput().  This might be needed to get around some
XCOMM    server bugs.
XCOMM -DDONT_FREE_COLORMAP
XCOMM    Include the above line in the DEFINES if you don't want the colormap
XCOMM    to be freed when tgif exits.
XCOMM -DA4PAPER
XCOMM    Include the above line in the DEFINES if you want to print on A4 paper
XCOMM    (8.25in by 11.7in or about 21cm by 29.7cm).

OBJ1 =	align.o animate.o arc.o attr.o auxtext.o \
	box.o button.o \
	choice.o choose.o cmd.o color.o cutpaste.o cursor.o \
	dialog.o drawing.o dup.o \
	edit.o eps.o exec.o expr.o \
	file.o font.o ftp.o \
	grid.o group.o \
	help.o http.o \
	imgproc.o import.o \
	mainloop.o mainmenu.o mark.o menu.o move.o msg.o \
	names.o navigate.o \
	obj.o oval.o \
	page.o pattern.o poly.o polygon.o ps.o \
	raster.o rcbox.o rect.o remote.o ruler.o \
	scroll.o select.o setup.o shape.o shortcut.o \
		special.o spline.o stk.o stretch.o \
	tgif_dbg.o \
	tcp.o text.o \
	util.o \
	version.o vms_comp.o \
	wb1.o wb2.o wb3.o \
	xbitmap.o xpixmap.o

OBJS1 = tgif.o $(OBJ1)
OBJS2 = prtgif.o
OBJS3 = testdrive.o $(OBJ1)
FRONTENDOBJS = frontend.o $(OBJ1)

CURRENTDIR =./

SRCS1 = $(CURRENTDIR)*.c
SRCS2 = 
SRCS3 = 

ComplexProgramTarget_1(tgif,$(LOCAL_LIBRARIES),NullParameter)
ComplexProgramTarget_2(prtgif,NullParameter,NullParameter)
/*
 * ComplexProgramTarget_3(testdrive,$(LOCAL_LIBRARIES),NullParameter)
 */

/*
 * NormalRelocatableTarget(frontend11,$(FRONTENDOBJS))
 */

MakeDirectories(install,$(TGIFDIR))
InstallNonExec(tgif.Xdefaults,$(TGIFDIR))
InstallNonExec(tgificon.eps,$(TGIFDIR))
InstallNonExec(tgificon.obj,$(TGIFDIR))
InstallNonExec(tgificon.xbm,$(TGIFDIR))
InstallNonExec(tgificon.xpm,$(TGIFDIR))
InstallNonExec(tangram.sym,$(TGIFDIR))
InstallNonExec(keys.obj,$(TGIFDIR))

.SUFFIXES: .l .man

.l.man:
	rm -f $*.man
	cp $*.l $*.man

.e.o:

SPICEDIR =spice/
XBMDIR =xbm/

OBJDEMO = an-sr-flip-flop.obj fonts.obj slide-demo.obj keys.obj \
	  $(SPICEDIR)*.obj launch-demo.obj launch-demo-1.obj
SYMDEMO = flip-flop.sym nand2.sym pin.sym tangram.sym $(SPICEDIR)*.sym
MISCTAR = /**/*.man README Copyright tgif.pl $(SPICEDIR)*.mod example.tex \
		HISTORY /**/*.uu testdrive.pl frontend.pl

distr: tar version

uu:
	rm -f /**/*.uu /**/*.cat /**/*.cat.Z
	groff -Tascii -man tgif.man > tgif.cat; compress tgif.cat
	groff -Tascii -man prtgif.man > prtgif.cat; compress prtgif.cat
	uuencode tgif.cat.Z tgif.cat.Z > tgif.cat.Z.uu
	uuencode prtgif.cat.Z prtgif.cat.Z > prtgif.cat.Z.uu

rcstar:
	@rm -f home/RCS3.tar.gz.save
	@if [ -f home/RCS3.tar.gz ]; then \
		mv home/RCS3.tar.gz home/RCS3.tar.gz.save; \
        fi
	tar cf home/RCS3.tar RCS xbm.RCS
	gzip home/RCS3.tar
	ls -l home/RCS3.tar.gz

tar: uu
	rm -f tgif-$(TGIFVERSION).tar/**/*
	tar cvf tgif-$(TGIFVERSION).tar /**/*.c /**/*.e /**/*.h \
		Makefile.noimake Imakefile descrip./**/??? VMS_MAKE_TGIF.COM \
		tgificon.obj $(XBMDIR)*.xbm \
		tgificon.xbm tgificon.xpm tgif.Xdefaults tgificon.eps \
		$(OBJDEMO) \
		$(SYMDEMO) \
		$(MISCTAR)
	rm -rf tgif-$(TGIFVERSION)
	mkdir tgif-$(TGIFVERSION)
	cd tgif-$(TGIFVERSION); tar xvf ../tgif-$(TGIFVERSION).tar; cd ..
	rm -f tgif-$(TGIFVERSION).tar
	tar cvf tgif-$(TGIFVERSION).tar tgif-$(TGIFVERSION)
	gzip -c tgif-$(TGIFVERSION).tar > tgif-$(TGIFVERSION).tar.gz
	compress tgif-$(TGIFVERSION).tar
	rm -rf tgif-$(TGIFVERSION)

MAN_1 = README /**/*.man Imakefile Copyright
BASIC_1 = Makefile.noimake descrip./**/* HISTORY tgif.Xdefaults \
	  VMS_MAKE_TGIF.COM

MISC_1 = an-sr-flip-flop.obj fonts.obj slide-demo.obj keys.obj \
	 launch-demo.obj launch-demo-1.obj \
	 flip-flop.sym nand2.sym pin.sym tangram.sym tgificon.xbm
MISC_2 = tgif.pl testdrive.pl frontend.pl tgificon.obj example.tex tangram.sym
MISC_3 = tgificon.xpm tgificon.eps /**/*.uu
SPICE_1 = spice $(SPICEDIR)*.obj $(SPICEDIR)*.sym $(SPICEDIR)*.mod

shar: uu
	rm -f tgif-$(TGIFVERSION).shar./**/*
	shar -otgif-$(TGIFVERSION).shar.1 -n1 -e38 $(MAN_1)
	shar -otgif-$(TGIFVERSION).shar.2 -n2 -e38 $(BASIC_1)
	shar -otgif-$(TGIFVERSION).shar.3 -n3 -e38 a[a-n]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.4 -n4 -e38 a[o-s]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.5 -n5 -e38 a[t-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.6 -n6 -e38 b/**/*.c
	shar -otgif-$(TGIFVERSION).shar.7 -n7 -e38 c[a-m]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.8 -n8 -e38 c[n-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.9 -n9 -e38 d/**/*.c
	shar -otgif-$(TGIFVERSION).shar.10 -n10 -e38 e[a-d]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.11 -n11 -e38 e[e-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.12 -n12 -e38 f[a-i]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.13 -n13 -e38 f[j-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.14 -n14 -e38 [g-l]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.15 -n15 -e38 ma/**/*.c
	shar -otgif-$(TGIFVERSION).shar.16 -n16 -e38 m[b-e]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.17 -n17 -e38 m[f-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.18 -n18 -e38 n/**/*.c
	shar -otgif-$(TGIFVERSION).shar.19 -n19 -e38 o/**/*.c p[a-n]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.20 -n20 -e38 poly.c
	shar -otgif-$(TGIFVERSION).shar.21 -n21 -e38 polygon.c p[p-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.22 -n22 -e38 r[a-c]/**/*.c stk/**/*.c
	shar -otgif-$(TGIFVERSION).shar.23 -n23 -e38 r[d-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.24 -n24 -e38 sc/**/*.c sel/**/*.c
	shar -otgif-$(TGIFVERSION).shar.25 -n25 -e38 set/**/*.c s[f-p]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.26 -n26 -e38 str/**/*.c
	shar -otgif-$(TGIFVERSION).shar.27 -n27 -e38 text.c
	shar -otgif-$(TGIFVERSION).shar.28 -n28 -e38 testdrive.c t[f-z]/**/*.c \
				[u-w]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.29 -n29 -e38 x[a-m]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.30 -n30 -e38 x[n-z]/**/*.c
	shar -otgif-$(TGIFVERSION).shar.31 -n31 -e38 [a-n]/**/*.e
	shar -otgif-$(TGIFVERSION).shar.32 -n32 -e38 [o-z]/**/*.e /**/*.h
	shar -otgif-$(TGIFVERSION).shar.33 -n33 -e38 xbm xbm/[a-k]/**/*.xbm \
				xbm/l[a-s]/**/*.xbm
	shar -otgif-$(TGIFVERSION).shar.34 -n34 -e38 xbm/l[t-z]/**/*.xbm \
				xbm/[m-z]/**/*.xbm
	shar -otgif-$(TGIFVERSION).shar.35 -n35 -e38 $(MISC_1)
	shar -otgif-$(TGIFVERSION).shar.36 -n36 -e38 $(MISC_2)
	shar -otgif-$(TGIFVERSION).shar.37 -n37 -e38 $(MISC_3)
	shar -otgif-$(TGIFVERSION).shar.38 -n38 -e38 $(SPICE_1)

version:
	what .psmac /**/*.c /**/*.e /**/*.h Makefile.noimake Imakefile \
		/**/*.man tgif.pl README example.tex HISTORY \
		tgificon.obj an-sr-flip-flop.obj fonts.obj slide-demo.obj \
		keys.obj flip-flop.sym nand2.sym pin.sym tangram.sym \
		$(SPICEDIR)*.obj $(SPICEDIR)*.sym testdrive.pl frontend.pl \
		descrip.mms descrip.opt tgifmacro.ps $(XBMDIR)*.xbm \
		tgificon.xbm tgificon.xpm tgif.Xdefaults tgificon.eps \
		VMS_MAKE_TGIF.COM launch-demo.obj launch-demo-1.obj \
		Copyright \
		> VersionInfo/Distribution/tgif-$(TGIFVERSION)
