# Generated automatically from Makefile.in by configure.
# Makefile for GNU gnats.
# Copyright (C) 1993 Free Software Foundation, Inc.
#
# This file is part of GNU gnats.
#
# GNU gnats 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 2, or (at your option)
# any later version.
# 
# GNU gnats 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 GNU gnats; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

srcdir = .
VPATH = ${srcdir}

#**** Start of system configuration section.

# Where the gnats categories and other things should live.
# default: $(statedir)/gnats/gnats-db
GNATS_ROOT = $(statedir)/gnats/gnats-db

# Email address people should use to submit bugs.
# default: bugs@`hostname`
GNATS_ADDR = bugs

# The name of your site, to be used by send-pr to find your
# category list.
# default: The second-to-last part of your hostname.
GNATS_SITE = paragon1

# NOTE: Don't wrap DEFAULT_RELEASE or DEFAULT_ORGANIZATION with
# quotes, or things will break.

# The default release for the `>Release:' field of a PR, for send-pr.
# default: unknown-1.0
DEFAULT_RELEASE = unknown-1.0

# The default organization for PRs.
# default: $(GNATS_SITE)
DEFAULT_ORGANIZATION = $(GNATS_SITE)

# If true, use at_pr (tell the person responsible when a
# PR hasn't been analyzed within its notification period)
# default: 1 (true)
NOTIFY = 1

# If true, send a reply to the person who submitted the bug, telling
# them the PR number and other information.
# default: 1 (true)
ACKNOWLEDGE = 1

# Define this to be the submitter-id to be used when a PR comes in either
# without one, or with a bogus id.  An alternative to "unknown" might be
# "net", if you anticipate getting lots of reports from the Net. 
# default: unknown
DEFAULT_SUBMITTER = unknown

# Every email message has one or more `Received:' headers to tell you
# how a message got from the sender to the recipient.  Define this to
# be TRUE if you want GNATS to preserve all of those `Received:' headers.
# If you tend not to use the information, define it to be FALSE so GNATS
# will only keep the first `Received:' header. 
# default: 1 (true)
KEEP_RECEIVED_HEADERS = 1

# Address of the person to receive all problem reports which do not
# have a valid category (aka, they go into `pending'), or other related
# problems.
# default: gnats-admin
GNATS_ADMIN = gnats-admin

# The submitter-id for your site (used only by send-pr)
# default: unknown
SUBMITTER = $(GNATS_SITE)

# Configuration for business hours calculation
# default: 8-5, Mon-Fri
BDAY_START  = 8
BDAY_END    = 17
BWEEK_START = 1
BWEEK_END   = 5

# The command line used to run a mailer which gets the address list from
# mail headers
# default: /usr/{lib,sbin}/sendmail -oi -t
MAIL_AGENT = /usr/lib/sendmail -oi -t

# In debug mode, all mail generated by GNATS will go to gnats-admin, rather than
# the intended recipient.
# default: 0 (false)
DEBUG_MODE = 0

#**** End of GNATS-specific configuration variables.

CC = gcc
AR = ar
AR_FLAGS = rc

# Set RANLIB = echo if your system doesn't have or need ranlib.
RANLIB = :

BISON = bison -y
DIFFOPT = -u

# These are set by autoconf.
DEFS = -DHAVE_CONFIG_H
LIBS = 

M4 = m4
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi

# Where to find texinfo.tex to format docs with TeX
TEXIDIR = $(srcdir)/../texinfo

# Where to find sundry TeX/Texinfo files
TEXINPUTS = $(srcdir)/../send-pr:$(TEXIDIR)

INSTALL = $(srcdir)/../install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644

CFLAGS = -g
LDFLAGS = $(CFLAGS)

prefix = /usr/local

exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
statedir = $(prefix)/lib
tooldir = $(libdir)

program_transform_name =

# Edit this to be the location of your emacs lisp files.
lispdir = $(datadir)/emacs/lisp

datadir = $(prefix)/lib
mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/info
includedir = $(prefix)/include
docdir = $(datadir)/doc

# End of system configuration section.

VERSION = 3.2

SHELL = /bin/sh

#### Host-, target-, and site-specific makefiles are inserted here.

SOURCES = btime.c main.c file-pr.c resp-lookup.c internal.c
OBJECTS = btime.o main.o file-pr.o resp-lookup.o version.o internal.o regex.o

