# $Id$
# DDD Makefile.

# Copyright (C) 1995-1998 Technische Universitaet Braunschweig, Germany.
# Copyright (C) 2000 Universitaet Passau, Germany.
# Written by Andreas Zeller <zeller@gnu.org>.
# 
# This file is part of DDD.
# 
# DDD is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
# 
# DDD is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public
# License along with DDD -- see the file COPYING.
# If not, see <http://www.gnu.org/licenses/>.
# 
# DDD is the data display debugger.
# For details, see the DDD World-Wide-Web page, 
# `http://www.gnu.org/software/ddd/',
# or send a mail to the DDD developers <ddd@gnu.org>.


### CUSTOMIZATION SECTION --- Please check the settings below.
# Typical values are enclosed in ().

## Directories.

# Common prefix for installation directories.  (/usr/local)
# NOTE: This directory must exist when you start the install.
prefix = @prefix@
exec_prefix = @exec_prefix@

# Where to fetch the source from.  (.)
srcdir = @srcdir@
VPATH = @srcdir@

# Where to put the binary.  (${exec_prefix}/bin)
bindir = @bindir@

# Where to put the info file.  (${prefix}/info)
infodir = @infodir@

# Where to put the manual page.  (${prefix}/man)
mandir  = @mandir@
man1dir = $(mandir)/man1
man1ext = .1


## Architecture (usually overridden by the top-level Makefile).

# The host we were compiled on.  (CPU-COMPANY-SYSTEM)
host_canonical = @host@

# The target we were compiled for.  (CPU-COMPANY-SYSTEM)
target_canonical = @host@


## Special commands.

# The sed command.  (sed)
SED = @SED@

# The rm command.
RM = rm -f

# The ln -s command for making symbolic links; plain ln should work
# too.  (ln -s)
LN_S = @LN_S@

# The m4 command, preferably GNU m4.   (m4)
# The `-B20000' works around M4 limitations on System V; GNU M4 ignores it.
# (Reported by Justin Mayfield <mayfield@hpbs1824.boi.hp.com>.)
M4 = @M4@ -B20000

# The lex command (flex), its flags (-8), and its library (-lfl).
LEX = @LEX@
LFLAGS = @LFLAGS@
LEXLIB = @LEXLIB@

# The lex output root (lex.yy)
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@

# The yacc command (bison -y) and its flags ().
YACC = @YACC@
YFLAGS = @YFLAGS@

# The shell for executing commands in the Makefile.  (/bin/sh)
SHELL = @SH@

# The ar command.
AR = ar

# ar flags for creating a new archive.
AR_FLAGS = q

# ar flags for extracting files from an archive.
AR_X_FLAGS = x

# The ranlib command.  (ranlib)
RANLIB = @RANLIB@

# A compress command, reading from stdin and writing to stdout.  (gzip -c)
COMPRESS = @COMPRESS@

# An uncompress command, reading from stdin and writing to stdout.  (gunzip -c)
UNCOMPRESS = @UNCOMPRESS@

# The etags command.  (etags)
ETAGS = etags --c++


## The C++ compiler.

# What we use to compile C++ files.  (c++)
CXX = @CXX@

# The flags we use to compile C++ files.
# CXXOPT = -DNDEBUG -O2
CXXOPT = @CXXOPT@
# CXXDEBUG = -g
CXXDEBUG = @CXXDEBUG@
# CXXWARNINGS = -W -Wall
CXXWARNINGS = @CXXWARNINGS@
CXXFLAGS = $(CXXOPT) $(CXXDEBUG) $(CXXWARNINGS)

# Extra C++-specific flags.  (-fexternal-templates -felide-constructors)
CXXSTUFF = @CXXSTUFF@ @X_PERMISSIVE@

# Possible extra libraries required for all C++ programs.  ()
CXXLIBS = @CXXLIBS@

# Executable extension.  Empty on Unix, `.exe' on Windows. ()
EXEEXT = @EXEEXT@

# Object extension.  `o' on Unix, `obj' on Windows. (o)
OBJEXT = @OBJEXT@


## The C compiler; for demos only

# What we use to compile C files.
# CC = cc
CC = @CC@

# The flags we use to compile C files.
# CFLAGS = -g
CFLAGS = @CFLAGS@


## The Pascal compiler (for demos only)

# What we use to compile Pascal files.
PC = pc

# The flags we use to compile Pascal files.
PFLAGS = -g


## The Modula-2 compiler (for demos only)

# What we use to compile Modula-2 files.
M2C = m2c

# The flags we use to compile Modula-2 files.
M2FLAGS = -g


## The FORTRAN compiler (for demos only)

# What we use to compile FORTRAN files.
FC = @F77@

# The flags we use to compile FORTRAN files.
FFLAGS = @FFLAGS@



## The C preprocessor.

# What we use for preprocessing.  (gcc -E -traditional-cpp)
CPP = @CPP_TRADITIONAL@

# Flags passed to the C preprocessor.  ()
CPPFLAGS = @CPPFLAGS@

# Definitions to be passed to the C preprocessor.  (-DHAVE_CONFIG_H)
DEFS = @DEFS@


## The Linker.

# Flags passed to the linker.  (-g -O)
LDFLAGS = @LDFLAGS@ @BIG_TOC@

# Use this for building statically linked executables with GCC.
# LDFLAGS = -static @LDFLAGS@ @BIG_TOC@



## Local libraries

# POSIX regex routines (from system)
# LIBRX      = @LIBRX@
LIBRX      =
# termcap routines (from system)
LIBTERMCAP = @LIBTERMCAP@
# -lreadline library (from system)
LIBREADLINE = @LIBREADLINE@
# Yacc library (-ly)
LIBY       = @LIBY@
# Math library (-lm)
LIBM       = @LIBM@
# C library (-lc)
LIBC       = @LIBC@
# Socket library (-lsocket)
LIBSOCKET  = @LIBSOCKET@
# ELF library (-lelf)
LIBELF     = @LIBELF@
# NSL library (-lnsl)
LIBNSL     = @LIBNSL@
# Additional libraries required for non-X programs (-lsocket -lnsl)
NON_X_LIBS = @LIBS@

# All libraries shown above
LIBS = $(CXXLIBS) $(LIBREADLINE) $(LIBSOCKET) $(LIBNSL) $(LIBRX) \
       $(LIBTERMCAP) $(LIBY) $(LIBM) $(LIBELF)


## X Libraries

# Special flags for linking with X.  (-L/usr/X11R5/lib)
X_LDFLAGS = @X_LIBS@

# Motif library.  (-lXm)
LIBXM = @XM_LIBS@

# Use this alternative for building `semistatic' executables
# where Motif libraries are statically linked in.
# LIBXM = -Wl,-Bstatic @XM_LIBS@ -Wl,-Bdynamic

# Athena libraries.  (-lXaw -lXmu)
LIBXAW = @XAW_LIBS@

# X extension library; needed for Athena and Motif >= 2.0.  (-lXext)
LIBXEXT = @XEXT_LIBS@

# Xpm library; needed for DDD and sometimes for Motif >= 2.0.  (-lXpm)
LIBXPM = @XPM_LIBS@

# Xp library; sometimes needed for Motif >= 2.1.  (-lXp)
LIBXP = @XP_LIBS@

# gen library; sometimes needed for Motif >= 2.0.  (-lgen)
LIBGEN = @LIBGEN@

# X toolkit library.  (-lXt)
LIBXT = @XT_LIBS@

# X library.  (-lSM -lICE -lX11 -lnsl -lsocket)
LIBX11 = @X_PRE_LIBS@ @X11_LIBS@ @X_EXTRA_LIBS@

# All libraries shown above
ALL_X_LIBS = $(X_LDFLAGS) $(LIBXM) $(LIBXP) $(LIBXPM) $(LIBXAW) $(LIBXEXT) \
$(LIBXT) $(LIBX11) $(LIBGEN)


## Installation commands.

# General install program.  (install -c)
INSTALL = @INSTALL@

# Command for installing programs.  (install -c)
INSTALL_PROGRAM = @INSTALL_PROGRAM@

# Command for installing data.  (install -c -m 644)
INSTALL_DATA = @INSTALL_DATA@

# Transformed name of installed programs.  (s,x,x,)
transform=@program_transform_name@


## `make check' commands.

# A debugger for debugging DDD.  (gdb)
DEBUGGER = @DEBUGGER@

# The options for DDD when invoking `make check'.  ()
DDD_OPTIONS = @DEBUGGER_OPTION@


## The following definitions are needed for development only.
## Usually, you don't need any of these.

# The autoconf program.  (autoconf)
AUTOCONF = @AUTOCONF@

# The autoheader program.  (autoheader)
AUTOHEADER = @AUTOHEADER@

# The aclocal program.  (aclocal)
ACLOCAL = @ACLOCAL@

# The tar program.  (tar)
TAR = @TAR@

# The groff program.  (groff)
GROFF = groff

# The nroff program.  (groff -Tascii)
# NROFF = nroff
NROFF = $(GROFF) -Tascii

# The makeinfo program.  (makeinfo)
MAKEINFO = @MAKEINFO@

# The texindex program.  (texindex)
TEXINDEX = texindex

# The texi2html program.  (texi2html)
TEXI2HTML = $(MAKEINFO) --html

# The texi2dvi program.  (texi2dvi)
TEXI2DVI = texi2dvi

# The texi2pdf program.  (texi2pdf)
TEXI2PDF = texi2dvi --pdf

# The epstopdf program.  (epstopdf)
# Available from http://www.tug.org/applications/pdftex/epstopdf
EPSTOPDF = epstopdf

# The dvips program.  (dvips)
DVIPS = @DVIPS@

# The pdf2ps program.  (pdf2ps)
PDF2PS = @PDF2PS@

# The TeX program.  (tex)
TEX = tex

# The ad2c program.
AD2C = $(SED) -n -f $(srcdir)/ad2c.sed

# The vsl2c program.
VSL2C = $(SED) -f $(srcdir)/vsl2c.sed

# The ls program.  (ls)
LS = ls

# The head program.  (head)
HEAD = head

# The make program, if not predefined.  ()
@SET_MAKE@

# The mv command.  (mv)
MV = mv

# The echo command.  (echo)
ECHO = echo

# The awk command.  (awk)
AWK = @AWK@

# The cat command.  (cat)
CAT = cat

# The cmp command.  (cmp)
CMP = cmp

# The grep command.  (grep)
GREP = grep

# The sort command.  (sort)
SORT = sort

# The diff command.  (diff)
DIFF = @DIFF@

# The touch command.  (touch)
TOUCH = touch

# The date command.  (date)
DATE = date

# The strip command.  (strip)
STRIP = strip

# The mkdir and rmdir commands.  (mkdir) (rmdir)
MKDIR = mkdir
RMDIR = rmdir

# The sleep command.  (sleep)
SLEEP = sleep

# The fig2dev command.  (fig2dev)
FIG2DEV = fig2dev
FIG2PS = $(FIG2DEV) -L ps

# Some XPM/PPM/PostScript converters, from the netpbm and pbmplus packages.
PBMTOXBM   = pbmtoxbm
PGMENHANCE = pgmenhance
PGMTOPBM   = pgmtopbm
PNMARITH   = pnmarith
PNMCUT     = pnmcut
PNMDEPTH   = pnmdepth
PNMGAMMA   = pnmgamma
PNMINVERT  = pnminvert
PNMMARGIN  = pnmmargin
PNMPASTE   = pnmpaste
PNMTOPS    = pnmtops
PPMTOPGM   = ppmtopgm
PPMTOXPM   = ppmtoxpm
XBMTOPBM   = xbmtopbm
XPMTOPPM   = xpmtoppm

# The ImageMagick `convert' program (convert)
CONVERT    = convert

# The image extension (.jpg, .png, or .gif)
IMGEXT     = .jpg

# The face-generating program from the `compface' package.  (xbm2xface.pl)
XBM2XFACE  = xbm2xface.pl


### END OF CUSTOMIZATION SECTION ---
### You shouldn't need to change anything below this line.


## The names.
# Program and distribution base name.  (ddd)
ddd = @ddd@

# Product name.  (DDD)
DDD = @DDD@

# The version number.  (1.4c)
VERSION = @VERSION@

# The build.  (This must be set from outside)
REL = 1

# Canonical program and distribution base name.
ddd_canonical = $(ddd)-$(VERSION)-$(target_canonical)

## More compilation settings.
# C++ binding flags. For binary distribution only.
# CXXSTATIC_BINDING = -Bstatic
CXXSTATIC_BINDING = @CXXSTATIC_BINDING@
# CXXDYNAMIC_BINDING = -Bdynamic
CXXDYNAMIC_BINDING = @CXXDYNAMIC_BINDING@
CXXBINDING = 

## C++ compile commands.
COMPILE.cc = $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(CXXSTUFF) -c
LINK.cc = $(CXX) $(CXXBINDING) $(LDFLAGS)
COMPILE_AND_LINK.cc = \
    $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(CXXSTUFF) $(CXXBINDING) $(LDFLAGS)

## C compile commands.
COMPILE.c = $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
LINK.c = $(CC) $(LDFLAGS)
COMPILE_AND_LINK.c = \
    $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(LDFLAGS)

## Pascal compile commands.
COMPILE_AND_LINK.p = $(PC) $(CPPFLAGS) $(DEFS) $(PFLAGS)
COMPILE.p = $(COMPILE_AND_LINK.p) -c
LINK.p = $(PC)

## Modula-2 compile commands.
COMPILE_AND_LINK.m2 = $(M2C) $(M2FLAGS)
COMPILE.m2 = $(COMPILE_AND_LINK.m2) -c
LINK.m2 = $(M2C)

## FORTRAN compile commands.
COMPILE_AND_LINK.f = $(FC) $(FFLAGS)
COMPILE.f = $(COMPILE_AND_LINK.f) -c
LINK.f = $(FC)

## YACC commands.
YY = yy
YACCTOCXX = $(srcdir)/yacctoC
YACC.Y = $(YACC) $(YFLAGS)

## LEX commands.
LEXTOCXX = $(srcdir)/lextoC
LEX.L = $(LEX) $(LFLAGS)

## Where to look for X include files.  (-I/usr/X11R5/include)
X_INCLUDE = @X_CFLAGS@

## Where to look for include files.
INCLUDE = -I. -I$(srcdir) -I$(srcdir)/.. $(X_INCLUDE)

## Implicit rules.
.SUFFIXES: .C .cc .c .mod .p .Y .YY .L .txt .i .xbm .xbmxx .xpm .xpmxx \
	   .xface .C~ .c~ .f .f~ .sh .sh~ .fig .eps .jpg .png .gif .pdf \
	   $(IMGEXT)
