#
# Author:	William Chia-Wei Cheng (william@cs.ucla.edu)
#
# Copyright (C) 1990, 1991, 1992, William Cheng.
# 
# Permission limited to the use, copy, modify, and distribute this software
# and its documentation for any purpose is hereby granted by the Author without
# fee, provided that the above copyright notice appear in all copies and
# that both the copyright notice and this permission notice appear in
# supporting documentation, and that the name of the Author not be used
# in advertising or publicity pertaining to distribution of the software
# without specific, written prior permission.  The Author makes no
# representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.  All other
# rights are reserved by the Author.
#
# THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/Makefile.noimake,v 2.131.1.5 1992/10/26 08:05:52 william Exp $
#

COMPILE.c = $(CC) -c $(CFLAGS) $(CPPFLAGS)
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)

TGIFVERSION	= 2.12
INSTALLDIR	= /bin
CC 		= gcc
TGIFDIR 	= /src/tgif
MANPATH		= /src/tgif/man 
#
# Change INSTALL to /usr/ucb/install if INSTPGMFLAGS doesn't mean strip on
#		your machine (such as an RS6000).  Stripping gets rid of
#		symbol talbe and relocation bits in a binary file.
#
INSTALL		= install

MANDIR		= $(MANPATH)/mann
INSTPGMFLAGS 	= -s
INSTMANFLAGS	= -m 0444
#
# I moved DEFINES into constant.h (it was too long for make!)
#
DEFINES		= 
		 
		
	


#-DDONTFREECOLORS
#   Include the above line in the DEFINES if you don't want the black and
#   the white colors to be freed when tgif initializes itself.  You should
#   not need to do this unless to get around some server bugs.
#-DUSE_XAPPLRESDIR
#   Include the above line in the DEFINES if $XAPPLRESDIR/Tgif is used to
#   specify the resource file.  If your system does not have putenv()
#   (such as IBM-RT), then this won't work.
#-DNO_THIN_LINE
#   Include the above line in the DEFINES if a line width of 0 causes
#   your server to crash.  This is to get around a bug in some X servers.
#-DTHIN_OVAL_AND_ARC
#   Include the above line in the DEFINES if you want 0 width arcs to
#   be used when the width of an arc is less than or equal to 1.
#   (Sun3 server has a bug that makes drawing ovals and arcs with
#   width other than 0 VERY slow).
#-DKEEP_WHEN_PRINT
#   Include the above line in the DEFINES if you don't want the temp
#   file to be deleted after sending the print job to the printer.
#   (Some VMS systems might require this flag to be used.)
#-DPRINT_CMD=\"lpr\"
#   Include the above line in the DEFINES if you want to configure tgif
#   to use a default print command.
#-DNOTR4MODE
#   Include the above line in the DEFINES if you are running X11R3.
#   This will cause tgif NOT to use some X11R4 window manager related
#   functions that's not present in R3.
#-DMAPBEFORESELECT
#   Include the above line in the DEFINES to call XMapWindow() before
#   calling XSelectInput().  This might be needed to get around some
#   server bugs.
#-DDONT_FREE_COLORMAP
#   Include the above line in the DEFINES if you don't want the colormap
#   to be freed when tgif exits.
#-DA4PAPER
#   Include the above line in the DEFINES if you want to print on A4 paper
#   (8.25in by 11.7in or about 21cm by 29.7cm).
CFLAGS 		= -O $(DEFINES) -m486
LFLAGS 		= -lx -lsys -lm

OBJ1 =	align.o animate.o arc.o attr.o auxtext.o \
	box.o button.o \
	choice.o cmd.o color.o copypaste.o cursor.o \
	dialog.o drawing.o dup.o \
	edit.o eps.o \
	file.o font.o \
	grid.o group.o \
	mainloop.o mainmenu.o mark.o menu.o move.o msg.o \
	names.o \
	obj.o oval.o \
	pattern.o poly.o polygon.o ps.o \
	raster.o rcbox.o rect.o ruler.o \
	scroll.o select.o setup.o shortcut.o \
		special.o spline.o stk.o stretch.o \
	text.o \
	version.o vms_compat.o \
	xbitmap.o xpixmap.o