LIBSRC = files.c headers.c misc.c pr.c xmalloc.c index.c config.c
LIBOBJS = files.o headers.o misc.o pr.o xmalloc.o index.o config.o

LIBGNATS = libgnats.a

DISTFILES= $(SOURCES) COPYING ChangeLog INSTALL Makefile.in README \
categories responsible submitters regex.c regex.h \
at-pr.sh config.h configure configure.in error.c files.h getdate.y \
getdate.c globals.h headers.h index.c mkcat.sh pathmax.h pr.h \
pr-addr.c gnats-dirs.h gnats-el.in gnats.h query-pr.c queue-pr.c \
rmcat.sh xmalloc.c gnats.texi p-usage.texi p-admin.texi \
p-inst.texi flowchart.eps config.c config.c.in mail-query.sh

INCLUDEDIR = -I. -I$(srcdir) -I$(srcdir)/../include

# Where is the "-liberty" library, containing getopt and obstack?
LIBIBERTY = `if [ -f ../libiberty/libiberty.a ] ; then echo ../libiberty/libiberty.a ; else echo -liberty ; fi`

# Variables that the send-pr Makefile will want to have changed.
GNATS_VARS = \
  "GNATS_ROOT=$(GNATS_ROOT)" \
  "GNATS_ADDR=$(GNATS_ADDR)" \
  "VERSION=$(VERSION)" \
  "DEFAULT_RELEASE=$(DEFAULT_RELEASE)" \
  "DEFAULT_ORGANIZATION=$(DEFAULT_ORGANIZATION)" \
  "GNATS_SITE=$(GNATS_SITE)" \
  "SUBMITTER=$(SUBMITTER)" \
  "GNATS_INSTALL=$(GNATS_INSTALL)" \
  "MAIL_AGENT=$(MAIL_AGENT)"

GNATS_DEFS = \
  -DGNATS_ROOT="\"$(GNATS_ROOT)\"" \
  -DGNATS_ADDR="\"$(GNATS_ADDR)\"" \
  -DGNATS_ADMIN="\"$(GNATS_ADMIN)\"" \
  -DDEFAULT_SUBMITTER="\"$(DEFAULT_SUBMITTER)\"" \
  -DNOTIFY=$(NOTIFY) \
  -DACKNOWLEDGE=$(ACKNOWLEDGE) \
  -DKEEP_RECEIVED_HEADERS=$(KEEP_RECEIVED_HEADERS) \
  -DMAIL_AGENT="\"$(MAIL_AGENT)\"" \
  -DBINDIR="\"$(libdir)/gnats\"" \
  -DBDAY_START=$(BDAY_START) \
  -DBDAY_END=$(BDAY_END) \
  -DBWEEK_START=$(BWEEK_START) \
  -DBWEEK_END=$(BWEEK_END)

FLAGS_TO_PASS = \
  "SHELL=$(SHELL)" \
  "INSTALL=$(INSTALL)" \
  "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  "INSTALL_DATA=$(INSTALL_DATA)"

GNATS_ALL = all-tools

EXTRA_STUFF =
EXTRA_INSTALL =

all: $(GNATS_ALL)

all-gnats: all-tools file-pr queue-pr mail-query gen-index at-pr mkcat rmcat \
	mkdist config config-send-pr gnats-man-pages $(EXTRA_STUFF)

all-tools: $(LIBGNATS) query-pr pr-addr pr-edit edit-pr gnats.elc config-send-pr\
	tools-man-pages

$(LIBGNATS): $(LIBOBJS)
	rm -f $(LIBGNATS)
	$(AR) $(AR_FLAGS) $(LIBGNATS) $(LIBOBJS)
	$(RANLIB) $(LIBGNATS)

file-pr: $(OBJECTS) $(LIBGNATS)
	rm -f file-pr
	$(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBGNATS) $(LIBIBERTY) $(LIBS)

.c.o:
	$(CC) -c $(INCLUDEDIR) $(CFLAGS) $(CPPFLAGS) $(DEFS) $<

config.o: config.c config.h Makefile globals.h
	$(CC) -c $(INCLUDEDIR) $(CFLAGS) $(CPPFLAGS) $(DEFS) $(GNATS_DEFS) $<

config.c: config.c.in config.m4
	rm -f $(srcdir)/config.c
	$(M4) $(srcdir)/config.m4 $(srcdir)/config.c.in > $(srcdir)/config.c