.C.$(OBJEXT):
	$(COMPILE.cc) $(INCLUDE) -o $@ $<
.cc.$(OBJEXT):
	$(COMPILE.cc) $(INCLUDE) -o $@ $<
.c.$(OBJEXT):
	$(COMPILE.c) $(INCLUDE) -o $@ $<
.p.$(OBJEXT):
	$(COMPILE.p) -o $@ $<
.C.i:
	$(COMPILE.cc) $(INCLUDE) -E -o $@ $<
.cc.i:
	$(COMPILE.cc) $(INCLUDE) -E -o $@ $<
.c.i:
	$(COMPILE.c) $(INCLUDE) -E -o $@ $<
.p.i:
	$(COMPILE.p) -E -o $@ $<
.Y:
	$(YACC.Y) $<
	$(SHELL) $(YACCTOCXX)
	$(RM) y.tab.c y.tab.h
	$(LINK.cc) -o $@ y.tab.C $(LDLIBS)
	$(RM) y.tab.C y.tab.H
.Y.C:
	$(YACC) $(YFLAGS) $<
	$(SHELL) $(YACCTOCXX)
	$(MV) y.tab.C $@
	$(RM) y.tab.H y.tab.c y.tab.h
.Y.h:
	$(YACC) -d $(YFLAGS) $<
	$(SHELL) $(YACCTOCXX)
	$(MV) y.tab.H $@
	$(RM) y.tab.C y.tab.c y.tab.h
.Y.$(OBJEXT):
	$(YACC) $(YFLAGS) $<
	$(SHELL) $(YACCTOCXX)
	$(COMPILE.cc) y.tab.C
	$(RM) y.tab.C y.tab.H y.tab.c y.tab.h
.Y.YY:
	$(YACC) -v $(YFLAGS) $<
	$(MV) y.output $@
	$(RM) y.tab.c y.tab.h
.L:
	$(LEX.L) $<
	$(SHELL) $(LEXTOCXX)
	$(LINK.cc) -o $@ $(LEX_OUTPUT_ROOT).C $(LDLIBS)
	$(RM) $(LEX_OUTPUT_ROOT).C $(LEX_OUTPUT_ROOT).c
.L.C:
	$(LEX.L) $<
	$(SHELL) $(LEXTOCXX)
	$(MV) $(LEX_OUTPUT_ROOT).C $@
	$(RM) $(LEX_OUTPUT_ROOT).c
.L.$(OBJEXT):
	$(LEX.L) $<
	$(SHELL) $(LEXTOCXX)
	$(COMPILE.cc) -o $@ $(LEX_OUTPUT_ROOT).C
	$(RM) $(LEX_OUTPUT_ROOT).C $(LEX_OUTPUT_ROOT).c


# Jacek M. Holeczek <holeczek@heracles.cto.us.edu.pl> says these `dummy'
# rules are required to disable default rules under AIX MAKE.  They
# should do no harm using other MAKEs.
.C:
.C~:
.c:
.c~:
.f:
.f~:
.sh:
.sh~:


## Script rules
.txt.C:
	@$(ECHO) "Creating $@"
	@( \
	$(ECHO) '// $@ -- generated automatically from `$<'"'."; \
	$(SED) '/^ *#/d' $< | \
	$(SED) 's/^ *include \([^"][^.]*\)\..*$$/#include "\1.C"/' | \
	$(SED) 's/^ *include "\([^"][^.]*\)[^"]*"/#include "\1.C"/' | \
	$(SED) '/^[^#]/s/\(["'"'"'\\]\)/\\\1/g' | \
	$(SED) '/^[^#]/s/.*/"&\\n"/' | \
	$(SED) 's//\\b/g' | \
	$(SED) 's/^$$/"\\n"/' \
	) > tmp.C; \
	$(CPP) -C -P -undef $(CPPFLAGS) $(DEFS) $(INCLUDE) tmp.C > $@; \
	$(RM) tmp.C

## Icon rules
.xpm.xbm:
	@$(ECHO) "Creating $@"
	@-base=`$(ECHO) $@ | $(SED) 's,.*/,,' | $(SED) 's/[.]x[bp]m.*//'`; \
	$(SED) 's/[	 ][cg]4*[ 	][#a-zA-Z0-9][#a-zA-Z0-9]*//g' $< | \
	$(SED) 's/[nN]one/white/g' | \
	$(XPMTOPPM) | $(PNMDEPTH) 255 | $(PPMTOPGM) | $(PGMTOPBM) | \
	$(PBMTOXBM) | $(SED) "s/noname/$${base}/g" | \
	$(SED) "s/static char/static unsigned char/g" > $@~
	@test -s $@~ && $(MV) $@~ $@ || ($(RM) $@~; test -s $@)

.xbm.xface:
	@$(ECHO) "Creating $@"
	@$(ECHO) "X-Face:`$(XBM2XFACE) $<`" > $@~
	@test -s $@~ && $(MV) $@~ $@ || ($(RM) $@~; test -s $@)

# This jewel makes an `emboss' effect in two steps:
# 1. Create a displaced mask in FILE-mask.pbm, using `pnmcut' and `pnmpaste'
# 2. Add the mask to FILE.xbm, using `pnmarith'.
.xbm.xpmxx:
	@$(ECHO) "Creating $@"
	@-base=`$(ECHO) $@ | $(SED) 's,.*/,,' | $(SED) 's/[.]x[bp]m.*//'`; \
	$(SED) 's/unsigned //' $< | \
	$(XBMTOPBM) > $${base}-object.pbm; \
	$(PNMMARGIN) 1 $${base}-object.pbm | \
	$(PNMCUT) 0 0 29 25 | \
	$(PNMINVERT) | \
	$(PNMPASTE) -and $${base}-object.pbm 0 0 > $${base}-mask.pbm; \
	$(PPMTOXPM) $${base}-object.pbm | \
	$(SED) 's/#00*/grey50/' | \
	$(SED) 's/#FF*/grey/' | \
	$(XPMTOPPM) > $${base}-button.ppm; \
	$(PNMARITH) -add $${base}-button.ppm $${base}-mask.pbm | \
	$(PPMTOXPM) | \
	$(SED) 's/c #BE[BE]*/c none   g none   m none  s Background/' | \
	$(SED) 's/c #7F[7F]*/c grey50 g grey50 m black/' | \
	$(SED) 's/c #FF*/c white  g white  m white/' | \
	$(SED) "s/noname/$${base}_xx_xpm/" > $@~; \
	$(RM) $${base}-object.pbm $${base}-mask.pbm $${base}-button.ppm
	@test -s $@~ && $(MV) $@~ $@ || ($(RM) $@~; test -s $@)

.xpm.xbmxx:
	@$(ECHO) "Creating $@"
	@-base=`$(ECHO) $@ | $(SED) 's,.*/,,' | $(SED) 's/[.]x[bp]m.*//'`; \
	$(SED) 's/[ 	]c[	 ][#a-zA-Z0-9][#a-zA-Z0-9]*//' $< | \
	$(SED) 's/ g black  / g grey50 /' | \
	$(SED) 's/ g white  / g grey75 /' | \
	$(SED) 's/g \([a-zA-Z0-9]*\) /c \1 g \1 /' | \
	$(SED) 's/[nN]one/white/g' | \
	$(XPMTOPPM) | $(PNMDEPTH) 255 | $(PPMTOPGM) | $(PGMTOPBM) | \
	$(PBMTOXBM) | $(SED) "s/noname/$${base}_xx/" | \
	$(SED) "s/static char/static unsigned char/g" > $@~
	@test -s $@~ && $(MV) $@~ $@ || ($(RM) $@~; test -s $@)

## Picture conversions

# Width of image in HTML manual (pixels)
IMAGE_WIDTH = 600

# We use giftoppm/ppmtogif to get optimal GIF compression.
.eps.gif:
	$(CONVERT) -geometry $(IMAGE_WIDTH) $< $@

.eps.jpg:
	$(CONVERT) -geometry $(IMAGE_WIDTH) -quality 100 $< $@

.eps.png:
	$(CONVERT) -geometry $(IMAGE_WIDTH) -quality 100 $< $@

.eps.pdf:
	$(EPSTOPDF) $< --outfile=$@

.fig.eps:
	(cd `dirname $<` && $(FIG2PS) `basename $<` ) > $@


## Libraries and object files
# General-purpose utilities: strings, regexps, run-type type info...
BASE_OBJECTS = \
	basename.$(OBJEXT)   \
	compare.$(OBJEXT)    \
	cook.$(OBJEXT)       \
	cwd.$(OBJEXT)        \
	glob.$(OBJEXT)       \
	hash.$(OBJEXT)       \
	home.$(OBJEXT)       \
	rxclass.$(OBJEXT)    \
	sigName.$(OBJEXT)    \
	strclass.$(OBJEXT)   \
	tabs.$(OBJEXT)       \
	uniquify.$(OBJEXT)   \
	PrintGC.$(OBJEXT)    \
	SignalB.$(OBJEXT)    \
	TypeInfo.$(OBJEXT)   \
	UniqueId.$(OBJEXT)   \
	MemCheck.$(OBJEXT)

# Instantiated templates
TEMPLATE_OBJECTS = \
	IntIntAA.$(OBJEXT)   \
	StatArray.$(OBJEXT)  \
	StringA.$(OBJEXT)    \
	StringMap.$(OBJEXT)  \
	StringSA.$(OBJEXT)   \
	StringSAA.$(OBJEXT)  \
	VoidArray.$(OBJEXT)  \
	WidgetSA.$(OBJEXT)

# Interprocess communication
# Top-level class is `Agent', declared in `Agent.h'
AGENT_OBJECTS = \
	Agent.$(OBJEXT)      \
	AgentM.$(OBJEXT)     \
	AsyncAgent.$(OBJEXT) \
	ChunkQueue.$(OBJEXT) \
	DataLength.$(OBJEXT) \
	HandlerL.$(OBJEXT)   \
	LiterateA.$(OBJEXT)  \
	ReadLineA.$(OBJEXT)  \
	TimeOut.$(OBJEXT)    \
	TTYAgent.$(OBJEXT)

# Miscellaneous utilities for X programs: Motif strings, hourglasses,
# context-sensitive help...
XSTUFF_OBJECTS = \
	charsets.$(OBJEXT)   \
	converters.$(OBJEXT) \
	events.$(OBJEXT)     \
	findParent.$(OBJEXT) \
	findWindow.$(OBJEXT) \
	fileSBF.$(OBJEXT)    \
	frame.$(OBJEXT)      \
	longName.$(OBJEXT)   \
	selection.$(OBJEXT)  \
	verify.$(OBJEXT)     \
	AutoRaise.$(OBJEXT)  \
	Delay.$(OBJEXT)      \
	DestroyCB.$(OBJEXT)  \
	ExitCB.$(OBJEXT)     \
	InitImage.$(OBJEXT)  \
	Swallower.$(OBJEXT)  \
	XErrorB.$(OBJEXT)

# Same, but for Motif
MSTUFF_OBJECTS = \
	freeXmST.$(OBJEXT)   \
	LabelH.$(OBJEXT)     \
	LessTifH.$(OBJEXT)   \
	MakeMenu.$(OBJEXT)   \
	MString.$(OBJEXT)    \
	ComboBox.$(OBJEXT)   \
	SpinBox.$(OBJEXT)    \
	TextSetS.$(OBJEXT)

# Box library - rectangular composible graphical items
# Top-level class is `Box', declared in `Box.h'
BOX_OBJECTS = \
	printBox.$(OBJEXT)   \
	AlignBox.$(OBJEXT)   \
	ArcBox.$(OBJEXT)     \
	BinBox.$(OBJEXT)     \
	Box.$(OBJEXT)        \
	BoxD.$(OBJEXT)       \
	BoxExtend.$(OBJEXT)  \
	BoxPoint.$(OBJEXT)   \
	BoxRegion.$(OBJEXT)  \
	BoxSize.$(OBJEXT)    \
	ColorBox.$(OBJEXT)   \
	CompositeB.$(OBJEXT) \
	DiagBox.$(OBJEXT)    \
	DummyBox.$(OBJEXT)   \
	FixBox.$(OBJEXT)     \
	FontFixBox.$(OBJEXT) \
	FontTable.$(OBJEXT)  \
	HatBox.$(OBJEXT)     \
	LineBox.$(OBJEXT)    \
	ListBox.$(OBJEXT)    \
	MarkBox.$(OBJEXT)    \
	MatchBox.$(OBJEXT)   \
	PrimitiveB.$(OBJEXT) \
	SlopeBox.$(OBJEXT)   \
	StringBox.$(OBJEXT)  \
	THatBox.$(OBJEXT)    \
	TagBox.$(OBJEXT)     \
	TrueBox.$(OBJEXT)

# VSL library - building boxes from structured data
# Top-level class is `VSLLib', declared in `VSLLib.h'
VSL_OBJECTS = \
	ArgNode.$(OBJEXT)    \
	BuiltinCN.$(OBJEXT)  \
	CallNode.$(OBJEXT)   \
	ConstNode.$(OBJEXT)  \
	DefCallN.$(OBJEXT)   \
	DummyNode.$(OBJEXT)  \
	LetNode.$(OBJEXT)    \
	NameNode.$(OBJEXT)   \
	ListNode.$(OBJEXT)   \
	TestNode.$(OBJEXT)   \
	ThemeVSLL.$(OBJEXT)  \
	TrueNode.$(OBJEXT)   \
	VSEFlags.$(OBJEXT)   \
	VSLArgList.$(OBJEXT) \
	VSLBuiltin.$(OBJEXT) \
	VSLDef.$(OBJEXT)     \
	VSLDefList.$(OBJEXT) \
        VSLErr.$(OBJEXT)     \
	VSLLib.$(OBJEXT)     \
	VSLNode.$(OBJEXT)    \
        VSLRead.$(OBJEXT)

# Graph structure, graph layout and graph editor widget
# Top-level classes are `Graph', declared in `Graph.h'
# and the `GraphEdit' widget, deckared in `GraphEdit.h'.
GRAPH_OBJECTS = \
	ArcGraphE.$(OBJEXT)  \
	BoxEdgeA.$(OBJEXT)   \
	BoxGraphN.$(OBJEXT)  \
	EdgeA.$(OBJEXT)      \
	EdgeAPA.$(OBJEXT)    \
	Graph.$(OBJEXT)      \
	GraphEdge.$(OBJEXT)  \
	GraphEdit.$(OBJEXT)  \
	GraphGC.$(OBJEXT)    \
	GraphNode.$(OBJEXT)  \
	GraphNPA.$(OBJEXT)   \
	HintGraphN.$(OBJEXT) \
	LineGraphE.$(OBJEXT) \
	LineGESI.$(OBJEXT)   \
	PannedGE.$(OBJEXT)   \
	PosGraphN.$(OBJEXT)  \
	RegionGN.$(OBJEXT)   \
	ScrolledGE.$(OBJEXT) \
	layout.$(OBJEXT)

