1# Makefile for GNU send-pr.
2# Copyright (C) 1993 Free Software Foundation, Inc.
3#
4# This file is part of GNU GNATS.
5#
6# GNU GNATS is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10# 
11# GNU GNATS is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15# 
16# You should have received a copy of the GNU General Public License
17# along with GNU GNATS; see the file COPYING.  If not, write to
18# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20# Start of system configuration section.
21
22srcdir = @srcdir@
23VPATH = $(srcdir)
24
25# Where the GNATS database and master configuration stuff lives.
26GNATS_ROOT = @GNATS_ROOT@
27
28# Email address to which people should submit bugs.
29GNATS_ADDR = @GNATS_ADDR@
30
31# The default release for this send-pr.
32DEFAULT_RELEASE = @DEFAULT_RELEASE@
33
34# The default organization for this send-pr.
35DEFAULT_ORGANIZATION = @DEFAULT_ORGANIZATION@
36
37# The default GNATS site for send-pr. 
38GNATS_SITE = @GNATS_SITE@
39
40# The submitter-id for your site.
41SUBMITTER = @SUBMITTER@
42
43# Command line to use for mailer
44MAIL_AGENT = @MAIL_AGENT@
45
46# Command line to display the passwd database
47PASSWD = @PASSWD@
48
49# What to install
50SEND_PR_INSTALL = install-norm install-categories
51
52CC = cc
53
54AR = ar
55AR_FLAGS = rc
56
57# Set RANLIB = echo if your system doesn't have or need ranlib.
58RANLIB = ranlib
59
60# Where to find texinfo.tex to format docn with TeX
61TEXIDIR = $(srcdir)/../texinfo
62
63MAKEINFO = makeinfo
64TEXI2DVI = texi2dvi
65
66INSTALL = $(srcdir)/../install.sh -c
67INSTALL_PROGRAM = $(INSTALL) 
68INSTALL_DATA = $(INSTALL) -m 644
69
70CFLAGS = -g
71LDFLAGS = -g
72
73ECHON = @ECHON@
74
75EMACS = `if [ -f ./../emacs19/Makefile ] ; then \
76		echo "EMACSLOADPATH=\`cd $(srcdir)/../emacs19/lisp ; pwd\` ; \
77		      export EMACSLOADPATH ; \
78		      ./../emacs19/src/emacs" ; \
79	else  \
80		echo emacs ; \
81	fi`
82
83prefix = @prefix@
84
85exec_prefix = $(prefix)
86bindir = $(exec_prefix)/bin
87libdir = $(exec_prefix)/lib
88tooldir = $(libdir)
89
90program_transform_name =
91
92# Edit this to be the location of your emacs lisp files.
93lispdir = @LISPDIR@
94
95datadir = $(prefix)/lib
96mandir = $(prefix)/man
97man1dir = $(mandir)/man1
98man2dir = $(mandir)/man2
99man3dir = $(mandir)/man3
100man4dir = $(mandir)/man4
101man5dir = $(mandir)/man5
102man6dir = $(mandir)/man6
103man7dir = $(mandir)/man7
104man8dir = $(mandir)/man8
105man9dir = $(mandir)/man9
106infodir = $(prefix)/info
107includedir = $(prefix)/include
108docdir = $(datadir)/doc
109
110# End of system configuration section.
111
112VERSION = 3.95
113
114SHELL = /bin/sh
115
116#### System configurations, if any, are inserted here.
117
118DISTFILES= COPYING ChangeLog Makefile.in README configure.in \
119install-sid.sh send-pr-el.in send-pr.man send-pr.texi fields.texi \
120states.texi s-usage.texi categ.texi send-pr.sh
121
122all: send-pr install-sid send-pr.elc send-pr.1
123
124send-pr: send-pr.sh Makefile
125	${TOOL_SED} -e 's,xVERSIONx,$(VERSION),' \
126	    -e 's,xGNATS_ROOTx,$(GNATS_ROOT),' \
127	    -e 's,xGNATS_ADDRx,$(GNATS_ADDR),' \
128	    -e 's,xGNATS_SITEx,$(GNATS_SITE),' \
129	    -e 's,xSUBMITTERx,$(SUBMITTER),' \
130	    -e 's,xECHONx,$(ECHON),' \
131	    -e 's,xMAIL_AGENTx,$(MAIL_AGENT),' \
132	    -e 's,xPASSWDx,$(PASSWD),' \
133	    -e 's%xDEFAULT_ORGANIZATIONx%$(DEFAULT_ORGANIZATION)%' \
134	    -e 's,xDEFAULT_RELEASEx,$(DEFAULT_RELEASE),' \
135	    -e 's,xDATADIRx,$(datadir),' $(srcdir)/send-pr.sh > $@-t
136	mv $@-t $@
137	chmod 755 $@
138
139install-sid: install-sid.sh Makefile
140	${TOOL_SED} -e 's,xBINDIRx,$(bindir),g' \
141	    -e 's,xVERSIONx,$(VERSION),g' $(srcdir)/install-sid.sh > $@-t
142	mv $@-t $@
143	chmod 755 $@
144
145send-pr.el: send-pr-el.in Makefile
146	${TOOL_SED} -e 's,xVERSIONx,$(VERSION),' \
147	    -e 's,xGNATS_ROOTx,$(GNATS_ROOT),' \
148	    -e 's,xGNATS_SITEx,$(GNATS_SITE),' \
149	    -e 's,xDATADIRx,$(datadir),' \
150	    -e 's,xSUBMITTERx,$(SUBMITTER),' \
151	    -e 's,xDEFAULT_RELEASEx,$(DEFAULT_RELEASE),' \
152		$(srcdir)/send-pr-el.in \
153	    > $@-t
154	mv $@-t $@
155
156send-pr.elc: send-pr.el
157	-PWD=`pwd` eval $(EMACS) -batch -q -f batch-byte-compile send-pr.el
158
159install: $(SEND_PR_INSTALL)
160install-tools: install-norm install-categories
161install-gnats: install-norm install-gnats-dist install-categories
162
163install-norm all-gnats:
164	$(INSTALL_PROGRAM) send-pr $(bindir)/send-pr
165	$(INSTALL_PROGRAM) install-sid $(bindir)/install-sid
166	$(INSTALL_DATA) send-pr.1 $(man1dir)/send-pr.1
167	$(INSTALL_DATA) send-pr.el $(lispdir)/send-pr.el
168	if [ -f send-pr.elc ]; then \
169	  $(INSTALL_DATA) send-pr.elc $(lispdir)/send-pr.elc; \
170	else true; fi
171
172# Install the Cygnus category list for bug reports.
173install-categories:
174	$(INSTALL_DATA) $(srcdir)/categories $(datadir)/gnats/cygnus
175
176install-gnats-dist:
177	$(INSTALL_DATA) $(srcdir)/COPYING $(datadir)/gnats/dist/COPYING
178	$(INSTALL_DATA) $(srcdir)/README $(datadir)/gnats/dist/README
179	$(INSTALL_DATA) $(srcdir)/INSTALL $(datadir)/gnats/dist/INSTALL
180	$(INSTALL_DATA) $(srcdir)/MANIFEST $(datadir)/gnats/dist/MANIFEST
181	${TOOL_SED} \
182	    -e 's/"DEFAULT_RELEASE") ".*"/"DEFAULT_RELEASE") "@''DEFAULT_RELEASE@"/' \
183	    -e 's/"SUBMITTER") ".*"/"SUBMITTER") "@''SUBMITTER@"/' \
184	    -e 's/"DATADIR") ".*"/"DATADIR") "@''DATADIR@"/' \
185	    send-pr.el > $(datadir)/gnats/dist/send-pr-el.inT
186	mv $(datadir)/gnats/dist/send-pr-el.inT \
187		$(datadir)/gnats/dist/send-pr-el.in
188	${TOOL_SED} -e 's/GNATS_ROOT=.*/GNATS_ROOT=/' \
189	    -e 's/SUBMITTER=.*/SUBMITTER=@''SUBMITTER@/' \
190	    -e 's/DEFAULT_RELEASE=.*/DEFAULT_RELEASE="@''DEFAULT_RELEASE@"/' \
191	    -e 's/DEFAULT_ORGANIZATION=.*/DEFAULT_ORGANIZATION=/' \
192	    -e 's/DATADIR=.*/DATADIR=@''DATADIR@/' \
193	    send-pr > $(datadir)/gnats/dist/send-pr.sh-t
194	mv $(datadir)/gnats/dist/send-pr.sh-t \
195		$(datadir)/gnats/dist/send-pr.sh
196	${TOOL_SED} -e 's/^BINDIR=.*/BINDIR=@''BINDIR@/' \
197	    install-sid > $(datadir)/gnats/dist/install-sid.sT
198	mv $(datadir)/gnats/dist/install-sid.sT \
199		$(datadir)/gnats/dist/install-sid.sh
200	$(INSTALL_DATA) send-pr.1 $(datadir)/gnats/dist/send-pr.1
201	for i in `if [ ! -f send-pr.info ];then echo $(srcdir)/;fi`send-pr.info* ; do \
202		$(INSTALL_DATA) $$i $(datadir)/gnats/dist/$$i ; \
203	done
204	$(INSTALL_DATA) $(srcdir)/send-pr.texi \
205		$(datadir)/gnats/dist/send-pr.texi
206	$(INSTALL_DATA) $(srcdir)/s-usage.texi \
207		$(datadir)/gnats/dist/s-usage.texi
208	$(INSTALL_DATA) $(srcdir)/categ.texi \
209		$(datadir)/gnats/dist/categ.texi
210	$(INSTALL_DATA) $(srcdir)/fields.texi \
211		$(datadir)/gnats/dist/fields.texi
212	$(INSTALL_DATA) $(srcdir)/states.texi \
213		$(datadir)/gnats/dist/states.texi
214	$(INSTALL_DATA) $(srcdir)/../texinfo/texinfo.tex \
215		$(datadir)/gnats/dist/texinfo.tex
216
217install-info: send-pr.info
218	for i in send-pr.info* ; do \
219		$(INSTALL_DATA) $$i $(infodir)/$$i ; \
220	done
221
222uninstall:
223	-rm -f $(bindir)/send-pr $(bindir)/install-sid
224	-rm -f $(datadir)/gnats/$(GNATS_SITE)
225	-[ x$$GNATS_ROOT = x ] || rm -rf $(datadir)/gnats/dist
226	-rmdir $(datadir)/gnats
227	-rm -f $(man1dir)/send-pr.1
228	-rm -f $(lispdir)/send-pr.el $(lispdir)/send-pr.elc
229	-rm -f $(infodir)/send-pr.info*
230
231TAGS:
232
233info: send-pr.info
234dvi: send-pr.dvi
235
236version.texi: Makefile
237	echo "@set VERSION $(VERSION)" > $@-t
238	mv $@-t $@
239
240send-pr.1: Makefile
241	${TOOL_SED} -e 's,xGNATS_ROOTx,$(GNATS_ROOT),g' \
242	    -e 's,xVERSIONx,$(VERSION),g' $(srcdir)/send-pr.man > $@-t
243	mv $@-t $@
244
245send-pr.info: send-pr.texi version.texi fields.texi s-usage.texi categ.texi
246	$(MAKEINFO) -I $(srcdir) -o send-pr.info $(srcdir)/send-pr.texi
247
248send-pr.dvi: version.texi
249	$(TEXI2DVI) $(srcdir)/send-pr.texi
250
251# When building GNATS, this target is used to communicate information
252# known only to the GNATS configuration.
253gnats-build: stamp-gnats
254
255stamp-gnats: Makefile
256	${TOOL_SED} -e 's,^GNATS_ROOT =.*,GNATS_ROOT = $(GNATS_ROOT),' \
257	    -e 's,^GNATS_ADDR =.*,GNATS_ADDR = $(GNATS_ADDR),' \
258	    -e 's,^GNATS_SITE =.*,GNATS_SITE = $(GNATS_SITE),' \
259	    -e 's,^DEFAULT_RELEASE =.*,DEFAULT_RELEASE = $(DEFAULT_RELEASE),' \
260	    -e 's%^DEFAULT_ORGANIZATION =.*%DEFAULT_ORGANIZATION = $(DEFAULT_ORGANIZATION)%' \
261	    -e 's,^SUBMITTER =.*,SUBMITTER = $(SUBMITTER),' \
262	    -e 's,^VERSION =.*,VERSION = $(VERSION),' \
263	    -e 's,^MAIL_AGENT =.*,MAIL_AGENT = $(MAIL_AGENT),' \
264 	    -e 's,^SEND_PR_INSTALL =.*,SEND_PR_INSTALL = $(GNATS_INSTALL),' \
265		Makefile > Makefile.tmp \
266	&& mv Makefile.tmp Makefile \
267	&& touch stamp-gnats
268
269# Clean things up.
270
271clean: mostlyclean
272	-rm -f send-pr install-sid send-pr.1 send-pr.el send-pr.elc stamp-gnats
273	-rm -f *.dvi
274
275mostlyclean:
276	-rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
277
278distclean: clean
279	-rm -f Makefile config.status
280	-rm -rf =* ./"#"* *~*
281	-rm -f *.orig *.rej
282
283realclean: distclean
284	-rm -f TAGS send-pr.info* send-pr.??s version.texi
285
286# FIXME
287dist:
288	echo need to do something for dist
289
290check:
291installcheck:
292
293# Prevent GNU make v3 from overflowing arg limit on SysV.
294.NOEXPORT:
295
296Makefile: $(srcdir)/Makefile.in
297	$(SHELL) config.status; \
298	if [ -f ../gnats/Makefile ]; then cd ../gnats; $(MAKE) config-send-pr; fi
299