config: Makefile
	rm -f $@
	echo "GNATS_ADDR=\"$(GNATS_ADDR)\"" > $@-t
	echo "GNATS_ADMIN=\"$(GNATS_ADMIN)\"" >> $@-t
	echo "GNATS_SITE=\"$(GNATS_SITE)\"" >> $@-t
	echo "SUBMITTER=\"$(SUBMITTER)\"" >> $@-t
	echo "DEFAULT_RELEASE=\"$(DEFAULT_RELEASE)\"" >> $@-t
	echo "DEFAULT_ORGANIZATION=\"$(DEFAULT_ORGANIZATION)\"" >> $@-t
	echo "NOTIFY=$(NOTIFY)" >> $@-t
	echo "ACKNOWLEDGE=$(ACKNOWLEDGE)" >> $@-t
	echo "DEFAULT_SUBMITTER=\"$(DEFAULT_SUBMITTER)\"" >> $@-t
	echo "KEEP_RECEIVED_HEADERS=$(KEEP_RECEIVED_HEADERS)" >> $@-t
	echo "BDAY_START=$(BDAY_START)" >> $@-t
	echo "BDAY_END=$(BDAY_END)" >> $@-t
	echo "BWEEK_START=$(BWEEK_START)" >> $@-t
	echo "BWEEK_END=$(BWEEK_END)" >> $@-t
	echo "DEBUG_MODE=$(DEBUG_MODE)" >> $@-t
	mv $@-t $@

version.c: Makefile
	rm -f version.c
	echo 'char *version_string = "$(VERSION)";' > $@-t
	mv $@-t $@

query-pr: query-pr.o getdate.o version.o regex.o $(LIBGNATS)
	rm -f query-pr
	$(CC) $(LDFLAGS) -o $@ query-pr.o getdate.o version.o \
		regex.o $(LIBGNATS) $(LIBIBERTY) $(LIBS)

queue-pr: queue-pr.o $(LIBGNATS) internal.o version.o
	rm -f queue-pr
	$(CC) $(LDFLAGS) -o $@ queue-pr.o internal.o version.o \
		$(LIBGNATS) $(LIBIBERTY) $(LIBS)

pr-edit: pr-edit.o version.o $(LIBGNATS) internal.o
	rm -f pr-edit
	$(CC) $(LDFLAGS) -o $@ pr-edit.o internal.o version.o \
		$(LIBGNATS) $(LIBIBERTY) $(LIBS)

pr-addr: pr-addr.o version.o $(LIBGNATS)
	rm -f pr-addr
	$(CC) $(LDFLAGS) -o $@ pr-addr.o version.o $(LIBGNATS) \
		$(LIBIBERTY) $(LIBS)

gen-index: gen-index.o version.o $(LIBGNATS)
	rm -f gen-index
	$(CC) $(LDFLAGS) -o $@ gen-index.o version.o $(LIBGNATS) \
		$(LIBIBERTY) $(LIBS)

at-pr: at-pr.sh Makefile
	sed -e 's,xVERSIONx,$(VERSION),g' \
	    -e 's,xGNATS_ROOTx,$(GNATS_ROOT),g' \
	    -e 's,xMAIL_AGENTx,$(MAIL_AGENT),g' \
	    -e 's,xLIBDIRx,$(libdir),g' $(srcdir)/at-pr.sh > $@-t
	mv $@-t $@
	chmod a+x $@

mkcat: mkcat.sh Makefile
	sed -e 's,xGNATS_ROOTx,$(GNATS_ROOT),g' \
	    -e 's,xDATADIRx,$(datadir),g' \
	    -e 's,xGNATS_SITEx,$(GNATS_SITE),g' $(srcdir)/mkcat.sh > $@-t
	mv $@-t $@
	chmod a+x $@

rmcat: rmcat.sh Makefile
	sed -e 's,xGNATS_ROOTx,$(GNATS_ROOT),g' \
	    -e 's,xDATADIRx,$(datadir),g' \
	    -e 's,xGNATS_SITEx,$(GNATS_SITE),g' $(srcdir)/rmcat.sh > $@-t
	mv $@-t $@
	chmod a+x $@