# All these objects were originally part of the NORA library; they are
# now maintained as part of DDD.
LIB_OBJECTS = \
	$(BASE_OBJECTS)   \
	$(TEMPLATE_OBJECTS)  \
	$(AGENT_OBJECTS)  \
	$(XSTUFF_OBJECTS) \
	$(MSTUFF_OBJECTS) \
	$(BOX_OBJECTS)    \
	$(VSL_OBJECTS)    \
	$(GRAPH_OBJECTS)

# The DDD application itself.  `ddd.C' is the main program, `SourceView.C'
# is the source window, `DataDisp.C' is the data window.
DDD_OBJECTS = \
	annotation.$(OBJEXT) \
	args.$(OBJEXT)       \
	buttons.$(OBJEXT)    \
	cmdtty.$(OBJEXT)     \
	comm-manag.$(OBJEXT) \
	complete.$(OBJEXT)   \
	ctrl.$(OBJEXT)       \
	data.$(OBJEXT)       \
	dbx-lookup.$(OBJEXT) \
	decoration.$(OBJEXT) \
	deref.$(OBJEXT)      \
	disp-read.$(OBJEXT)  \
	editing.$(OBJEXT)    \
	environ.$(OBJEXT)    \
	examine.$(OBJEXT)    \
	exectty.$(OBJEXT)    \
	exit.$(OBJEXT)       \
	expired.$(OBJEXT)    \
	file.$(OBJEXT)       \
	filetype.$(OBJEXT)   \
	fonts.$(OBJEXT)      \
	fortranize.$(OBJEXT) \
	gdbinit.$(OBJEXT)    \
	history.$(OBJEXT)    \
	hostname.$(OBJEXT)   \
	index.$(OBJEXT)      \
	isid.$(OBJEXT)       \
	java.$(OBJEXT) 	     \
	logo.$(OBJEXT)       \
	logplayer.$(OBJEXT)  \
	mainloop.$(OBJEXT)   \
	mydialogs.$(OBJEXT)  \
	options.$(OBJEXT)    \
	plotter.$(OBJEXT)    \
	post.$(OBJEXT)       \
	print.$(OBJEXT)      \
	question.$(OBJEXT)   \
	regexps.$(OBJEXT)    \
	resources.$(OBJEXT)  \
	sashes.$(OBJEXT)     \
	select.$(OBJEXT)     \
	session.$(OBJEXT)    \
	settings.$(OBJEXT)   \
	shell.$(OBJEXT)      \
	shorten.$(OBJEXT)    \
	show.$(OBJEXT)       \
	simpleMenu.$(OBJEXT) \
	configinfo.$(OBJEXT) \
	source.$(OBJEXT)     \
	status.$(OBJEXT)     \
	string-fun.$(OBJEXT) \
	tictactoe.$(OBJEXT)  \
	tips.$(OBJEXT)       \
	toolbar.$(OBJEXT)    \
	ungrab.$(OBJEXT)     \
	value-read.$(OBJEXT) \
	vsldoc.$(OBJEXT)     \
	windows.$(OBJEXT)    \
	wm.$(OBJEXT)         \
	xconfig.$(OBJEXT)    \
	AliasGE.$(OBJEXT)    \
	ArgField.$(OBJEXT)   \
	BreakPoint.$(OBJEXT) \
	BreakPM.$(OBJEXT)    \
	CodeCache.$(OBJEXT)  \
	Command.$(OBJEXT)    \
	DataDisp.$(OBJEXT)   \
	DispBox.$(OBJEXT)    \
	DispBuffer.$(OBJEXT) \
	DispGraph.$(OBJEXT)  \
	DispNode.$(OBJEXT)   \
	DispNodeM.$(OBJEXT)  \
	DispValue.$(OBJEXT)  \
	DispValueA.$(OBJEXT) \
	DispValueT.$(OBJEXT) \
	EntryType.$(OBJEXT)  \
	GDBAgent.$(OBJEXT)   \
	HelpCB.$(OBJEXT)     \
	HistoryD.$(OBJEXT)   \
	HistoryF.$(OBJEXT)   \
	MinMaxA.$(OBJEXT)    \
	PlotAgent.$(OBJEXT)  \
	PlotArea.$(OBJEXT)   \
	PosBuffer.$(OBJEXT)  \
	ProgressM.$(OBJEXT)  \
	RefreshDI.$(OBJEXT)  \
	SmartC.$(OBJEXT)     \
	SourceView.$(OBJEXT) \
	StringTPA.$(OBJEXT)  \
	ThemeM.$(OBJEXT)     \
	ThemeP.$(OBJEXT)     \
	Tool.$(OBJEXT)       \
	UndoBuffer.$(OBJEXT) \
	UndoBE.$(OBJEXT)     \
	WhatNextCB.$(OBJEXT)

# Objects required for userinfo
USERINFO_OBJECTS =

# Objects required for huffencode and huffdecode
HUFFMAN_OBJECTS = strclass.$(OBJEXT) cook.$(OBJEXT) rxclass.$(OBJEXT)

## All objects.
OBJECTS = $(LIB_OBJECTS) $(DDD_OBJECTS)

## The program files.
# We use `./ddd' to prevent Solaris VPATH-enabled make from selecting
# the `ddd' directory instead.
PROGS = $(ddd_canonical)$(EXEEXT) ./$(ddd)$(EXEEXT)

## The program files to be installed.
INSTALL_PROGS = ./$(ddd)$(EXEEXT)

## Extra demonstration files.
DEMOS = userinfo$(EXEEXT) stringify$(EXEEXT) huffencode$(EXEEXT) \
	huffdecode$(EXEEXT) cxxtest$(EXEEXT) ctest$(EXEEXT) grabtest$(EXEEXT) \
	ftest$(EXEEXT) ptest$(EXEEXT) m2test$(EXEEXT) \
	test-file$(EXEEXT) test-graph$(EXEEXT) vsl$(EXEEXT) ttytest$(EXEEXT) \
	bug$(EXEEXT) sample$(EXEEXT) tString$(EXEEXT) \
	mmtest$(EXEEXT) gcore$(EXEEXT) logplayer$(EXEEXT)


## Documentation.
## The index files.
IDXS = *.cp *.fn *.ky *.pg *.tp *.vr

## The dvi files.
docdir = $(srcdir)/../doc
DVIS = 	ddd.dvi

## The postscript files.
PSS = $(docdir)/ddd.ps

## The PDF files.
PDFS = $(docdir)/ddd.pdf

## The HTML files.
htmldir = $(docdir)/html
HTMLS = $(htmldir)/index.html $(docdir)/sample.c

## The info files.
INFO = $(docdir)/ddd.info
INFOS = $(docdir)/ddd.info*

## PostScript pictures in the DDD manual.
# All of these are generated from FIG and XPM files.
picdir = $(srcdir)/PICS
PS_IMAGES = \
	$(picdir)/disclaimer.eps           \
	$(picdir)/dddlogo.eps		   \
	$(picdir)/dddsplash.eps            \
	$(picdir)/ddd-aliases.eps          \
	$(picdir)/ddd-all.eps              \
	$(picdir)/ddd-arguments.eps        \
	$(picdir)/ddd-attach.eps           \
	$(picdir)/ddd-backtrace.eps	   \
	$(picdir)/ddd-bp-popup.eps         \
	$(picdir)/ddd-bp-properties.eps    \
	$(picdir)/ddd-button-editor.eps    \
	$(picdir)/ddd-clusters.eps         \
	$(picdir)/ddd-code.eps             \
	$(picdir)/ddd-console.eps          \
	$(picdir)/ddd-data-prefs.eps       \
	$(picdir)/ddd-define-command.eps   \
	$(picdir)/ddd-display.eps          \
	$(picdir)/ddd-drag.eps             \
	$(picdir)/ddd-edit-breakpoints.eps \
	$(picdir)/ddd-edit-displays.eps    \
	$(picdir)/ddd-examine.eps          \
	$(picdir)/ddd-font-prefs.eps       \
	$(picdir)/ddd-general-prefs.eps    \
	$(picdir)/ddd-helpers.eps  	   \
	$(picdir)/ddd-hide-display.eps     \
	$(picdir)/ddd-history.eps          \
	$(picdir)/ddd-layout.eps           \
	$(picdir)/ddd-line-popup.eps       \
	$(picdir)/ddd-locals.eps	   \
	$(picdir)/ddd-open.eps             \
	$(picdir)/ddd-open-session.eps     \
	$(picdir)/ddd-plots.eps            \
	$(picdir)/ddd-print-graph.eps      \
	$(picdir)/ddd-print-output.eps     \
	$(picdir)/ddd-print-popup.eps      \
	$(picdir)/ddd-registers.eps        \
	$(picdir)/ddd-repeats.eps          \
	$(picdir)/ddd-rotate-display.eps   \
	$(picdir)/ddd-save-session.eps     \
	$(picdir)/ddd-select-display.eps   \
	$(picdir)/ddd-separate.eps         \
	$(picdir)/ddd-set.eps	           \
	$(picdir)/ddd-settings.eps         \
	$(picdir)/ddd-shortcuts.eps        \
	$(picdir)/ddd-shortcut-editor.eps  \
	$(picdir)/ddd-signals.eps          \
	$(picdir)/ddd-source-popup.eps     \
	$(picdir)/ddd-source-prefs.eps     \
	$(picdir)/ddd-source.eps           \
	$(picdir)/ddd-startup-prefs.eps    \
	$(picdir)/ddd-status-displays.eps  \
	$(picdir)/ddd-threads.eps          \
	$(picdir)/ddd-tool.eps             \
	$(picdir)/ddd-toolbar.eps          \
	$(picdir)/ddd-toolbars.eps         \
	$(picdir)/ddd-value-tip.eps        \
	$(picdir)/tut-backtrace.eps        \
	$(picdir)/tut-display.eps          \
	$(picdir)/tut-finish.eps           \
	$(picdir)/tut-invoke.eps           \
	$(picdir)/tut-run.eps              \
	$(picdir)/tut-set.eps              \
	$(picdir)/tut-value.eps

PDF_IMAGES = \
	$(picdir)/disclaimer.pdf           \
	$(picdir)/dddback.pdf		   \
	$(picdir)/dddlogo.pdf              \
	$(picdir)/dddsplash.pdf            \
	$(picdir)/ddd-aliases.pdf          \
	$(picdir)/ddd-all.pdf              \
	$(picdir)/ddd-arguments.pdf        \
	$(picdir)/ddd-attach.pdf           \
	$(picdir)/ddd-backtrace.pdf	   \
	$(picdir)/ddd-bp-popup.pdf         \
	$(picdir)/ddd-bp-properties.pdf    \
	$(picdir)/ddd-button-editor.pdf    \
	$(picdir)/ddd-clusters.pdf         \
	$(picdir)/ddd-code.pdf             \
	$(picdir)/ddd-console.pdf          \
	$(picdir)/ddd-data-prefs.pdf       \
	$(picdir)/ddd-define-command.pdf   \
	$(picdir)/ddd-display.pdf          \
	$(picdir)/ddd-drag.pdf             \
	$(picdir)/ddd-edit-breakpoints.pdf \
	$(picdir)/ddd-edit-displays.pdf    \
	$(picdir)/ddd-examine.pdf          \
	$(picdir)/ddd-font-prefs.pdf       \
	$(picdir)/ddd-general-prefs.pdf    \
	$(picdir)/ddd-helpers.pdf  	   \
	$(picdir)/ddd-hide-display.pdf     \
	$(picdir)/ddd-history.pdf          \
	$(picdir)/ddd-layout.pdf           \
	$(picdir)/ddd-line-popup.pdf       \
	$(picdir)/ddd-locals.pdf	   \
	$(picdir)/ddd-open.pdf             \
	$(picdir)/ddd-open-session.pdf     \
	$(picdir)/ddd-plots.pdf            \
	$(picdir)/ddd-print-graph.pdf      \
	$(picdir)/ddd-print-output.pdf     \
	$(picdir)/ddd-print-popup.pdf      \
	$(picdir)/ddd-registers.pdf        \
	$(picdir)/ddd-repeats.pdf          \
	$(picdir)/ddd-rotate-display.pdf   \
	$(picdir)/ddd-save-session.pdf     \
	$(picdir)/ddd-select-display.pdf   \
	$(picdir)/ddd-separate.pdf         \
	$(picdir)/ddd-set.pdf	           \
	$(picdir)/ddd-settings.pdf         \
	$(picdir)/ddd-shortcuts.pdf        \
	$(picdir)/ddd-shortcut-editor.pdf  \
	$(picdir)/ddd-signals.pdf          \
	$(picdir)/ddd-source-popup.pdf     \
	$(picdir)/ddd-source-prefs.pdf     \
	$(picdir)/ddd-source.pdf           \
	$(picdir)/ddd-startup-prefs.pdf    \
	$(picdir)/ddd-status-displays.pdf  \
	$(picdir)/ddd-threads.pdf          \
	$(picdir)/ddd-tool.pdf             \
	$(picdir)/ddd-toolbar.pdf          \
	$(picdir)/ddd-toolbars.pdf         \
	$(picdir)/ddd-value-tip.pdf        \
	$(picdir)/tut-backtrace.pdf        \
	$(picdir)/tut-display.pdf          \
	$(picdir)/tut-finish.pdf           \
	$(picdir)/tut-invoke.pdf           \
	$(picdir)/tut-run.pdf              \
	$(picdir)/tut-set.pdf              \
	$(picdir)/tut-value.pdf

