1151497Sru# Makefile.sub for `groffer' (integration into the `groff' source tree)
2104862Sru
3104862Sru# File position: <groff-source>/contrib/groffer/Makefile.sub
4104862Sru
5151497Sru# Copyright (C) 2001,2002,2005 Free Software Foundation, Inc.
6151497Sru# Written by Werner Lemberg <wl@gnu.org> and Bernd Warken.
7104862Sru
8151497Sru# Last update: 15 August 2005
9104862Sru
10151497Sru# This file is part of `groffer' which is part of `groff'.
11104862Sru
12151497Sru# `groff' is free software; you can redistribute it and/or modify it
13104862Sru# under the terms of the GNU General Public License as published by
14104862Sru# the Free Software Foundation; either version 2, or (at your option)
15104862Sru# any later version.
16104862Sru
17151497Sru# `groff' is distributed in the hope that it will be useful, but
18151497Sru# WITHOUT ANY WARRANTY; without even the implied warranty of
19151497Sru# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20151497Sru# General Public License for more details.
21104862Sru
22104862Sru# You should have received a copy of the GNU General Public License
23151497Sru# along with `groff'; see the files COPYING and LICENSE in the top
24151497Sru# directory of the `groff' source.  If not, write to the Free Software
25151497Sru# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
26104862Sru
27104862Sru########################################################################
28104862Sru
29104862SruMAN1=groffer.n
30104862SruCLEANADD=groffer
31104862Sru
32151497Sru# not all make programs have $(RM) predefined.
33151497SruRM=rm -f
34151497Sru
35104862Sruall: groffer
36104862Sru
37151497Srugroffer: groffer.sh groffer2.sh $(SH_DEPS_SED_SCRIPT)
38151497Sru	$(RM) $@;
39151497Sru	sed -f $(SH_DEPS_SED_SCRIPT) \
40151497Sru            -e "s|@g@|$(g)|g" \
41151497Sru	    -e "s|@BINDIR@|$(bindir)|g" \
42151497Sru	    -e "s|@libdir@|$(libdir)|g" \
43114402Sru	    -e "s|@VERSION@|$(version)$(revision)|g" \
44151497Sru	    -e $(SH_SCRIPT_SED_CMD) $(srcdir)/groffer.sh >$@;
45104862Sru	chmod +x $@
46104862Sru
47104862Sruinstall_data: groffer
48104862Sru	-test -d $(bindir) || $(mkinstalldirs) $(bindir)
49151497Sru	-$(RM) $(bindir)/groffer
50104862Sru	$(INSTALL_SCRIPT) groffer $(bindir)/groffer
51151497Sru	-test -d $(libdir)/groff/groffer || \
52151497Sru          $(mkinstalldirs) $(libdir)/groff/groffer
53151497Sru	-$(RM) $(libdir)/groff/groffer/groffer2.sh
54151497Sru	$(INSTALL_SCRIPT) $(srcdir)/groffer2.sh \
55151497Sru	  $(libdir)/groff/groffer/groffer2.sh
56104862Sru
57104862Sruuninstall_sub:
58151497Sru	-$(RM) $(bindir)/groffer
59151497Sru	-$(RM) $(libdir)/groff/groffer/groffer2.sh
60151497Sru	-rmdir $(libdir)/groff/groffer
61