mkdist: mkdist.sh Makefile
	sed -e 's,XGNATS_ROOTX,$(GNATS_ROOT),g' \
	    -e 's,XDATADIRX,$(datadir),g' \
	    -e 's,XGNATS_SITEX,$(GNATS_SITE),g' $(srcdir)/mkdist.sh > $@-t
	mv $@-t $@
	chmod a+x $@

edit-pr: edit-pr.sh Makefile
	sed -e 's,xGNATS_ROOTx,$(GNATS_ROOT),g' \
	    -e 's,xLIBDIRx,$(libdir),g' \
	    -e 's,xMAIL_AGENTx,$(MAIL_AGENT),g' \
	    -e 's,xVERSIONx,$(VERSION),g' $(srcdir)/edit-pr.sh > $@-t
	mv $@-t $@
	chmod a+x $@

mail-query: mail-query.sh Makefile
	sed -e 's,xGNATS_ROOTx,$(GNATS_ROOT),g' \
	    -e 's,xGNATS_ADMINx,$(GNATS_ADMIN),g' \
	    -e 's,xMAIL_AGENTx,$(MAIL_AGENT),g' \
	    -e 's,xBINDIRx,$(bindir),g' \
	    $(srcdir)/mail-query.sh > $@-t
	mv $@-t $@
	chmod a+x $@

gnats.el: gnats-el.in Makefile
	sed -e 's,xVERSIONx,$(VERSION),g' \
	    -e 's,xGNATS_ADDRx,$(GNATS_ADDR),g' \
	    -e 's,xLIBDIRx,$(libdir),g' \
	    -e 's,xDIFFOPTx,$(DIFFOPT),g' \
	    -e 's,xGNATS_ROOTx,$(GNATS_ROOT),g' $(srcdir)/gnats-el.in > $@-t
	mv $@-t $@

gnats.elc: gnats.el $(srcdir)/../send-pr/send-pr-el.in
	-PWD=`pwd` emacs -batch -q -l $(srcdir)/../send-pr/send-pr-el.in \
		-l ./gnats.el -f batch-byte-compile gnats.el

getdate.c: getdate.y
	@echo expect 9 shift/reduce conflicts
	$(BISON) $(srcdir)/getdate.y
	mv y.tab.c getdate.c

config-send-pr:
	@if [ ! -d ../send-pr ]; then \
	  echo "The send-pr directory doesn't seem to be there!" ; \
	  exit 1 ; \
	else \
	  ( cd ../send-pr ; $(MAKE) $(GNATS_VARS) gnats-build ) ; \
	  true ; \
	fi

# Misc targets.

GNATS_INSTALL = install-tools

install: $(GNATS_INSTALL)

install-tools: install-tools-bin install-tools-man

# Create $(datadir)/gnats so that mkcat can find it
install-tools-bin: all-tools
	$(INSTALL) -d $(datadir)/gnats
	$(INSTALL_PROGRAM) query-pr $(bindir)/query-pr
	$(INSTALL_PROGRAM) edit-pr $(bindir)/edit-pr
	$(INSTALL_PROGRAM) pr-edit $(libdir)/gnats/pr-edit
	$(INSTALL_PROGRAM) pr-addr $(libdir)/gnats/pr-addr
	$(INSTALL_DATA) gnats.el $(lispdir)/gnats.el
	-$(INSTALL_DATA) gnats.elc $(lispdir)/gnats.elc
	@if [ `whoami` = root ] ; then \
	  echo "chown gnats $(libdir)/gnats/pr-edit" ; \
	  echo "chmod 4755 $(libdir)/gnats/pr-edit" ; \
	  chown gnats $(libdir)/gnats/pr-edit ; \
	  chmod 4755 $(libdir)/gnats/pr-edit ; \
        elif [ `whoami` = gnats ] ; then \
	  echo "chmod 4755 $(libdir)/gnats/pr-edit" ; \
	  chmod 4755 $(libdir)/gnats/pr-edit ; \
        else \
	  echo "*** Warning: Must make pr-edit suid gnats" ; \
	fi

EXTRA_INSTALL =

install-gnats: install-gnats-bin install-gnats-man $(EXTRA_INSTALL)