HTML_IMAGES = \
	$(picdir)/disclaimer$(IMGEXT)           \
	$(picdir)/dddback$(IMGEXT)		\
	$(picdir)/dddlogo$(IMGEXT)              \
	$(picdir)/dddsplash$(IMGEXT)            \
	$(picdir)/ddd-aliases$(IMGEXT)          \
	$(picdir)/ddd-all$(IMGEXT)              \
	$(picdir)/ddd-arguments$(IMGEXT)        \
	$(picdir)/ddd-attach$(IMGEXT)           \
	$(picdir)/ddd-backtrace$(IMGEXT)	\
	$(picdir)/ddd-bp-popup$(IMGEXT)         \
	$(picdir)/ddd-bp-properties$(IMGEXT)    \
	$(picdir)/ddd-button-editor$(IMGEXT)    \
	$(picdir)/ddd-clusters$(IMGEXT)         \
	$(picdir)/ddd-code$(IMGEXT)             \
	$(picdir)/ddd-console$(IMGEXT)          \
	$(picdir)/ddd-data-prefs$(IMGEXT)       \
	$(picdir)/ddd-define-command$(IMGEXT)   \
	$(picdir)/ddd-display$(IMGEXT)          \
	$(picdir)/ddd-drag$(IMGEXT)             \
	$(picdir)/ddd-edit-breakpoints$(IMGEXT) \
	$(picdir)/ddd-edit-displays$(IMGEXT)    \
	$(picdir)/ddd-examine$(IMGEXT)          \
	$(picdir)/ddd-font-prefs$(IMGEXT)       \
	$(picdir)/ddd-general-prefs$(IMGEXT)    \
	$(picdir)/ddd-helpers$(IMGEXT)  	\
	$(picdir)/ddd-hide-display$(IMGEXT)     \
	$(picdir)/ddd-history$(IMGEXT)          \
	$(picdir)/ddd-layout$(IMGEXT)           \
	$(picdir)/ddd-line-popup$(IMGEXT)       \
	$(picdir)/ddd-locals$(IMGEXT)	        \
	$(picdir)/ddd-open$(IMGEXT)             \
	$(picdir)/ddd-open-session$(IMGEXT)     \
	$(picdir)/ddd-plots$(IMGEXT)            \
	$(picdir)/ddd-print-graph$(IMGEXT)      \
	$(picdir)/ddd-print-output$(IMGEXT)     \
	$(picdir)/ddd-print-popup$(IMGEXT)      \
	$(picdir)/ddd-registers$(IMGEXT)        \
	$(picdir)/ddd-repeats$(IMGEXT)          \
	$(picdir)/ddd-rotate-display$(IMGEXT)   \
	$(picdir)/ddd-save-session$(IMGEXT)     \
	$(picdir)/ddd-select-display$(IMGEXT)   \
	$(picdir)/ddd-separate$(IMGEXT)         \
	$(picdir)/ddd-set$(IMGEXT)	        \
	$(picdir)/ddd-settings$(IMGEXT)         \
	$(picdir)/ddd-shortcuts$(IMGEXT)        \
	$(picdir)/ddd-shortcut-editor$(IMGEXT)  \
	$(picdir)/ddd-signals$(IMGEXT)          \
	$(picdir)/ddd-source-popup$(IMGEXT)     \
	$(picdir)/ddd-source-prefs$(IMGEXT)     \
	$(picdir)/ddd-source$(IMGEXT)           \
	$(picdir)/ddd-startup-prefs$(IMGEXT)    \
	$(picdir)/ddd-status-displays$(IMGEXT)  \
	$(picdir)/ddd-threads$(IMGEXT)          \
	$(picdir)/ddd-tool$(IMGEXT)             \
	$(picdir)/ddd-toolbar$(IMGEXT)          \
	$(picdir)/ddd-toolbars$(IMGEXT)         \
	$(picdir)/ddd-value-tip$(IMGEXT)        \
	$(picdir)/tut-backtrace$(IMGEXT)        \
	$(picdir)/tut-display$(IMGEXT)          \
	$(picdir)/tut-finish$(IMGEXT)           \
	$(picdir)/tut-invoke$(IMGEXT)           \
	$(picdir)/tut-run$(IMGEXT)              \
	$(picdir)/tut-set$(IMGEXT)              \
	$(picdir)/tut-value$(IMGEXT)


## The manual page(s).
MANS = ddd.man

## The (derived) icons.
# Icon directories
icondir = $(srcdir)/../icons
toolbardir = $(icondir)/toolbar

# XBM icons are derived from XPM sources
XBM_ICONS = \
	$(toolbardir)/breakat.xbm \
	$(toolbardir)/clearat.xbm \
	$(toolbardir)/cluster.xbm \
	$(toolbardir)/delete.xbm \
	$(toolbardir)/deref.xbm \
	$(toolbardir)/disable.xbm \
	$(toolbardir)/display.xbm \
	$(toolbardir)/findbwd.xbm \
	$(toolbardir)/findfwd.xbm \
	$(toolbardir)/enable.xbm \
	$(toolbardir)/hide.xbm \
	$(toolbardir)/lookup.xbm \
	$(toolbardir)/maketemp.xbm \
	$(toolbardir)/newbreak.xbm \
	$(toolbardir)/newdisplay.xbm \
	$(toolbardir)/newwatch.xbm \
	$(toolbardir)/plot.xbm \
	$(toolbardir)/print.xbm \
	$(toolbardir)/properties.xbm \
	$(toolbardir)/rotate.xbm \
	$(toolbardir)/set.xbm \
	$(toolbardir)/show.xbm \
	$(toolbardir)/uncluster.xbm \
	$(toolbardir)/undisplay.xbm \
	$(toolbardir)/unwatch.xbm \
	$(toolbardir)/watch.xbm 

# XPMXX icons (insensitive XPM icons) are derived from XBM sources
XPM_XX_ICONS = \
	$(toolbardir)/breakat.xpmxx \
	$(toolbardir)/clearat.xpmxx \
	$(toolbardir)/cluster.xpmxx \
	$(toolbardir)/delete.xpmxx \
	$(toolbardir)/deref.xpmxx \
	$(toolbardir)/disable.xpmxx \
	$(toolbardir)/display.xpmxx \
	$(toolbardir)/findbwd.xpmxx \
	$(toolbardir)/findfwd.xpmxx \
	$(toolbardir)/enable.xpmxx \
	$(toolbardir)/hide.xpmxx \
	$(toolbardir)/lookup.xpmxx \
	$(toolbardir)/maketemp.xpmxx \
	$(toolbardir)/newbreak.xpmxx \
	$(toolbardir)/newdisplay.xpmxx \
	$(toolbardir)/newwatch.xpmxx \
	$(toolbardir)/plot.xpmxx \
	$(toolbardir)/print.xpmxx \
	$(toolbardir)/properties.xpmxx \
	$(toolbardir)/rotate.xpmxx \
	$(toolbardir)/set.xpmxx \
	$(toolbardir)/show.xpmxx \
	$(toolbardir)/uncluster.xpmxx \
	$(toolbardir)/undisplay.xpmxx \
	$(toolbardir)/unwatch.xpmxx \
	$(toolbardir)/watch.xpmxx 

# XBMXX icons (insensitive XBM icons) are derived from XPM sources
XBM_XX_ICONS = \
	$(toolbardir)/breakat.xbmxx \
	$(toolbardir)/clearat.xbmxx \
	$(toolbardir)/cluster.xbmxx \
	$(toolbardir)/delete.xbmxx \
	$(toolbardir)/deref.xbmxx \
	$(toolbardir)/disable.xbmxx \
	$(toolbardir)/display.xbmxx \
	$(toolbardir)/findbwd.xbmxx \
	$(toolbardir)/findfwd.xbmxx \
	$(toolbardir)/enable.xbmxx \
	$(toolbardir)/hide.xbmxx \
	$(toolbardir)/lookup.xbmxx \
	$(toolbardir)/maketemp.xbmxx \
	$(toolbardir)/newbreak.xbmxx \
	$(toolbardir)/newdisplay.xbmxx \
	$(toolbardir)/newwatch.xbmxx \
	$(toolbardir)/plot.xbmxx \
	$(toolbardir)/print.xbmxx \
	$(toolbardir)/properties.xbmxx \
	$(toolbardir)/rotate.xbmxx \
	$(toolbardir)/set.xbmxx \
	$(toolbardir)/show.xbmxx \
	$(toolbardir)/uncluster.xbmxx \
	$(toolbardir)/undisplay.xbmxx \
	$(toolbardir)/unwatch.xbmxx \
	$(toolbardir)/watch.xbmxx

# All derived icons
# Order is significant here!  First sources, then derived files.
ICONS = \
	$(icondir)/ddd.xbm \
	$(icondir)/dddmask.xbm \
	$(icondir)/dddsplash.xbm \
	$(icondir)/ddd.xface \
	$(XBM_ICONS) \
	$(XPM_XX_ICONS) \
	$(XBM_XX_ICONS)


## Readme files built from ddd.texi
README_FILES = 

## GDB symbol files
SYMS = $(ddd).syms $(ddd_canonical).syms


## Intermediate files

# Architecture-independent files required for building DDD.
# In a distribution, these should be already built.
#
# Order is significant here!  First source files, then derived files.
PROG_STUFF       = vsl-lex.C vsl-gramma.h vsl-gramma.C rxscan.C \
	 	   acconfig.h acspecial.h stamp-h.in config.h \
		   $(srcdir)/tips.m4 $(srcdir)/tips.html \
		   $(srcdir)/Ddd.in Ddd.ad.h host.h \
		   $(srcdir)/ddd.vsl $(srcdir)/ddd.vsl.h \
		   vr.h version.h bld.h build.h configinfo.C \
                   COPYING.gz.C NEWS.gz.C ddd.info.txt.gz.C \
                   xlibdir.C eps-code.h .gdbinit \
		   ../$(ddd)-$(VERSION)-$(REL).spec

# Extra files to be built for the distribution
# In a distribution, these should be already built.
DIST_STUFF	 = $(PROG_STUFF) $(MANS) $(PSS) $(PDFS) $(HTMLS) $(ICONS)

# Temporary Files to be cleaned, keeping configuration intact
CLEAN_STUFF	 = $(ddd)-$(VERSION)-* $(PROGS) $(DEMOS) \
		   core *.$(OBJEXT) *.a *.s *.i \
		   tmp* *.tmp .*hist* *.syms *.log dddgraph.* \
		   *.au *.aus *.aux *.cm *.cms *.cp *.cps *.en *.ens \
		   *.fl *.flc *.fls *.fn *.fns *.ky *.kys *.lb *.lbs \
		   *.log *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs \
		   *.info *.info-* *.html *.dvi *.pdf *.tmp \
		   gpl.texinfo lgpl.texinfo texinfo.tex epsf.tex xepsf.tex \
		   *.tar *.tar.gz *~ lex.* y.tab.* site.* *.sum \
		   *.diff *.private USERINFO *.huff.C \
		   *.txt.gz COPYING.gz NEWS.gz *.gz.C

# Architecture-dependent files to be deleted from distribution
DISTCLEAN_STUFF	 = $(CLEAN_STUFF) \
		   config.status config.h host.h paths.h \
		   Makefile MakeOut LOG OOBR OOBR-FTR TAGS \
		   config.log config.cache configinfo.C stamp-h \
		   Ddd Ddd.ad.h ddd.man-nopics \
		   $(PS_IMAGES) $(HTML_IMAGES) $(PDF_IMAGES)

# Any files that can be reconstructed, except configure script
REALCLEAN_STUFF	 = $(DISTCLEAN_STUFF) $(DIST_STUFF) \
		   header.str trailer.str eps-code.h \
		   vr.h bld.h cfg.texi $(MANS)