RASTER_BM = \
        xbm/arrow.xbm xbm/text.xbm xbm/box.xbm xbm/oval.xbm \
	xbm/poly.xbm xbm/polygon.xbm xbm/arc.xbm xbm/rcbox.xbm \
	xbm/freehand.xbm xbm/vmode.xbm \
	\
	xbm/pat0.xbm xbm/pat1.xbm xbm/pat2.xbm xbm/pat3.xbm xbm/pat4.xbm \
	xbm/pat5.xbm xbm/pat6.xbm xbm/pat7.xbm xbm/pat8.xbm xbm/pat9.xbm \
	xbm/pat10.xbm xbm/pat11.xbm xbm/pat12.xbm xbm/pat13.xbm xbm/pat14.xbm \
	xbm/pat15.xbm xbm/pat16.xbm xbm/pat17.xbm xbm/pat18.xbm xbm/pat19.xbm \
	xbm/pat20.xbm xbm/pat21.xbm xbm/pat22.xbm xbm/pat23.xbm xbm/pat24.xbm \
	xbm/pat25.xbm xbm/pat26.xbm xbm/pat27.xbm xbm/pat28.xbm xbm/pat29.xbm \
	xbm/pat30.xbm xbm/pat31.xbm xbm/pat32.xbm \
	\
	xbm/just_l.xbm xbm/just_c.xbm xbm/just_r.xbm \
	\
	xbm/align_n.xbm \
	xbm/align_l.xbm xbm/align_c.xbm xbm/align_r.xbm \
	xbm/align_t.xbm xbm/align_m.xbm xbm/align_b.xbm \
	xbm/align_s.xbm \
	\
	xbm/lw0.xbm xbm/lw1.xbm xbm/lw2.xbm xbm/lw3.xbm \
	xbm/lw4.xbm xbm/lw5.xbm xbm/lw6.xbm \
	\
	xbm/lt0.xbm xbm/lt1.xbm \
	\
	xbm/ls0.xbm xbm/ls1.xbm xbm/ls2.xbm xbm/ls3.xbm \
	\
	xbm/ld0.xbm xbm/ld1.xbm xbm/ld2.xbm xbm/ld3.xbm xbm/ld4.xbm \
	xbm/ld5.xbm xbm/ld6.xbm xbm/ld7.xbm xbm/ld8.xbm \
	\
	xbm/lw0s.xbm xbm/lw1s.xbm xbm/lw2s.xbm xbm/lw3s.xbm \
	xbm/lw4s.xbm xbm/lw5s.xbm xbm/lw6s.xbm \
	\
	xbm/lt0s.xbm xbm/lt1s.xbm \
	\
	xbm/ls0s.xbm xbm/ls1s.xbm xbm/ls2s.xbm xbm/ls3s.xbm \
	\
	xbm/ld0s.xbm xbm/ld1s.xbm xbm/ld2s.xbm xbm/ld3s.xbm xbm/ld4s.xbm \
	xbm/ld5s.xbm xbm/ld6s.xbm xbm/ld7s.xbm xbm/ld8s.xbm \
	\
	xbm/printer.xbm xbm/latex.xbm xbm/psfile.xbm xbm/xbm.xbm \
	\
	xbm/file.xbm xbm/landscape.xbm xbm/special.xbm xbm/vspace.xbm \
	\
	xbm/rcbradius.xbm xbm/const_move.xbm xbm/unconst_move.xbm \
	\
	xbm/rotate_0.xbm xbm/rotate_90.xbm xbm/rotate_180.xbm xbm/rotate_270.xbm

CURSOR_BM = xbm/null.xbm xbm/nullmask.xbm xbm/text_cur_image.xbm