install-gnats-bin: all-gnats install-tools-bin
	$(INSTALL) -d $(GNATS_ROOT)
	$(INSTALL) -d $(libdir)/gnats
	$(INSTALL) -d $(GNATS_ROOT)/gnats-adm
	$(INSTALL) -d $(GNATS_ROOT)/gnats-queue
	$(INSTALL) -d $(GNATS_ROOT)/pending
	$(INSTALL_PROGRAM) file-pr $(libdir)/gnats/file-pr
	$(INSTALL_PROGRAM) at-pr $(libdir)/gnats/at-pr
	$(INSTALL_PROGRAM) mkcat $(libdir)/gnats/mkcat
	$(INSTALL_PROGRAM) rmcat $(libdir)/gnats/rmcat
	$(INSTALL_PROGRAM) mkdist $(libdir)/gnats/mkdist
	$(INSTALL_PROGRAM) queue-pr $(libdir)/gnats/queue-pr
	$(INSTALL_PROGRAM) gen-index $(libdir)/gnats/gen-index
	$(INSTALL_PROGRAM) mail-query $(libdir)/gnats/mail-query
	@if [ `whoami` = root ] ; then \
	  echo "chown gnats $(libdir)/gnats/queue-pr $(libdir)/gnats/gen-index" ;\
	  echo "chmod 4755 $(libdir)/gnats/queue-pr $(libdir)/gnats/gen-index" ;\
	  echo "chown gnats $(GNATS_ROOT) $(GNATS_ROOT)/gnats-adm $(GNATS_ROOT)/pending";\
	  echo "chown gnats $(GNATS_ROOT)/gnats-queue" ; \
	  chown gnats $(libdir)/gnats/queue-pr $(libdir)/gnats/gen-index ; \
	  chmod 4755 $(libdir)/gnats/queue-pr $(libdir)/gnats/gen-index ; \
	  chown gnats $(GNATS_ROOT) $(GNATS_ROOT)/gnats-adm $(GNATS_ROOT)/pending ;\
	  chown gnats $(GNATS_ROOT)/gnats-queue ; \
	elif [ `whoami` = gnats ] ; then \
	  echo "chmod 4755 $(libdir)/gnats/queue-pr $(libdir)/gnats/gen-index" ;\
	  chmod 4755 $(libdir)/gnats/queue-pr $(libdir)/gnats/gen-index ; \
	else \
	  echo "*** Warning: must chown ${GNATS_ROOT} to the gnats user and" ; \
	  echo "***   make queue-pr and gen-index suid gnats." ; \
	fi
	@if [ -f $(GNATS_ROOT)/gnats-adm/categories ]; then \
	   echo "Not putting examples in gnats-adm, files are already there." ; \
	   true ; \
	else \
	   $(INSTALL_DATA) -o gnats $(srcdir)/categories \
		$(GNATS_ROOT)/gnats-adm/categories ; \
	   $(INSTALL_DATA) -o gnats $(srcdir)/responsible \
		$(GNATS_ROOT)/gnats-adm/responsible ; \
	   $(INSTALL_DATA) -o gnats $(srcdir)/submitters \
		$(GNATS_ROOT)/gnats-adm/submitters ; \
	fi
	@if [ -f $(GNATS_ROOT)/gnats-adm/config ]; then \
	   echo "Not putting config file in gnats-adm, it's already there." ; \
	   true ; \
	else \
	   $(INSTALL_DATA) -o gnats config $(GNATS_ROOT)/gnats-adm/config ; \
	fi

install-info:
	for i in gnats.info* ; do \
		$(INSTALL_DATA) $$i $(infodir)/$$i ; \
	done

install-gnats-man install-tools-man:
	@cd man ; $(MAKE) $(FLAGS_TO_PASS) $(GNATS_VARS) $(GNATS_INSTALL)

# Don't use rm -rf in case there's other stuff in the directories
uninstall:
	-rm -f $(bindir)/edit-pr
	-rm -f $(bindir)/query-pr
	-rm -f $(libdir)/gnats/pr-addr
	-rm -f $(libdir)/gnats/pr-edit
	-rm -f $(libdir)/gnats/at-pr
	-rm -f $(libdir)/gnats/file-pr
	-rm -f $(libdir)/gnats/queue-pr
	-rm -f $(libdir)/gnats/mkcat
	-rm -f $(libdir)/gnats/rmcat
	-rm -f $(libdir)/gnats/mkdist
	-rm -f $(libdir)/gnats/gen-index
	-rm -f $(libdir)/gnats/mail-query
	-rmdir $(libdir)/gnats
	-rm -f $(lispdir)/gnats.el

	-rm -f $(infodir)/gnats.info*
	@cd man; $(MAKE) $(FLAGS_TO_PASS) $(GNATS_VARS) uninstall

