Makefile.sub   [plain text]


# Makefile.sub for `groffer' (integration into the `groff' source tree)

# File position: <groff-source>/contrib/groffer/Makefile.sub

# Copyright (C) 2001,2002,2005 Free Software Foundation, Inc.
# Written by Werner Lemberg <wl@gnu.org> and Bernd Warken.

# Last update: 15 August 2005

# This file is part of `groffer' which is part of `groff'.

# `groff' 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.

# `groff' 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 `groff'; see the files COPYING and LICENSE in the top
# directory of the `groff' source.  If not, write to the Free Software
# Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.

########################################################################

MAN1=groffer.n
CLEANADD=groffer

# not all make programs have $(RM) predefined.
RM=rm -f

all: groffer

groffer: groffer.sh groffer2.sh $(SH_DEPS_SED_SCRIPT)
	$(RM) $@;
	sed -f $(SH_DEPS_SED_SCRIPT) \
            -e "s|@g@|$(g)|g" \
	    -e "s|@BINDIR@|$(bindir)|g" \
	    -e "s|@libdir@|$(libdir)|g" \
	    -e "s|@VERSION@|$(version)$(revision)|g" \
	    -e $(SH_SCRIPT_SED_CMD) $(srcdir)/groffer.sh >$@;
	chmod +x $@

install_data: groffer
	-test -d $(bindir) || $(mkinstalldirs) $(bindir)
	-$(RM) $(bindir)/groffer
	$(INSTALL_SCRIPT) groffer $(bindir)/groffer
	-test -d $(libdir)/groff/groffer || \
          $(mkinstalldirs) $(libdir)/groff/groffer
	-$(RM) $(libdir)/groff/groffer/groffer2.sh
	$(INSTALL_SCRIPT) $(srcdir)/groffer2.sh \
	  $(libdir)/groff/groffer/groffer2.sh

uninstall_sub:
	-$(RM) $(bindir)/groffer
	-$(RM) $(libdir)/groff/groffer/groffer2.sh
	-rmdir $(libdir)/groff/groffer