OBJS = tgif.o $(OBJ1)

tgif: $(OBJS)
	$(CC) -o tgif @tgif.lib -g $(LFLAGS)
        strip tgif
        aout2exe tgif

all: tgif prtgif #frontend11.o testdrive
	@echo Making all ...

prtgif: prtgif.o $(OBJ1)
	$(CC) -o prtgif prtgif.o -O $(LFLAGS)

testdrive: testdrive.o $(OBJ1)
	$(CC) -o testdrive testdrive.o $(OBJ1) -O $(LFLAGS)

align.o:	const.h types.h \
		auxtext.e button.e choice.e cmd.e color.e drawing.e dup.e \
		grid.e mainmenu.e mark.e menu.e move.e obj.e raster.e \
		select.e setup.e
animate.o:	const.h types.h \
		color.e raster.e select.e setup.e
arc.o:		const.h types.h \
		cmd.e color.e cursor.e dialog.e dup.e file.e grid.e mainloop.e \
		obj.e pattern.e poly.e raster.e ruler.e select.e setup.e \
		special.e xpixmap.e
attr.o:		const.h types.h \
		auxtext.e choice.e cmd.e color.e cursor.e dialog.e drawing.e \
		dup.e file.e font.e mainloop.e mark.e menu.e msg.e obj.e \
		raster.e select.e setup.e text.e
auxtext.o:	const.h types.h \
		color.e file.e font.e msg.e obj.e pattern.e prtgif.e \
		raster.e setup.e text.e xpixmap.e
box.o:		const.h types.h \
		cmd.e color.e cursor.e file.e grid.e mainloop.e obj.e \
		pattern.e poly.e raster.e ruler.e setup.e xpixmap.e
button.o:	const.h types.h \
		auxtext.e box.e cursor.e file.e font.e mainloop.e mainmenu.e \
		msg.e raster.e rect.e setup.e
choice.o:	const.h types.h \
		align.e arc.e box.e color.e cursor.e font.e grid.e mainmenu.e \
		mark.e msg.e oval.e pattern.e poly.e polygon.e raster.e \
		rcbox.e select.e setup.e text.e
cmd.o:		const.h types.h \
		attr.e choice.e dialog.e dup.e mark.e obj.e select.e setup.e
color.o:	const.h types.h \
		choice.e cmd.e mainloop.e mark.e menu.e obj.e raster.e \
		select.e setup.e text.e xpixmap.e
copypaste.o:	const.h types.h \
		auxtext.e box.e choice.e cmd.e color.e cursor.e dup.e file.e \
		font.e move.e obj.e pattern.e select.e setup.e special.e text.e
cursor.o:	const.h types.h $(CURSOR_BM) \
		choice.e color.e setup.e xbitmap.e
dialog.o:	const.h types.h \
		auxtext.e box.e cursor.e file.e font.e mainloop.e mainmenu.e \
		msg.e raster.e setup.e
drawing.o:	const.h types.h \
		align.e animate.e arc.e attr.e auxtext.e box.e choice.e \
		cmd.e copypaste.e cursor.e dialog.e dup.e edit.e eps.e file.e \
		font.e grid.e group.e mainloop.e mark.e menu.e msg.e obj.e \
		oval.e pattern.e poly.e polygon.e raster.e rcbox.e rect.e \
		ruler.e scroll.e select.e setup.e shortcut.e special.e stk.e \
		stretch.e text.e xbitmap.e xpixmap.e
dup.o:		const.h types.h \
		attr.e choice.e cmd.e drawing.e grid.e obj.e raster.e select.e \
		setup.e xbitmap.e xpixmap.e
edit.o:		const.h types.h \
		align.e arc.e choice.e cmd.e color.e copypaste.e \
		cursor.e drawing.e dup.e eps.e font.e grid.e group.e \
		mainloop.e mark.e menu.e msg.e obj.e pattern.e poly.e raster.e \
		select.e setup.e special.e spline.e stretch.e text.e xbitmap.e \
		xpixmap.e