TAGS: $(SOURCES) $(LIBSRC) gnats-el.in
	ln -s gnats-el.in gnats.el
	ln -s ../send-pr/send-pr-el.in send-pr.el
	etags -f /tmp/tag$$$$ $(SOURCES) $(LIBSRC) *.h gnats.el ; \
	sed -e 's/gnats.el/gnats-el.in/' \
	    -e 's,send-pr.el,../send-pr/send-pr-el.in,' \
	    /tmp/tag$$$$ > TAGS ; \
	rm /tmp/tag$$$$
	rm gnats.el send-pr.el

gnats-man-pages tools-man-pages:
	@( cd man ; $(MAKE) $(GNATS_VARS) $(GNATS_ALL) )

info: gnats.info
dvi: gnats.dvi

version.texi:
	-rm -f $@
	echo "@set VERSION $(VERSION)" > $@-t
	mv $@-t $@

gnats.info: $(srcdir)/gnats.texi version.texi \
	$(srcdir)/p-usage.texi $(srcdir)/p-admin.texi \
	$(srcdir)/p-inst.texi \
	$(srcdir)/../send-pr/states.texi $(srcdir)/../send-pr/fields.texi \
	$(srcdir)/../send-pr/s-usage.texi
	$(MAKEINFO) -I$(srcdir) -I$(srcdir)/../send-pr -o gnats.info $(srcdir)/gnats.texi

gnats.dvi: $(srcdir)/gnats.texi version.texi \
	$(srcdir)/p-usage.texi $(srcdir)/p-admin.texi \
	$(srcdir)/p-inst.texi \
	$(srcdir)/../send-pr/states.texi $(srcdir)/../send-pr/fields.texi \
	$(srcdir)/../send-pr/s-usage.texi
	TEXINPUTS=$(TEXINPUTS) $(TEXI2DVI) $(srcdir)/gnats.texi

# Clean things up.

clean: clean-man doclean
doclean: domostlyclean
	-rm -f *.o core gnats.el gnats.elc queue-pr gnats at-pr mkcat rmcat
	-rm -f file-pr mkdist mail-query
	-rm -f $(LIBGNATS)
	-rm -f pr-addr query-pr pr-edit edit-pr gen-index
	-rm -f *.dvi version.c
clean-man:
	@( cd man ; $(MAKE) clean )

mostlyclean: mostlyclean-man domostlyclean
domostlyclean:
	-rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg *.i *.s *.aux
mostlyclean-man:
	@( cd man ; $(MAKE) mostlyclean )

distclean: distclean-man dodistclean
dodistclean: doclean
	-rm -f Makefile config.status autoconf.h config
	-rm -rf =* ./"#"* *~*
	-rm -f *.orig *.rej
distclean-man:
	@( cd man ; $(MAKE) distclean )

realclean: realclean-man dodistclean
dorealclean: dodistclean
	-rm -f gnats.info* gnats.??s getdate.c config.c
realclean-man:
	@( cd man ; $(MAKE) realclean )

# FIXME
dist:
	echo need to do something for dist

diststuff: getdate.c config.c

# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:

Makefile : $(srcdir)/Makefile.in
	$(SHELL) config.status

# Dependencies