# All files that can be reconstructed (but may require special programs)
ULTRACLEAN_STUFF = $(REALCLEAN_STUFF) \
		   config.h.in stamp-h.in configure Makedeps \
		   $(README_FILES) $(docdir)/sample.c \
		   $(htmldir)/*.html $(htmldir)/PICS $(srcdir)/Ddd.in


## Targets as specified in GNU standards.
all:	ddd-message $(PROG_STUFF) $(PROGS) ddd-done
	@:
.PHONY: all

.PHONY: ddd-message
ddd-message:
	@$(ECHO) "Building $(ddd_canonical)..."

.PHONY: ddd-done
ddd-done: ./$(ddd)$(EXEEXT)
	@$(ECHO) "Building $(ddd_canonical)... done."
	@$(ECHO) "You may now type \`$(MAKE) check' for a test."

.PHONY: install
install: install-prog install-man install-info
	@:

.PHONY: install-strip
install-strip:
	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install

.PHONY: uninstall
uninstall: uninstall-prog uninstall-man uninstall-info
	@:

# install-prog does not depend on $(PROGS) 
# since we may have precompiled packages
.PHONY: install-prog
install-prog:
	-parent=`$(ECHO) $(bindir) | $(SED) -e 's@/[^/]*$$@@'`; \
	grandparent=`$(ECHO) $$parent | $(SED) -e 's@/[^/]*$$@@'`; \
	test -d $$grandparent || $(MKDIR) $$grandparent; \
	test -d $$parent || $(MKDIR) $$parent
	-test -d $(bindir) || $(MKDIR) $(bindir)
	for p in $(INSTALL_PROGS); do \
	    $(INSTALL_PROGRAM) \
		$$p $(bindir)/`$(ECHO) $$p | $(SED) '$(transform)'`; \
	done

.PHONY: uninstall-prog
uninstall-prog:
	for p in $(INSTALL_PROGS); do \
	    $(RM) $(bindir)/`$(ECHO) $$p | $(SED) '$(transform)'`; \
	done

.PHONY: install-info
install-info: $(INFO)
	-parent=`$(ECHO) $(infodir) | $(SED) -e 's@/[^/]*$$@@'`; \
	grandparent=`$(ECHO) $$parent | $(SED) -e 's@/[^/]*$$@@'`; \
	test -d $$grandparent || $(MKDIR) $$grandparent; \
	test -d $$parent || $(MKDIR) $$parent
	-test -d $(infodir) || $(MKDIR) $(infodir)
	cd $(infodir) && $(RM) $(INFOS)
	for i in $(INFOS); do \
	    test -s $$i && $(INSTALL_DATA) $$i $(infodir); \
	done

.PHONY: uninstall-info
uninstall-info:
	cd $(infodir); $(RM) $(INFOS)

.PHONY: install-man
install-man: ddd.1
	-parent=`$(ECHO) $(man1dir) | $(SED) -e 's@/[^/]*$$@@'`; \
	grandparent=`$(ECHO) $$parent | $(SED) -e 's@/[^/]*$$@@'`; \
	test -d $$grandparent || $(MKDIR) $$grandparent; \
	test -d $$parent || $(MKDIR) $$parent
	-test -d $(man1dir) || $(MKDIR) $(man1dir)
	test -f ddd.1 || cd $(srcdir); \
	$(INSTALL_DATA) ddd.1 \
		$(man1dir)/`$(ECHO) ddd$(man1ext) | $(SED) '$(transform)'`

.PHONY: uninstall-man
uninstall-man:
	$(RM) $(man1dir)/`$(ECHO) ddd$(man1ext) | $(SED) '$(transform)'`

.PHONY: picsclean
picsclean:
	$(RM) $(picdir)/*.gif $(picdir)/*.jpg $(picdir)/*.png
	$(RM) $(picdir)/*.eps
	-cd $(picdir) && $(RM) $(CLEAN_STUFF) ./#*#

.PHONY: iconclean
iconclean:
	$(RM) $(ICONS)
	-cd $(icondir) && $(RM) $(CLEAN_STUFF) ./#*#
	-cd $(toolbardir) && $(RM) $(CLEAN_STUFF) ./#*#

.PHONY: clean
clean:
	$(RM) $(CLEAN_STUFF) ./#*#
	-cd $(picdir) && $(RM) $(CLEAN_STUFF) ./#*#

.PHONY: distclean
distclean:
	$(RM) $(DISTCLEAN_STUFF) ./#*#

.PHONY: mostlyclean
mostlyclean: clean
	@:

.PHONY: realclean maintainer-clean
realclean maintainer-clean:
	@echo 'This command is intended for maintainers to use; it'
	@echo 'deletes files that may need special tools to rebuild.'
	$(RM) $(REALCLEAN_STUFF) ./#*#

.PHONY: ultraclean
ultraclean:
	@echo 'This command is intended for maintainers to use; it'
	@echo 'deletes files that may need special tools to rebuild.'
	$(RM) $(ULTRACLEAN_STUFF) ./#*#

.PHONY: info
info:	$(INFO)
	@:

.PHONY: tex dvi
tex dvi: $(DVIS)
	@:

.PHONY: ps
ps:	$(PSS)
	@:

.PHONY: pdf
pdf:	$(PDFS)
	@:

.PHONY: man
man:	$(MANS)
	@:

.PHONY: postscript
postscript: $(PSS)
	@:

.PHONY: html
html:	$(HTMLS)
	@:

.PHONY: readme
readme:	$(README_FILES)
	@:

.PHONY: diststuff
diststuff: $(DIST_STUFF)
	-for file in $(DIST_STUFF); do test -f $$file && $(TOUCH) $$file; done
	$(MAKE) depend

.PHONY: dist
dist:	
	@$(ECHO) see the top-level directory for making dist files.
	@false

.PHONY: strip
strip:	$(PROGS)
	-$(STRIP) $(PROGS)

.PHONY: progs programs
progs:	$(PROGS)
	@:
programs: $(PROGS)
	@:

.PHONY: demos
demos:	$(DEMOS)
	@:


## A TECO-ism: `make love'

.PHONY: love
love:
	@$(ECHO) 'not war?'


## Another joke: `make money fast'

.PHONY: money fast
money:
	@$(ECHO) '$$1,000,000'
fast:
	@:


## A joke.
# Newsgroups: rec.humor.funny.reruns
# From: sater@cs.vu.nl (Hans van Staveren)
# Subject: Good news and bad news
# Approved: rhf-reruns@clari.net
# Keywords: heard it, funny, originally appeared in second quarter, 1990
# Message-ID: <Sba5.2ff7@clarinet.com>
# Date: Tue, 14 Oct 97 19:20:05 EDT
# Lines: 20
# Xref: news.tu-bs.de rec.humor.funny.reruns:535
#
# From the RHF archives as selected by Brad Templeton, Maddi Hausmann
# and Jim Griffith.  This newsgroup posts former jokes from the
# newsgroup rec.humor.funny.  Visit http://comedy.clari.net/rhf to
# browse the RHF pages and archives on the web.

.PHONY: joke fun
joke fun:
	@$(ECHO)
	@$(ECHO)
	@$(ECHO)
	@$(ECHO) 'A man gets a telephone call from a doctor. The doctor says:'
	@$(ECHO) ' "About this medical test I did on you, I have some good news'
	@$(ECHO) '  and some bad news."'
	@$(SLEEP) 5
	@$(ECHO)
	@$(ECHO) 'The man asks for the good news first:'
	@$(ECHO) 
	@$(SLEEP) 2
	@$(ECHO) ' "The good news is that you have 24 hours to live", says the doctor.'
	@$(SLEEP) 3
	@$(ECHO)
	@$(ECHO) 'The man, incredulously:'
	@$(ECHO) ' "If that is the good news, then what is the bad news??"'
	@$(SLEEP) 4
	@$(ECHO)
	@$(ECHO) ' "I couldn'\''t reach you on the phone yesterday."'


## FORCE target

.PHONY: FORCE
FORCE:
	@:


## The resource header and app-default files.

Ddd.ad.h: Ddd $(srcdir)/ad2c.sed
	$(AD2C) Ddd > $@~ && $(MV) $@~ $@

$(srcdir)/Ddd.in: $(srcdir)/Ddd.in.m4 $(srcdir)/tips.m4 \
	$(srcdir)/macros.m4 $(srcdir)/colors.m4 
	( \
	( \
		echo "define(srcdir, \`$(srcdir)')dnl"; \
		echo "include(srcdir()/Ddd.in.m4)dnl" \
	) | $(M4); \
        ( \
		echo "define(srcdir, \`$(srcdir)')dnl"; \
		echo "include(srcdir()/tips.m4)dnl" \
	) | $(M4); \
	) > $@~ && $(MV) $@~ $@


## The VSL header files.

VSLDIR  = $(srcdir)/../vsllib

VSL_CPP = $(CPP) -I$(VSLDIR) -I$(prefix)/lib/vsl-include

VSLSOURCES = \
	$(VSLDIR)/std.vsl \
	$(VSLDIR)/builtin.vsl \
	$(VSLDIR)/tab.vsl \
	$(VSLDIR)/fonts.vsl \
	$(VSLDIR)/colors.vsl

$(srcdir)/ddd.vsl.h: $(srcdir)/ddd.vsl $(srcdir)/vsl2c.sed $(VSLSOURCES)
	$(CAT) $(srcdir)/ddd.vsl > tmp.c
	$(VSL_CPP) tmp.c | $(VSL2C) > $@
	$(RM) tmp.c

$(srcdir)/ddd.vsl: $(srcdir)/ddd.vsl.m4 $(srcdir)/colors.m4
	( \
		echo "define(srcdir, \`$(srcdir)')dnl"; \
		echo "include(srcdir()/ddd.vsl.m4)dnl" \
	) | $(M4) > $@~ && $(MV) $@~ $@


## The TIPS files.

.PHONY: tips

tips: $(srcdir)/tips.m4 $(srcdir)/tips.html

$(srcdir)/tips.m4: $(srcdir)/../TIPS $(srcdir)/tips2m4.awk
	$(AWK) -f $(srcdir)/tips2m4.awk $(srcdir)/../TIPS > $@~ && $(MV) $@~ $@

$(srcdir)/tips.html: $(srcdir)/../TIPS
	( \
		echo "define(srcdir, \`$(srcdir)')dnl"; \
		echo "define(macros, \`$(srcdir)/html.m4')dnl"; \
		echo "include(srcdir()/../TIPS)dnl" \
	) | $(M4) | $(AWK) -f $(srcdir)/tips2html.awk | \
	$(SED) 's/\\133/\[/g' | $(SED) 's/\\135/\]/g' | \
	$(SED) 's/@\([A-Z][A-Z]*\)@/\1/g' | $(SED) 's/@ /@/g' \
	> $@~ && $(MV) $@~ $@


# `make depend' fails to find this dependency :-(
DispBox.$(OBJEXT): $(srcdir)/ddd.vsl.h

# And these are never computed:
ddd.vsl.h: $(srcdir)/../vsllib/std.vsl
ddd.vsl.h: $(srcdir)/../vsllib/fonts.vsl
ddd.vsl.h: $(srcdir)/../vsllib/colors.vsl
ddd.vsl.h: $(srcdir)/../vsllib/builtin.vsl
ddd.vsl.h: $(srcdir)/../vsllib/tab.vsl


## The programs.

# We use `./ddd' to prevent Solaris VPATH-enabled make from selecting
# the `ddd' directory instead.
./$(ddd)$(EXEEXT): $(ddd_canonical)$(EXEEXT)
	$(RM) ./$(ddd)$(EXEEXT) $(SYMS)
	$(LN_S) $(ddd_canonical)$(EXEEXT) ./$(ddd)$(EXEEXT)

$(ddd_canonical)$(EXEEXT): ddd.$(OBJEXT) $(OBJECTS)
	$(LINK.cc) -o $@ ddd.$(OBJEXT) $(OBJECTS) $(ALL_X_LIBS) $(LIBS)


## The demonstration programs.

userinfo$(EXEEXT): userinfo.$(OBJEXT) $(USERINFO_OBJECTS)
	-$(LINK.cc) -o $@ userinfo.$(OBJEXT) \
		$(USERINFO_OBJECTS) $(NON_X_LIBS) $(LIBS)

rxtest$(EXEEXT): rxtest.$(OBJEXT) $(HUFFMAN_OBJECTS)
	-$(LINK.cc) -o $@ rxtest.$(OBJEXT) \
		$(HUFFMAN_OBJECTS) $(NON_X_LIBS) $(LIBS)

huffencode$(EXEEXT): huffencode.$(OBJEXT) $(HUFFMAN_OBJECTS)
	$(LINK.cc) -o $@ huffencode.$(OBJEXT) \
		$(HUFFMAN_OBJECTS) $(NON_X_LIBS) $(LIBS)

huffdecode$(EXEEXT): huffdecode.$(OBJEXT) $(HUFFMAN_OBJECTS)
	$(LINK.cc) -o $@ huffdecode.$(OBJEXT) \
		$(HUFFMAN_OBJECTS) $(NON_X_LIBS) $(LIBS)

stringify$(EXEEXT): stringify.$(OBJEXT)
	$(LINK.cc) -o $@ stringify.$(OBJEXT) $(LIBS)

mmtest$(EXEEXT): mmtest.$(OBJEXT) $(LIB_OBJECTS) 
	$(LINK.cc) -o $@ mmtest.$(OBJEXT) $(LIB_OBJECTS) $(ALL_X_LIBS) $(LIBS)

gcore$(EXEEXT): gcore.$(OBJEXT) $(HUFFMAN_OBJECTS)
	$(LINK.cc) -o $@ gcore.$(OBJEXT) \
		$(HUFFMAN_OBJECTS) $(NON_X_LIBS) $(LIBS)

logplayer$(EXEEXT): $(srcdir)/logplayer.C $(HUFFMAN_OBJECTS)
	$(COMPILE_AND_LINK.cc) -DMAIN $(INCLUDE) -o $@ \
	$(srcdir)/logplayer.C $(HUFFMAN_OBJECTS) $(NON_X_LIBS) $(LIBS)

test-file$(EXEEXT): test-file.$(OBJEXT)
	$(LINK.cc) -o $@ test-file.$(OBJEXT) $(ALL_X_LIBS)

test-graph$(EXEEXT): test-graph.$(OBJEXT) $(LIB_OBJECTS) 
	$(LINK.cc) -o $@ test-graph.$(OBJEXT) \
		$(LIB_OBJECTS) $(ALL_X_LIBS) $(LIBS)

vsl$(EXEEXT):	vsl.$(OBJEXT) DocSpace.$(OBJEXT) $(LIB_OBJECTS)
	$(LINK.cc) -o $@ vsl.$(OBJEXT) DocSpace.$(OBJEXT) \
		$(LIB_OBJECTS) $(ALL_X_LIBS) $(LIBS)

ttytest$(EXEEXT): ttytest.$(OBJEXT) \
	$(BASE_OBJECTS) $(AGENT_OBJECTS) $(TEMPLATE_OBJECTS)
	$(LINK.cc) -o $@ ttytest.$(OBJEXT) \
	$(BASE_OBJECTS) $(AGENT_OBJECTS) $(TEMPLATE_OBJECTS) \
	$(ALL_X_LIBS) $(LIBS)

bug$(EXEEXT):	bug.$(OBJEXT)
	$(LINK.cc) -o $@ bug.$(OBJEXT) $(LIBS)

sample$(EXEEXT): sample.$(OBJEXT)
	$(LINK.c) -o $@ sample.$(OBJEXT) $(LIBS)

tString$(EXEEXT): tString.$(OBJEXT)  $(HUFFMAN_OBJECTS)
	$(LINK.cc) -o $@ tString.$(OBJEXT) \
		$(HUFFMAN_OBJECTS) $(NON_X_LIBS) $(LIBS)

cxxtest$(EXEEXT): cxxtest.$(OBJEXT)
	$(LINK.cc) -o $@ cxxtest.$(OBJEXT) $(LIBS)

grabtest$(EXEEXT): grabtest.$(OBJEXT)
	$(LINK.cc) -o $@ grabtest.$(OBJEXT) $(ALL_X_LIBS) $(LIBS)

ctest$(EXEEXT):  ctest.$(OBJEXT)
	$(LINK.c) -o $@ ctest.$(OBJEXT)

ptest$(EXEEXT):  ptest.$(OBJEXT)
	$(LINK.p) -o $@ ptest.$(OBJEXT)

m2test$(EXEEXT): $(srcdir)/m2test.mod
	$(COMPILE_AND_LINK.m2) -o $@ -e $@ $(srcdir)/m2test.mod \
	-lmodula2 -ltermcap

ftest$(EXEEXT):	ftest.$(OBJEXT)
	$(LINK.f) -o $@ ftest.$(OBJEXT)

.PHONY: jtest
jtest: 	
	cd $(srcdir)/jtest; $(MAKE) jtest

swallow$(EXEEXT): swallow.$(OBJEXT) findWindow.$(OBJEXT) Swallower.$(OBJEXT)
	$(LINK.cc) -o $@ swallow.$(OBJEXT) findWindow.$(OBJEXT) Swallower.$(OBJEXT) \
	$(ALL_X_LIBS) $(LIBS)

# We don't want no optimizing, but debugging info in our test files
MAKE_DEBUG = \
$(MAKE) CXXFLAGS="`$(ECHO) '$(CXXFLAGS)' | \
	$(SED) 's/-O[^ ]*//' | $(SED) 's/-DNDEBUG//'`" \
	CFLAGS="`$(ECHO) '$(CFLAGS)' | \
	$(SED) 's/-O[^ ]*//' | $(SED) 's/-DNDEBUG//'`"

cxxtest.$(OBJEXT): $(srcdir)/cxxtest.C
	@case '$(CXXFLAGS)' in \
	*-O*) $(MAKE_DEBUG) $@;; \
	*) set -x; \
	   $(COMPILE.cc) @CXXDEBUG@ $(INCLUDE) $(srcdir)/cxxtest.C -o $@;; \
	esac