eps.o:		const.h types.h \
		cmd.e color.e cursor.e dialog.e dup.e file.e grid.e mark.e \
		msg.e obj.e pattern.e select.e setup.e xbitmap.e
file.o:		const.h patchlevel.h types.h \
		align.e arc.e attr.e auxtext.e box.e button.e choice.e cmd.e \
		color.e copypaste.e cursor.e dialog.e drawing.e dup.e eps.e \
		font.e grid.e group.e mainloop.e mainmenu.e mark.e menu.e \
		msg.e names.e obj.e oval.e pattern.e poly.e polygon.e \
		prtgif.e ps.e raster.e rcbox.e rect.e ruler.e scroll.e \
		select.e setup.e special.e stk.e text.e version.e xbitmap.e \
		xpixmap.e
font.o:		const.h types.h \
		auxtext.e choice.e color.e cursor.e drawing.e mainmenu.e \
		mark.e menu.e obj.e pattern.e raster.e select.e setup.e text.e
grid.o:		const.h types.h \
		choice.e color.e cursor.e drawing.e dup.e file.e mainmenu.e \
		menu.e msg.e obj.e pattern.e raster.e ruler.e scroll.e \
		select.e setup.e text.e
group.o:	const.h types.h \
		attr.e choice.e cmd.e dup.e file.e msg.e obj.e select.e setup.e
mainloop.o:	const.h patchlevel.h types.h \
		animate.e auxtext.e choice.e cmd.e color.e copypaste.e \
		cursor.e dialog.e drawing.e file.e font.e grid.e mainmenu.e \
		menu.e msg.e names.e obj.e raster.e ruler.e scroll.e select.e \
		setup.e stk.e text.e version.e xbitmap.e xpixmap.e
mainmenu.o:	const.h types.h \
		align.e choice.e color.e cursor.e edit.e file.e font.e grid.e \
		mainloop.e menu.e pattern.e raster.e setup.e special.e text.e
mark.o:		const.h types.h \
		choice.e obj.e raster.e setup.e select.e
menu.o:		const.h patchlevel.h types.h \
		box.e choice.e color.e cursor.e dialog.e drawing.e edit.e \
		file.e font.e grid.e mainloop.e mainmenu.e msg.e names.e obj.e \
		pattern.e raster.e select.e setup.e special.e text.e version.e
move.o:		const.h types.h \
		arc.e attr.e cmd.e cursor.e drawing.e dup.e grid.e mainloop.e \
		mark.e obj.e oval.e raster.e rcbox.e ruler.e select.e setup.e \
		spline.e
msg.o:		const.h types.h \
		button.e copypaste.e cursor.e dialog.e file.e font.e \
		mainloop.e menu.e raster.e setup.e
names.o:	const.h types.h \
		vms_compat.h \
		auxtext.e box.e button.e cursor.e file.e font.e mainloop.e \
		mainmenu.e msg.e raster.e setup.e
obj.o:		const.h types.h \
		arc.e attr.e auxtext.e box.e cursor.e group.e oval.e poly.e \
		polygon.e rcbox.e setup.e spline.e text.e xbitmap.e xpixmap.e
oval.o:		const.h types.h \
		cmd.e color.e cursor.e file.e grid.e mainloop.e obj.e \
		pattern.e poly.e raster.e ruler.e select.e setup.e xpixmap.e
pattern.o:	const.h types.h \
		arc.e choice.e color.e cmd.e dialog.e drawing.e file.e font.e \
		mainmenu.e mark.e menu.e obj.e poly.e raster.e select.e \
		setup.e spline.e text.e
poly.o:		const.h types.h \
		attr.e choice.e cmd.e color.e cursor.e drawing.e file.e grid.e \
		mainloop.e msg.e obj.e pattern.e polygon.e raster.e rect.e \
		ruler.e select.e setup.e spline.e xpixmap.e