btime.o: $(srcdir)/gnats.h $(srcdir)/../include/ansidecl.h $(srcdir)/headers.h 
btime.o: $(srcdir)/pr.h $(srcdir)/files.h $(srcdir)/config.h autoconf.h 
btime.o: $(srcdir)/globals.h $(srcdir)/../include/ansidecl.h
config.o: $(srcdir)/pr.h $(srcdir)/headers.h $(srcdir)/files.h $(srcdir)/gnats.h
config.o: $(srcdir)/pathmax.h $(srcdir)/config.h autoconf.h $(srcdir)/gnats.h
file-pr.o: $(srcdir)/../include/ansidecl.h $(srcdir)/headers.h $(srcdir)/pr.h
file-pr.o: $(srcdir)/files.h $(srcdir)/globals.h
file-pr.o: $(srcdir)/pathmax.h $(srcdir)/regex.h
files.o: $(srcdir)/config.h autoconf.h $(srcdir)/gnats.h
files.o: $(srcdir)/../include/ansidecl.h $(srcdir)/headers.h $(srcdir)/pr.h
files.o: $(srcdir)/files.h $(srcdir)/pathmax.h $(srcdir)/../include/getopt.h
files.o: $(srcdir)/globals.h $(srcdir)/config.h autoconf.h
gen-index.o: $(srcdir)/../include/ansidecl.h $(srcdir)/headers.h
gen-index.o: $(srcdir)/pr.h $(srcdir)/files.h $(srcdir)/gnats.h
gen-index.o: $(srcdir)/globals.h $(srcdir)/gnats-dirs.h $(srcdir)/pathmax.h
getdate.o: $(srcdir)/config.h autoconf.h $(srcdir)/globals.h
headers.o: $(srcdir)/../include/ansidecl.h $(srcdir)/pr.h
headers.o: $(srcdir)/headers.h $(srcdir)/files.h $(srcdir)/gnats.h 
headers.o: $(srcdir)/gnats.h $(srcdir)/config.h autoconf.h
headers.o: $(srcdir)/../include/ansidecl.h
index.o: $(srcdir)/pr.h $(srcdir)/files.h $(srcdir)/headers.h
index.o: $(srcdir)/globals.h $(srcdir)/pathmax.h $(srcdir)/config.h autoconf.h
index.o: $(srcdir)/gnats.h $(srcdir)/../include/ansidecl.h
internal.o: $(srcdir)/headers.h
internal.o: $(srcdir)/pr.h $(srcdir)/files.h
internal.o: $(srcdir)/globals.h $(srcdir)/pathmax.h $(srcdir)/config.h
internal.o: autoconf.h $(srcdir)/../include/getopt.h
main.o: $(srcdir)/../include/ansidecl.h $(srcdir)/gnats.h $(srcdir)/headers.h
main.o: $(srcdir)/pr.h $(srcdir)/files.h
main.o: $(srcdir)/globals.h $(srcdir)/config.h autoconf.h $(srcdir)/gnats.h
misc.o: $(srcdir)/../include/ansidecl.h $(srcdir)/headers.h
misc.o: $(srcdir)/pr.h $(srcdir)/files.h
misc.o: $(srcdir)/globals.h $(srcdir)/pathmax.h $(srcdir)/gnats.h
pr-addr.o: $(srcdir)/../include/ansidecl.h $(srcdir)/headers.h $(srcdir)/pr.h
pr-addr.o: $(srcdir)/files.h
pr-edit.o: $(srcdir)/../include/getopt.h
pr-edit.o: $(srcdir)/../include/ansidecl.h $(srcdir)/gnats.h
pr-edit.o: $(srcdir)/headers.h
pr-edit.o: $(srcdir)/pr.h $(srcdir)/files.h
pr-edit.o: $(srcdir)/pathmax.h $(srcdir)/config.h autoconf.h
pr-edit.o: $(srcdir)/globals.h
pr.o: $(srcdir)/../include/ansidecl.h $(srcdir)/pr.h
pr.o: $(srcdir)/headers.h $(srcdir)/files.h $(srcdir)/gnats.h
pr.o: $(srcdir)/../include/getopt.h $(srcdir)/config.h autoconf.h
query-pr.o: $(srcdir)/gnats.h $(srcdir)/../include/ansidecl.h
query-pr.o: $(srcdir)/headers.h $(srcdir)/pr.h
query-pr.o: $(srcdir)/files.h $(srcdir)/pathmax.h
query-pr.o: $(srcdir)/regex.h
queue-pr.o: $(srcdir)/config.h autoconf.h $(srcdir)/../include/getopt.h
queue-pr.o: $(srcdir)/gnats-dirs.h
queue-pr.o: $(srcdir)/globals.h $(srcdir)/../include/ansidecl.h
queue-pr.o: $(srcdir)/pr.h $(srcdir)/headers.h
queue-pr.o: $(srcdir)/files.h $(srcdir)/gnats.h $(srcdir)/pathmax.h
regex.o: $(srcdir)/regex.h $(srcdir)/gnats.h $(srcdir)/../include/ansidecl.h
resp-lookup.o: $(srcdir)/headers.h $(srcdir)/pr.h
resp-lookup.o: $(srcdir)/files.h $(srcdir)/globals.h