ctest.$(OBJEXT): $(srcdir)/ctest.c
	@case '$(CFLAGS)' in \
	*-O*) $(MAKE_DEBUG) $@;; \
	*) set -x; \
	   $(COMPILE.c) -g $(INCLUDE) $(srcdir)/ctest.c -o $@;; \
	esac

sample.$(OBJEXT): $(srcdir)/sample.c
	@case '$(CFLAGS)' in \
	*-O*) $(MAKE_DEBUG) $@;; \
	*) set -x; \
	   $(COMPILE.c) -g $(INCLUDE) $(srcdir)/sample.c -o $@;; \
	esac

grabtest.$(OBJEXT): $(srcdir)/grabtest.C
	@case '$(CXXFLAGS)' in \
	*-O*) $(MAKE_DEBUG) $@;; \
	*) set -x; \
	   $(COMPILE.cc) @CXXDEBUG@ $(INCLUDE) $(srcdir)/grabtest.C -o $@;; \
	esac

bug.$(OBJEXT):	$(srcdir)/bug.C
	@case '$(CXXFLAGS)' in \
	*-O*) $(MAKE_DEBUG) $@;; \
	*) set -x; \
	   $(COMPILE.cc) @CXXDEBUG@ $(INCLUDE) $(srcdir)/bug.C -o $@;; \
	esac

# These are special.
huffdecode.$(OBJEXT): $(srcdir)/huffdecode.C ddd.man.huff.C
	$(COMPILE.cc) -DMAIN -DHUFFTEXT='"$(srcdir)/ddd.man.huff.C"' \
	$(INCLUDE) -o $@ $(srcdir)/huffdecode.C

ftest.$(OBJEXT): $(srcdir)/ftest.f
	$(COMPILE.f) -c -o $@ $(srcdir)/ftest.f


## For demonstration and debugging purposes
.PHONY: check
check: Ddd ./$(ddd)$(EXEEXT) cxxtest$(EXEEXT)
	XUSERFILESEARCHPATH=%N XAPPLRESDIR=. ./$(ddd)$(EXEEXT) $(DDD_OPTIONS) cxxtest$(EXEEXT)

.PHONY: vsldemo
vsldemo: ./vsl$(EXEEXT) $(srcdir)/ddd.vsl
	./vsl$(EXEEXT) -I $(VSLDIR) $(srcdir)/ddd.vsl

.PHONY: debug
debug: Ddd ./$(ddd)$(EXEEXT) cxxtest$(EXEEXT) .gdbinit $(ddd).syms
	$(DEBUGGER) ./$(ddd)$(EXEEXT)

$(ddd).syms: $(ddd_canonical).syms
	$(RM) $@; $(LN_S) $(ddd_canonical).syms $@

$(ddd_canonical).syms: $(ddd_canonical)$(EXEEXT)
	nice $(DEBUGGER) -batch -nx -mapped -readnow $(ddd_canonical)$(EXEEXT)

.PHONY: syms
syms:   $(ddd).syms
	@:



# Create useful stuff in background
.PHONY: stuff
stuff:  ./$(ddd)$(EXEEXT)
	$(MAKE) $(ddd).syms > make.log 2>&1 &
	@:

# A convient target for setting up a debugging environment.
.PHONY: it
it:	all cxxtest$(EXEEXT) ctest$(EXEEXT) stuff
	@:



## Lex and Yacc stuff.

# VSL parsers.
vsl-lex.C: $(srcdir)/vsl-lex.L
	$(LEX.L) $(srcdir)/vsl-lex.L
	$(SHELL) $(LEXTOCXX) -prefix vsl
	$(MV) $(LEX_OUTPUT_ROOT).C $@
	$(RM) $(LEX_OUTPUT_ROOT).c

vsl-gramma.h vsl-gramma.C: $(srcdir)/vsl-gramma.Y \
	$(YACCTOCXX) $(YACCTOCXX).bison $(YACCTOCXX).h $(YACCTOCXX).sun
	$(YACC.Y) -d $(srcdir)/vsl-gramma.Y
	$(SHELL) $(YACCTOCXX) -prefix vsl
	$(MV) y.tab.H vsl-gramma.h
	$(MV) y.tab.C vsl-gramma.C
	$(RM) y.tab.c y.tab.h

# DDD regexp parsers.
rxscan.C: $(srcdir)/rxscan.L
	$(LEX.L) $(srcdir)/rxscan.L
	$(SHELL) $(LEXTOCXX) -prefix "ddd"
	$(MV) $(LEX_OUTPUT_ROOT).C $@
	$(RM) $(LEX_OUTPUT_ROOT).c

# `make depend' fails to find these dependencies :-(
VSLRead.$(OBJEXT): vsl-lex.C vsl-gramma.h vsl-gramma.C
regexps.$(OBJEXT): rxscan.C


## The manual page in PostScript format, including all pictures.

$(docdir)/ddd.man.ps: ddd.man $(PS_IMAGES)
	$(GROFF) -man ddd.man > $@~ && $(MV) $@~ $@

$(docdir)/ddd.man-nopics.ps: ddd.man-nopics
	$(GROFF) -man ddd.man-nopics > $@~ && $(MV) $@~ $@


# Included pictures

$(picdir)/ddd-all.eps: \
	$(picdir)/ddd-all.fig $(picdir)/ddd-all.xpm
$(picdir)/ddd-console.eps: \
	$(picdir)/ddd-console.fig $(picdir)/ddd-console.xpm
$(picdir)/ddd-history.eps: \
	$(picdir)/ddd-history.fig $(picdir)/ddd-history.xpm
$(picdir)/ddd-open.eps: \
	$(picdir)/ddd-open.fig $(picdir)/ddd-open.xpm
$(picdir)/ddd-source.eps: \
	$(picdir)/ddd-source.fig $(picdir)/ddd-source.xpm
$(picdir)/ddd-line-popup.eps: \
	$(picdir)/ddd-line-popup.fig $(picdir)/ddd-line-popup.xpm
$(picdir)/ddd-bp-popup.eps: \
	$(picdir)/ddd-bp-popup.fig $(picdir)/ddd-bp-popup.xpm
$(picdir)/ddd-source-popup.eps: \
	$(picdir)/ddd-source-popup.fig $(picdir)/ddd-source-popup.xpm
$(picdir)/ddd-arguments.eps: \
	$(picdir)/ddd-arguments.fig $(picdir)/ddd-arguments.xpm
$(picdir)/ddd-tool.eps: \
	$(picdir)/ddd-tool.fig $(picdir)/ddd-tool.xpm
$(picdir)/ddd-backtrace.eps: \
	$(picdir)/ddd-backtrace.fig $(picdir)/ddd-backtrace.xpm
$(picdir)/ddd-value-tip.eps: \
	$(picdir)/ddd-value-tip.fig $(picdir)/ddd-value-tip.xpm
$(picdir)/ddd-print-popup.eps: \
	$(picdir)/ddd-print-popup.fig $(picdir)/ddd-print-popup.xpm
$(picdir)/ddd-select-display.eps: \
	$(picdir)/ddd-select-display.fig $(picdir)/ddd-select-display.xpm
$(picdir)/ddd-hide-display.eps: \
	$(picdir)/ddd-hide-display.fig $(picdir)/ddd-hide-display.xpm
$(picdir)/ddd-rotate-display.eps: \
	$(picdir)/ddd-rotate-display.fig $(picdir)/ddd-rotate-display.xpm
$(picdir)/ddd-locals.eps: \
	$(picdir)/ddd-locals.fig $(picdir)/ddd-locals.xpm
$(picdir)/ddd-status-displays.eps: \
	$(picdir)/ddd-status-displays.fig $(picdir)/ddd-status-displays.xpm
$(picdir)/ddd-set.eps: \
	$(picdir)/ddd-set.fig $(picdir)/ddd-set.xpm
$(picdir)/ddd-layout.eps: \
	$(picdir)/ddd-layout.fig $(picdir)/ddd-layout.xpm
$(picdir)/ddd-print-graph.eps: \
	$(picdir)/ddd-print-graph.fig $(picdir)/ddd-print-graph.xpm
$(picdir)/ddd-print-output.eps: \
	$(picdir)/ddd-print-output.fig $(picdir)/ddd-graph.ps
$(picdir)/ddd-code.eps: \
	$(picdir)/ddd-code.fig $(picdir)/ddd-code.xpm
$(picdir)/ddd-registers.eps: \
	$(picdir)/ddd-registers.fig $(picdir)/ddd-registers.xpm
$(picdir)/ddd-general-prefs.eps: \
	$(picdir)/ddd-general-prefs.fig $(picdir)/ddd-general-prefs.xpm 
$(picdir)/ddd-helpers.eps: \
	$(picdir)/ddd-helpers.fig $(picdir)/ddd-helpers.xpm 
$(picdir)/ddd-source-prefs.eps: \
	$(picdir)/ddd-source-prefs.fig $(picdir)/ddd-source-prefs.xpm
$(picdir)/ddd-data-prefs.eps: \
	$(picdir)/ddd-data-prefs.fig $(picdir)/ddd-data-prefs.xpm
$(picdir)/ddd-startup-prefs.eps: \
	$(picdir)/ddd-startup-prefs.fig $(picdir)/ddd-startup-prefs.xpm
$(picdir)/ddd-settings.eps: \
	$(picdir)/ddd-settings.fig $(picdir)/ddd-settings.xpm
$(picdir)/ddd-threads.eps: \
	$(picdir)/ddd-threads.fig $(picdir)/ddd-threads.xpm
$(picdir)/ddd-aliases.eps: \
	$(picdir)/ddd-aliases.fig $(picdir)/ddd-aliases.xpm
$(picdir)/ddd-edit-displays.eps: \
	$(picdir)/ddd-edit-displays.fig $(picdir)/ddd-edit-displays.xpm
$(picdir)/ddd-attach.eps: \
	$(picdir)/ddd-attach.fig $(picdir)/ddd-attach.xpm
$(picdir)/ddd-save-session.eps: \
	$(picdir)/ddd-save-session.fig $(picdir)/ddd-save-session.xpm
$(picdir)/ddd-open-session.eps: \
	$(picdir)/ddd-open-session.fig $(picdir)/ddd-open-session.xpm
$(picdir)/ddd-button-editor.eps: \
	$(picdir)/ddd-button-editor.fig $(picdir)/ddd-button-editor.xpm
$(picdir)/ddd-shortcuts.eps: \
	$(picdir)/ddd-shortcuts.fig $(picdir)/ddd-shortcuts.xpm
$(picdir)/ddd-shortcut-editor.eps: \
	$(picdir)/ddd-shortcut-editor.fig $(picdir)/ddd-shortcut-editor.xpm
$(picdir)/ddd-drag.eps: \
	$(picdir)/ddd-drag.fig \
	$(picdir)/ddd-drag1.xpm \
	$(picdir)/ddd-drag2.xpm \
	$(picdir)/ddd-drag3.xpm
$(picdir)/disclaimer.eps: \
	$(picdir)/disclaimer.fig
$(picdir)/ddd-separate.eps: \
	$(picdir)/ddd-separate.fig $(picdir)/ddd-separate.xpm
$(picdir)/ddd-bp-properties.eps: \
	$(picdir)/ddd-bp-properties.fig $(picdir)/ddd-bp-properties.xpm
$(picdir)/ddd-edit-breakpoints.eps: \
	$(picdir)/ddd-edit-breakpoints.fig $(picdir)/ddd-edit-breakpoints.xpm
$(picdir)/ddd-display.eps: \
	$(picdir)/ddd-display.fig $(picdir)/ddd-display.xpm
$(picdir)/ddd-repeats.eps: \
	$(picdir)/ddd-repeats.fig $(picdir)/ddd-repeats.xpm
$(picdir)/ddd-toolbar.eps: \
	$(picdir)/ddd-toolbar.fig $(picdir)/ddd-toolbar.xpm
$(picdir)/ddd-font-prefs.eps: \
	$(picdir)/ddd-font-prefs.fig $(picdir)/ddd-font-prefs.xpm
$(picdir)/ddd-define-command.eps: \
	$(picdir)/ddd-define-command.fig $(picdir)/ddd-define-command.xpm
$(picdir)/ddd-signals.eps: \
	$(picdir)/ddd-signals.fig $(picdir)/ddd-signals.xpm
$(picdir)/ddd-examine.eps: \
	$(picdir)/ddd-examine.fig $(picdir)/ddd-examine.xpm
$(picdir)/ddd-clusters.eps: \
	$(picdir)/ddd-clusters.fig \
	$(picdir)/clustered.ps $(picdir)/unclustered.ps
$(picdir)/ddd-plots.eps: \
	$(picdir)/ddd-plots.fig $(picdir)/ddd-plots.xpm
$(picdir)/ddd-toolbars.eps: \
	$(picdir)/ddd-toolbars.fig \
	$(picdir)/ddd-toolbar-1.xpm \
	$(picdir)/ddd-toolbar-2.xpm \
	$(picdir)/ddd-toolbar-3.xpm \
	$(picdir)/ddd-toolbar-4.xpm


# JPEGs are derived from EPS files