polygon.o:	const.h types.h \
		cmd.e color.e cursor.e dialog.e grid.e file.e mainloop.e msg.e \
		obj.e pattern.e poly.e raster.e ruler.e select.e setup.e \
		spline.e xpixmap.e
prtgif.o:	const.h
ps.o:
raster.o:	const.h types.h $(RASTER_BM) \
		choice.e color.e file.e font.e pattern.e poly.e setup.e
rcbox.o:	const.h types.h \
		cmd.e color.e cursor.e file.e grid.e mainloop.e obj.e \
		pattern.e poly.e raster.e ruler.e setup.e xpixmap.e
rect.o:		const.h types.h \
		arc.e poly.e setup.e spline.e
ruler.o:	const.h types.h \
		font.e grid.e raster.e setup.e
scroll.o:	const.h types.h \
		choice.e cursor.e drawing.e dup.e grid.e msg.e obj.e raster.e \
		ruler.e setup.e text.e
select.o:	const.h types.h \
		choice.e cmd.e color.e cursor.e drawing.e dup.e file.e grid.e \
		group.e mainloop.e mark.e move.e msg.e names.e obj.e raster.e \
		rect.e ruler.e setup.e stretch.e
setup.o:	const.h types.h \
		attr.e auxtext.e choice.e cmd.e color.e cursor.e drawing.e \
		dup.e file.e font.e grid.e mainloop.e mainmenu.e mark.e menu.e \
		msg.e names.e pattern.e raster.e ruler.e scroll.e select.e \
		shortcut.e spline.e stk.e text.e xbitmap.e xpixmap.e
shortcut.o:	const.h types.h \
		setup.e
special.o:	const.h types.h \
		animate.e attr.e choice.e cmd.e color.e cursor.e dialog.e \
		drawing.e dup.e edit.e file.e grid.e group.e mainloop.e mark.e \
		menu.e msg.e move.e names.e obj.e raster.e select.e setup.e \
		stk.e
spline.o:	const.h types.h \
		poly.e raster.e rect.e setup.e
stk.o:		const.h types.h \
		align.e button.e choice.e cmd.e color.e cursor.e drawing.e \
		dup.e file.e font.e grid.e mainmenu.e mark.e menu.e msg.e \
		names.e obj.e pattern.e ruler.e scroll.e select.e setup.e text.e
stretch.o:	const.h types.h \
		align.e arc.e auxtext.e choice.e cmd.e color.e cursor.e \
		dialog.e drawing.e dup.e font.e grid.e mainloop.e move.e obj.e \
		poly.e raster.e ruler.e select.e setup.e spline.e text.e \
		xbitmap.e xpixmap.e
testdrive.o:	const.h types.h mainloop.e msg.e obj.e setup.e
text.o:		const.h types.h \
		attr.e auxtext.e cmd.e choice.e color.e cursor.e drawing.e \
		dup.e file.e font.e grid.e msg.e obj.e pattern.e poly.e \
		prtgif.e raster.e ruler.e scroll.e setup.e xpixmap.e
tgif.o:		const.h patchlevel.h types.h \
		file.e grid.e mainloop.e msg.e obj.e pattern.e setup.e version.e
version.o:
vms_compat.o:	vms_compat.h
xbitmap.o:	const.h types.h \
		auxtext.e choice.e cmd.e color.e cursor.e dialog.e dup.e \
		file.e font.e grid.e mark.e menu.e msg.e names.e obj.e \
		pattern.e raster.e select.e setup.e xpixmap.e
xpixmap.o:	const.h types.h \
		choice.e cmd.e color.e cursor.e dialog.e dup.e file.e font.e \
		grid.e mark.e msg.e names.e obj.e pattern.e raster.e select.e \
		setup.e xbitmap.e


clean:
	rm -f tgif prtgif *.o core