$(picdir)/ddd-all$(IMGEXT):              $(picdir)/ddd-all.eps
$(picdir)/ddd-console$(IMGEXT):          $(picdir)/ddd-console.eps
$(picdir)/ddd-history$(IMGEXT):          $(picdir)/ddd-history.eps
$(picdir)/ddd-open$(IMGEXT):             $(picdir)/ddd-open.eps
$(picdir)/ddd-source$(IMGEXT):           $(picdir)/ddd-source.eps
$(picdir)/ddd-line-popup$(IMGEXT):       $(picdir)/ddd-line-popup.eps
$(picdir)/ddd-bp-popup$(IMGEXT):         $(picdir)/ddd-bp-popup.eps
$(picdir)/ddd-source-popup$(IMGEXT):     $(picdir)/ddd-source-popup.eps
$(picdir)/ddd-arguments$(IMGEXT):        $(picdir)/ddd-arguments.eps
$(picdir)/ddd-tool$(IMGEXT):             $(picdir)/ddd-tool.eps
$(picdir)/ddd-backtrace$(IMGEXT):        $(picdir)/ddd-backtrace.eps
$(picdir)/ddd-value-tip$(IMGEXT):        $(picdir)/ddd-value-tip.eps
$(picdir)/ddd-print-popup$(IMGEXT):      $(picdir)/ddd-print-popup.eps
$(picdir)/ddd-select-display$(IMGEXT):   $(picdir)/ddd-select-display.eps
$(picdir)/ddd-hide-display$(IMGEXT):     $(picdir)/ddd-hide-display.eps
$(picdir)/ddd-rotate-display$(IMGEXT):   $(picdir)/ddd-rotate-display.eps
$(picdir)/ddd-locals$(IMGEXT):           $(picdir)/ddd-locals.eps
$(picdir)/ddd-status-displays$(IMGEXT):  $(picdir)/ddd-status-displays.eps
$(picdir)/ddd-set$(IMGEXT):              $(picdir)/ddd-set.eps
$(picdir)/ddd-layout$(IMGEXT):           $(picdir)/ddd-layout.eps
$(picdir)/ddd-print-graph$(IMGEXT):      $(picdir)/ddd-print-graph.eps
$(picdir)/ddd-print-output$(IMGEXT):     $(picdir)/ddd-print-output.eps
$(picdir)/ddd-code$(IMGEXT):             $(picdir)/ddd-code.eps
$(picdir)/ddd-registers$(IMGEXT):        $(picdir)/ddd-registers.eps
$(picdir)/ddd-general-prefs$(IMGEXT):    $(picdir)/ddd-general-prefs.eps
$(picdir)/ddd-helpers$(IMGEXT):          $(picdir)/ddd-helpers.eps
$(picdir)/ddd-source-prefs$(IMGEXT):     $(picdir)/ddd-source-prefs.eps
$(picdir)/ddd-data-prefs$(IMGEXT):       $(picdir)/ddd-data-prefs.eps
$(picdir)/ddd-startup-prefs$(IMGEXT):    $(picdir)/ddd-startup-prefs.eps
$(picdir)/ddd-settings$(IMGEXT):         $(picdir)/ddd-settings.eps
$(picdir)/ddd-threads$(IMGEXT):          $(picdir)/ddd-threads.eps
$(picdir)/ddd-aliases$(IMGEXT):          $(picdir)/ddd-aliases.eps
$(picdir)/ddd-edit-displays$(IMGEXT):    $(picdir)/ddd-edit-displays.eps
$(picdir)/ddd-attach$(IMGEXT):           $(picdir)/ddd-attach.eps
$(picdir)/ddd-save-session$(IMGEXT):     $(picdir)/ddd-save-session.eps
$(picdir)/ddd-open-session$(IMGEXT):     $(picdir)/ddd-open-session.eps
$(picdir)/ddd-button-editor$(IMGEXT):    $(picdir)/ddd-button-editor.eps
$(picdir)/ddd-shortcuts$(IMGEXT):        $(picdir)/ddd-shortcuts.eps
$(picdir)/ddd-shortcut-editor$(IMGEXT):  $(picdir)/ddd-shortcut-editor.eps
$(picdir)/ddd-drag$(IMGEXT):             $(picdir)/ddd-drag.eps
$(picdir)/disclaimer$(IMGEXT):           $(picdir)/disclaimer.eps
$(picdir)/ddd-separate$(IMGEXT):         $(picdir)/ddd-separate.eps
$(picdir)/ddd-bp-properties$(IMGEXT):    $(picdir)/ddd-bp-properties.eps
$(picdir)/ddd-edit-breakpoints$(IMGEXT): $(picdir)/ddd-edit-breakpoints.eps
$(picdir)/ddd-display$(IMGEXT):          $(picdir)/ddd-display.eps
$(picdir)/ddd-repeats$(IMGEXT):          $(picdir)/ddd-repeats.eps
$(picdir)/ddd-toolbar$(IMGEXT):          $(picdir)/ddd-toolbar.eps
$(picdir)/ddd-font-prefs$(IMGEXT):       $(picdir)/ddd-font-prefs.eps
$(picdir)/ddd-define-command$(IMGEXT):   $(picdir)/ddd-define-command.eps
$(picdir)/ddd-signals$(IMGEXT):          $(picdir)/ddd-signals.eps
$(picdir)/ddd-examine$(IMGEXT):          $(picdir)/ddd-examine.eps
$(picdir)/ddd-clusters$(IMGEXT):         $(picdir)/ddd-clusters.eps
$(picdir)/ddd-plots$(IMGEXT):            $(picdir)/ddd-plots.eps
$(picdir)/ddd-toolbars$(IMGEXT):         $(picdir)/ddd-toolbars.eps


# PDFs are also derived from EPS files

$(picdir)/ddd-all.pdf:              $(picdir)/ddd-all.eps
$(picdir)/ddd-console.pdf:          $(picdir)/ddd-console.eps
$(picdir)/ddd-history.pdf:          $(picdir)/ddd-history.eps
$(picdir)/ddd-open.pdf:             $(picdir)/ddd-open.eps
$(picdir)/ddd-source.pdf:           $(picdir)/ddd-source.eps
$(picdir)/ddd-line-popup.pdf:       $(picdir)/ddd-line-popup.eps
$(picdir)/ddd-bp-popup.pdf:         $(picdir)/ddd-bp-popup.eps
$(picdir)/ddd-source-popup.pdf:     $(picdir)/ddd-source-popup.eps
$(picdir)/ddd-arguments.pdf:        $(picdir)/ddd-arguments.eps
$(picdir)/ddd-tool.pdf:             $(picdir)/ddd-tool.eps
$(picdir)/ddd-backtrace.pdf:        $(picdir)/ddd-backtrace.eps
$(picdir)/ddd-value-tip.pdf:        $(picdir)/ddd-value-tip.eps
$(picdir)/ddd-print-popup.pdf:      $(picdir)/ddd-print-popup.eps
$(picdir)/ddd-select-display.pdf:   $(picdir)/ddd-select-display.eps
$(picdir)/ddd-hide-display.pdf:     $(picdir)/ddd-hide-display.eps
$(picdir)/ddd-rotate-display.pdf:   $(picdir)/ddd-rotate-display.eps
$(picdir)/ddd-locals.pdf:           $(picdir)/ddd-locals.eps
$(picdir)/ddd-status-displays.pdf:  $(picdir)/ddd-status-displays.eps
$(picdir)/ddd-set.pdf:              $(picdir)/ddd-set.eps
$(picdir)/ddd-layout.pdf:           $(picdir)/ddd-layout.eps
$(picdir)/ddd-print-graph.pdf:      $(picdir)/ddd-print-graph.eps
$(picdir)/ddd-print-output.pdf:     $(picdir)/ddd-print-output.eps
$(picdir)/ddd-code.pdf:             $(picdir)/ddd-code.eps
$(picdir)/ddd-registers.pdf:        $(picdir)/ddd-registers.eps
$(picdir)/ddd-general-prefs.pdf:    $(picdir)/ddd-general-prefs.eps
$(picdir)/ddd-helpers.pdf:          $(picdir)/ddd-helpers.eps
$(picdir)/ddd-source-prefs.pdf:     $(picdir)/ddd-source-prefs.eps
$(picdir)/ddd-data-prefs.pdf:       $(picdir)/ddd-data-prefs.eps
$(picdir)/ddd-startup-prefs.pdf:    $(picdir)/ddd-startup-prefs.eps
$(picdir)/ddd-settings.pdf:         $(picdir)/ddd-settings.eps
$(picdir)/ddd-threads.pdf:          $(picdir)/ddd-threads.eps
$(picdir)/ddd-aliases.pdf:          $(picdir)/ddd-aliases.eps
$(picdir)/ddd-edit-displays.pdf:    $(picdir)/ddd-edit-displays.eps
$(picdir)/ddd-attach.pdf:           $(picdir)/ddd-attach.eps
$(picdir)/ddd-save-session.pdf:     $(picdir)/ddd-save-session.eps
$(picdir)/ddd-open-session.pdf:     $(picdir)/ddd-open-session.eps
$(picdir)/ddd-button-editor.pdf:    $(picdir)/ddd-button-editor.eps
$(picdir)/ddd-shortcuts.pdf:        $(picdir)/ddd-shortcuts.eps
$(picdir)/ddd-shortcut-editor.pdf:  $(picdir)/ddd-shortcut-editor.eps
$(picdir)/ddd-drag.pdf:             $(picdir)/ddd-drag.eps
$(picdir)/disclaimer.pdf:           $(picdir)/disclaimer.eps
$(picdir)/ddd-separate.pdf:         $(picdir)/ddd-separate.eps
$(picdir)/ddd-bp-properties.pdf:    $(picdir)/ddd-bp-properties.eps
$(picdir)/ddd-edit-breakpoints.pdf: $(picdir)/ddd-edit-breakpoints.eps
$(picdir)/ddd-display.pdf:          $(picdir)/ddd-display.eps
$(picdir)/ddd-repeats.pdf:          $(picdir)/ddd-repeats.eps
$(picdir)/ddd-toolbar.pdf:          $(picdir)/ddd-toolbar.eps
$(picdir)/ddd-font-prefs.pdf:       $(picdir)/ddd-font-prefs.eps
$(picdir)/ddd-define-command.pdf:   $(picdir)/ddd-define-command.eps
$(picdir)/ddd-signals.pdf:          $(picdir)/ddd-signals.eps
$(picdir)/ddd-examine.pdf:          $(picdir)/ddd-examine.eps
$(picdir)/ddd-clusters.pdf:         $(picdir)/ddd-clusters.eps
$(picdir)/ddd-plots.pdf:            $(picdir)/ddd-plots.eps
$(picdir)/ddd-toolbars.pdf:         $(picdir)/ddd-toolbars.eps


# The logo comes in XPM source
$(picdir)/dddsplash.eps: $(icondir)/dddsplash.xpm
	$(CONVERT) $(icondir)/dddsplash.xpm $@

$(picdir)/dddsplash.gif: $(icondir)/dddsplash.xpm
	$(CONVERT) $(icondir)/dddsplash.xpm $@

$(picdir)/dddsplash.jpg: $(icondir)/dddsplash.xpm
	$(CONVERT) -quality 100 $(icondir)/dddsplash.xpm $@

$(picdir)/dddsplash.png: $(icondir)/dddsplash.xpm
	$(CONVERT) -quality 100 $(icondir)/dddsplash.xpm $@

$(picdir)/dddlogo.eps: $(icondir)/dddlogo.xpm
	$(CONVERT) $(icondir)/dddlogo.xpm $@

$(picdir)/dddlogo.gif: $(icondir)/dddlogo.xpm
	$(CONVERT) $(icondir)/dddlogo.xpm $@

$(picdir)/dddlogo.jpg: $(icondir)/dddlogo.xpm
	$(CONVERT) -quality 100 $(icondir)/dddlogo.xpm $@

$(picdir)/dddlogo.png: $(icondir)/dddlogo.xpm
	$(CONVERT) -quality 100 $(icondir)/dddlogo.xpm $@

$(picdir)/dddback.eps: $(icondir)/dddback.xpm
	$(CONVERT) $(icondir)/dddback.xpm $@

$(picdir)/dddback.gif: $(icondir)/dddback.xpm
	$(CONVERT) $(icondir)/dddback.xpm $@

$(picdir)/dddback.jpg: $(icondir)/dddback.xpm
	$(CONVERT) -quality 100 $(icondir)/dddback.xpm $@

$(picdir)/dddback.png: $(icondir)/dddback.xpm
	$(CONVERT) -quality 100 $(icondir)/dddback.xpm $@


## The DDD manual in PostScript format, including all pictures.

$(docdir)/ddd.ps: ddd.dvi
	$(DVIPS) ddd.dvi -o $@


## The DDD manual in DVI format.

# Be sure we have a local copy of the included sources.
# This avoids messing around with include paths, which may
# or may not be supported by the current tools.

# Texinfo sources
texidir = $(srcdir)/../texinfo

INCLUDES = \
	config.texi  \
	gpl.texinfo  \
	lgpl.texinfo \
	texinfo.tex  \
	epsf.tex     \
	xepsf.tex

ddd.dvi: $(srcdir)/ddd.texi $(INCLUDES) $(PS_IMAGES)
	-test -d PICS || $(LN_S) $(picdir) .
	$(TEXI2DVI) $(srcdir)/ddd.texi

gpl.texinfo: $(texidir)/gpl.texinfo
	$(RM) $@; $(LN_S) $(texidir)/gpl.texinfo $@

lgpl.texinfo: $(texidir)/lgpl.texinfo
	$(RM) $@; $(LN_S) $(texidir)/lgpl.texinfo $@

texinfo.tex: $(texidir)/texinfo.tex
	$(RM) $@; $(LN_S) $(texidir)/texinfo.tex $@

epsf.tex: $(texidir)/epsf.tex
	$(RM) $@; $(LN_S) $(texidir)/epsf.tex $@

xepsf.tex: $(texidir)/epsf.tex
	$(RM) $@; $(LN_S) $(texidir)/xepsf.tex $@


## The DDD manual in PDF format, including all pictures.

$(docdir)/ddd.pdf: ddd.pdf
	$(INSTALL_DATA) ddd.pdf $@

ddd.pdf: $(srcdir)/ddd.texi $(INCLUDES) $(PDF_IMAGES)
	-test -d PICS || $(LN_S) $(picdir) .
	$(TEXI2PDF) $(srcdir)/ddd.texi


## The DDD manual in HTML format.

$(htmldir)/index.html: $(srcdir)/ddd.texi $(INCLUDES) $(HTML_IMAGES) \
	style.css $(srcdir)/fix-html.sed
	@-test -d $(htmldir) || $(MKDIR) $(htmldir)
	@-test -d $(htmldir)/PICS || $(MKDIR) $(htmldir)/PICS
	@-test -d PICS || $(LN_S) $(picdir) .
	$(RM) ddd*.html
	$(TEXI2HTML) $(srcdir)/ddd.texi
	for file in ddd*.html; do \
		$(SED) -f $(srcdir)/fix-html.sed $$file | \
		$(SED) 's/@IMGEXT@/\$(IMGEXT)/g' > $$file~ && \
		$(MV) $$file~ $$file; \
	done
	cd $(htmldir) && $(RM) ddd*.html style.css PICS/*
	$(INSTALL_DATA) ddd*.html $(srcdir)/style.css $(htmldir)
	@$(ECHO) Installing images...
	@$(INSTALL_DATA) $(HTML_IMAGES) $(htmldir)/PICS
	@$(ECHO) Installing images...done.
	$(RM) $(htmldir)/index.html
	$(LN_S) ddd.html $@

## The DDD manual in Info format.

$(INFO): $(srcdir)/ddd.texi $(INCLUDES)
	$(RM) ddd.info* $(INFOS)
	$(MAKEINFO) -I. -I$(srcdir) $(srcdir)/ddd.texi
	$(INSTALL_DATA) ddd.info* $(docdir)


## Auxiliary manual files.

$(docdir)/sample.c: $(srcdir)/sample.c
	$(INSTALL_DATA) $(srcdir)/sample.c $(docdir)



## Icons and logos.

.PHONY: icons
icons:	$(ICONS)
	@:

# All X bitmaps are derived from the XPM sources.

$(icondir)/dddmask.xpm: $(icondir)/ddd.xpm
	$(SED) 's/[wW]hite/black/g' $(icondir)/ddd.xpm > $@

$(icondir)/ddd.xbm: $(icondir)/ddd.xpm

$(icondir)/ddd.xface: $(icondir)/ddd.xbm

$(icondir)/dddmask.xbm: $(icondir)/dddmask.xpm

# Original filter for dddsplash to extract g4 info
# $(SED) 's/[	 ][cmg][ 	][#a-zA-Z0-9][#a-zA-Z0-9]*//g' | \
#

$(icondir)/dddsplash.xbm: $(icondir)/dddsplash.xpm
	@$(ECHO) "Creating $@"
	@-$(CAT) $(icondir)/dddsplash.xpm | \
	$(XPMTOPPM) | $(PNMDEPTH) 255 | $(PNMGAMMA) 0.4 | $(PPMTOPGM) | \
	$(PGMENHANCE) -7 | \
	$(PGMTOPBM) | $(PBMTOXBM) | $(SED) 's/noname/dddsplash/g' | \
	$(SED) "s/static char/static unsigned char/g" > $@~
	@test -s $@~ && $(MV) $@~ $@ || ($(RM) $@~; test -s $@)

$(icondir)/dddlogo.xpm: $(icondir)/dddsplash.xpm
	$(CONVERT) -pen white \
	-draw 'rectangle 0,0 409,139' -draw 'rectangle 1,1 408,138' $< $@

## Configuration stuff.

Makefile: $(srcdir)/Makefile.in config.status
	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

Ddd: $(srcdir)/Ddd.in config.status
	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

.gdbinit: $(srcdir)/.gdbinit.in config.status
	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

.PHONY:	spec
spec: ../$(ddd)-$(VERSION)-$(REL).spec
../$(ddd)-$(VERSION)-$(REL).spec: $(srcdir)/../ddd.spec.in config.status
	CONFIG_FILES=../ddd.spec CONFIG_HEADERS= $(SHELL) ./config.status
	$(SED) 's/@REL@/$(REL)/g' ../ddd.spec > $@
	$(RM) ../ddd.spec

$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4
	-cd $(srcdir) && $(AUTOCONF)
config.status: $(srcdir)/configure
	-$(SHELL) ./config.status --recheck || $(SHELL) $(srcdir)/configure -v

$(srcdir)/aclocal.m4: $(srcdir)/configure.in $(srcdir)/acinclude.m4
	-cd $(srcdir) && $(ACLOCAL)

.PRECIOUS: Makefile configure config.status config.h Ddd

# autoheader might not change config.h.in
$(srcdir)/config.h.in: stamp-h.in
$(srcdir)/stamp-h.in: \
	$(srcdir)/configure.in \
	$(srcdir)/aclocal.m4 \
	$(srcdir)/acconfig.h
	cd $(srcdir) && $(AUTOHEADER)
	$(DATE) > $@~ && $(MV) $@~ $@

$(srcdir)/acconfig.h: $(srcdir)/acconfig.h.in $(srcdir)/acspecial.h
	( \
		echo "define(srcdir, \`$(srcdir)')dnl"; \
		echo "include(srcdir()/acconfig.h.in)dnl" \
	) | $(M4) > $@~ && $(MV) $@~ $@

$(srcdir)/acspecial.h: $(srcdir)/configure.in
	$(GREP) '^ICE_[a-zA-Z0-9_]* *(' $(srcdir)/configure.in > $@~ && \
	$(MV) $@~ $@


# config.status might not change config.h
config.h: stamp-h
stamp-h: config.h.in config.status
	CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
	$(DATE) > $@~ && $(MV) $@~ $@


# We use configure to create `version.h'.
# To make sure these are not touched upon every invocation,
# we create temporary vr.* files instead and touch the version.* files
# only if the vr.* files changed.
version.h: vr.h
	@$(CMP) vr.h $@ 2> /dev/null || ( $(CAT) vr.h > $@~ && $(MV) $@~ $@ )
vr.h: vr.h.in config.status
	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

# We use configure to create `build.h'.
# To make sure these are not touched upon every invocation,
# we create temporary bld.* files instead and touch the build.* files
# only if the bld.* files changed.
build.h: bld.h
	@$(CMP) bld.h $@ 2> /dev/null || ( $(CAT) bld.h > $@~ && $(MV) $@~ $@ )
bld.h: bld.h.in config.status
	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

# We use configure to create `config.texi'.
# To make sure these are not touched upon every invocation,
# we create temporary cfg.* files instead and touch the config.* files
# only if the cfg.* files changed.
config.texi: cfg.texi
	@$(CMP) cfg.texi $@ 2> /dev/null || \
	( $(CAT) cfg.texi > $@~ && $(MV) $@~ $@ )
cfg.texi: $(srcdir)/cfg.texi.in config.status
	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

## The manual page
ddd.man: $(srcdir)/ddd.man.in config.status
	CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

# Same, but in 7-bit format
ddd.1:   ddd.man $(srcdir)/unumlaut.sed
	-$(SED) -f $(srcdir)/unumlaut.sed ddd.man > $@~ && $(MV) $@~ $@

# ddd.man.txt does NOT depend on ddd.man since we don't want it to get
# re-created after each configuration.
ddd.man.txt: $(srcdir)/ddd.man.in configure.in $(srcdir)/umlaut8.sed
	$(MAKE) ddd.man
	-$(SED) -f $(srcdir)/umlaut7.sed ddd.man | \
	$(NROFF) -man | $(SED) -f $(srcdir)/umlaut8.sed > $@~ && $(MV) $@~ $@

# ddd.man.txt may reside in $(srcdir) or `.' , hence the `$?'
ddd.man.txt.gz: ddd.man.txt
	$(COMPRESS) $? > $@~ && $(MV) $@~ $@

ddd.man.txt.gz.C: ddd.man.txt.gz
	$(MAKE) stringify$(EXEEXT)
	-./stringify < $? > $@~ && $(MV) $@~ $@


# ddd.man.huff.C does NOT depend on huffencode since we don't want it
# to get re-created after each configuration.
ddd.man.huff.C: ddd.man.txt
	$(MAKE) huffencode$(EXEEXT)
	-./huffencode < ddd.man.txt > $@~ && $(MV) $@~ $@

# The `no pictures' variant of ddd.man.
ddd.man-nopics: ddd.man
	$(GREP) -v '^\.PSPIC' ddd.man > ddd.man-nopics

## The info file, in text format
# ddd.info.txt does NOT depend on ddd.info since we don't want it to get
# re-created after each configuration.
ddd.info.txt: $(srcdir)/ddd.texi configure.in
	$(MAKE) $(INFO)
	info --subnodes -o - -f $(INFO) > $@~ && $(MV) $@~ $@

# ddd.man.txt may reside in $(srcdir) or `.' , hence the `$?'
ddd.info.txt.gz: ddd.info.txt
	$(COMPRESS) $? > $@~ && $(MV) $@~ $@

ddd.info.txt.gz.C: ddd.info.txt.gz
	$(MAKE) stringify$(EXEEXT)
	-./stringify < $? > $@~ && $(MV) $@~ $@


# COPYING.huff.C does NOT depend on huffencode since we don't want it
# to get re-created after each configuration.
COPYING.huff.C: $(srcdir)/../COPYING
	$(MAKE) huffencode$(EXEEXT)
	-$(SED) 's///' < $(srcdir)/../COPYING | ./huffencode > $@~ && \
	$(MV) $@~ $@

COPYING.gz: $(srcdir)/../COPYING
	$(COMPRESS) $(srcdir)/../COPYING > $@

COPYING.gz.C: COPYING.gz
	$(MAKE) stringify$(EXEEXT)
	-./stringify < COPYING.gz > $@~ && $(MV) $@~ $@

# NEWS.huff.C does NOT depend on huffencode since we don't want it
# to get re-created after each configuration.
NEWS.huff.C: $(srcdir)/../NEWS
	$(MAKE) huffencode$(EXEEXT)
	-$(SED) 's///' < $(srcdir)/../NEWS | ./huffencode > $@~ && \
	$(MV) $@~ $@

NEWS.gz: $(srcdir)/../NEWS
	$(COMPRESS) $(srcdir)/../NEWS > $@~ && $(MV) $@~ $@

NEWS.gz.C: NEWS.gz
	$(MAKE) stringify$(EXEEXT)
	-./stringify < NEWS.gz > $@~ && $(MV) $@~ $@

# `make depend' fails to find this dependency :-(
show.$(OBJEXT): COPYING.gz.C NEWS.gz.C ddd.info.txt.gz.C


## The xlibdir script
xlibdir.C: xlibdir.txt

# `make depend' fails to find this dependency :-(
xconfig.$(OBJEXT): xlibdir.C


## The host type
host.h: $(srcdir)/host.h.in config.status
	$(CAT) $(srcdir)/host.h.in | \
	$(SED) "s%@HOST_CANONICAL@%$(host_canonical)%" | \
	$(SED) "s%@TARGET_CANONICAL@%$(target_canonical)%" > $@~ && \
	$(MV) $@~ $@

## Tags.
.PHONY:	tags
tags:	$(srcdir)/TAGS

$(srcdir)/TAGS:	FORCE
	@if [ `ls -c $(srcdir)/TAGS $(srcdir)/*.[Ch] | head -1` != $(srcdir)/TAGS ]; then \
	echo 'Creating $@...'; \
	$(ETAGS) -o $@ $(srcdir)/*.[Ch]; \
	echo 'Creating $@...done.'; \
	else \
	echo "'"'$@` is up to date.'; \
	fi

## Statistics.
# Count lines of C++/lex/yacc source code.
# Lines containing only comments or documentation and empty lines are ignored.

.PHONY: loc stats
loc stats:
	cd $(srcdir); \
	for list in '$(LIB_OBJECTS)' '$(DDD_OBJECTS)' '$(OBJECTS)'; do \
	pattern=`$(ECHO) $$list | $(SED) 's/\([a-zA-Z0-9_]*\)\.$(OBJEXT)/\1\\.*/g'`; \
	$(ECHO) "Lines of code for $$pattern"; \
	$(CAT) `$(LS) $$pattern | grep '\.[ChLY]'` | \
		$(GREP) -v '^[ 	]*//' | \
		$(GREP) -v '^"' | \
		$(GREP) -v '^[ 	]*$$' | wc -l; \
	done


## EPS code stuff.

$(srcdir)/header.str: $(srcdir)/header.ps
	$(SED) 's/^.*$$/"&\\n"/' $(srcdir)/header.ps > $@~ && $(MV) $@~ $@

$(srcdir)/trailer.str: $(srcdir)/trailer.ps
	$(SED) 's/^.*$$/"&\\n"/' $(srcdir)/trailer.ps > $@~ && $(MV) $@~ $@

$(srcdir)/eps-code.h: \
	$(srcdir)/header.str $(srcdir)/trailer.str $(srcdir)/eps-code.x
	$(SED) -e '/prolog/r $(srcdir)/header.str' \
	       -e '/trailer/r $(srcdir)/trailer.str' $(srcdir)/eps-code.x \
	> $@~ && $(MV) $@~ $@


## Configuration info stuff
configinfo.C: USERINFO $(srcdir)/config-info
	$(SHELL) $(srcdir)/config-info $(srcdir)/USERINFO USERINFO > $@~ && \
	$(MV) $@~ $@

# configinfo.C:	Makefile config.h

configinfo.$(OBJEXT):	configinfo.C configinfo.h

# If `~/.ddd_userinfo' exists, use this file as personal identification.
USERINFO: userinfo$(EXEEXT)
	-(cat $$HOME/.ddd_userinfo 2> /dev/null || \
	./userinfo || echo '(unknown)') > $@~ && $(MV) $@~ $@
	@$(ECHO) ""
	@$(ECHO) "Please check your name and e-mail address:"
	@$(ECHO) ""
	@$(CAT) $@
	@$(ECHO) ""
	@$(ECHO) "This information will be compiled into $(DDD)."
	@$(ECHO) "If it is not correct, please edit $@ and re-compile."
	@$(ECHO) ""


## Update the shared source tree.  For development only.

PUB_DEST=/ftp/ips/pub/misc/$(ddd)-$(VERSION)/ddd
PUB_SRC=`ls -t /usr/local/share/CVS/ddd/ddd | $(SED) 's/,v//'`
GTEST=/usr/local/gnubin/test

.PHONY: pub
pub:	$(PROG_STUFF) configure $(PUB_DEST)/USERINFO
	@for file in $(PUB_SRC) $(PROG_STUFF) configure Makedeps; do \
	    if $(GTEST) ./$$file -nt $(PUB_DEST)/$$file; then \
		echo -n Updating $(PUB_DEST)/$$file...; \
		cp -p ./$$file $(PUB_DEST)/$$file; \
		echo done.; \
	    fi; \
	done


## Make dependency stuff.

.PHONY: depend
depend: FORCE $(PROG_STUFF)

.PRECIOUS: $(srcdir)/Makedeps
$(srcdir)/Makedeps depend:
	@$(ECHO) "Creating $(srcdir)/Makedeps..."
	@( $(ECHO) \#' DO NOT EDIT -- generated automagically by make depend';\
	$(ECHO) \#' Source: $$Id$$'; \
	$(ECHO) ; \
	srcdir=`echo $(srcdir) | $(SED) 's%\.%\\\\.%g'`; \
	$(CXX) -M $(CPPFLAGS) $(DEFS) $(INCLUDE) $(srcdir)/*.C \
	| $(SED) "s% $$srcdir/% %g" \
	| $(SED) 's% /[^ ]*%%g' \
	| $(SED) 's% \./% %g' \
	| $(GREP) -v '^ *\\$$' \
	| $(SED) "s% \.\./% \$$(srcdir)/\.\./%g" \
	| $(SED) 's%^ *$$%& config.h%g' ) > Makedeps~
	@$(MV) Makedeps~ $(srcdir)/Makedeps
	@$(ECHO) "Creating $(srcdir)/Makedeps...done."

## If your `make' cannot handle the following line,
## just replace it by the contents of `@srcdir@/Makedeps'.
include @srcdir@/Makedeps
